iOS - Using Base localization pane is always empty - xcode

In Xcode have added two localizations, German and English. I am following documentation on Apple regarding "Use Base Internationalization" which is obtained by going to the project, clicking Info and pressing on the checkbox.
If I do this, it launches a pane or page which is empty.
IE:
How do I get it to be populated, or otherwise be in a situation to select the relevant resource file?

The answer is to localize your storyboards. Go to storyboard, there is a button called localize. If you do this, the pane is no longer empty.

Check the answer from hassan83 (https://stackoverflow.com/users/1586924/hasan83) in another question. It solved my problems.
https://stackoverflow.com/a/27720065/7017099
"This could happen if Base Internationalization was active before then disabled and files deleted manually.
Create Base.lproj folder in your project folder using the finder.
Move your main story board to it also using the finder.
Fix the reference to it from Xcode.
Remove app from device, clean & build
your project.
All will be back to normal."

Related

Xcode Base Internationalization with no Main.storyboard

I'm trying to follow the tips in Apple's I18N and L10N Guide. I have a pre-existing project from which I have (long ago) deleted the Base.lproj folder. Why? Because I have no Main.storyboard or LaunchScreen.xib. Both of those things are handled programmatically.
However I do have a large number of subsidiary storyboards, including a WatchKit Interface.storyboard. When I click the + in the Project (not target) Localizations section, Xcode presents a dialog that lists only the Interface.storyboard file. Not any of the many others.
How can I persuade Xcode to help me localize the other storyboards? Can I do this all manually? As usual, I am sure it is my mental model that needs refinement.
This is an example where configuration yields convention. That is, if you customize your folder hierarchy, Xcode can adapt and implement its naming conventions.
Select storyboard file in left pane (Project navigator)
Click Doc icon (File inspector) in right pane
Click Localize...
This will create a new Base.proj folder inside whatever folder holds the storyboard. If you are like me, you have done lots of folder-factoring. Xcode goes along with this.
Then you go back to the Project Localizations section and click + to add locales. Xcode creates extracts the strings from your storyboard and creates new folders for the corresponding .strings files.

Asset Catalog Compiler Error - none of the input catalogs contained a matching app icon set named "AppIcon"

Asset Catalog Compiler Error - none of the input catalogs contained a matching app icon set named "AppIcon"
I had a similar problem and I think it was because I accidentally deleted the AppIcon in Images.xcassets. So I will explain what I did.
Open the Images.xcassets in the current project.
Resize the window and move the window(Xcode) to the right.
Start a new project in Xcode(a temporary one). Name it something like "temporaryApp".
Open the Images.xcassets in the temporaryApp. Here, you can see AppIcon.
Click and drag this to Images.xcassets of our previous app, that is placed at the right-hand side of the screen.
And voila, Build Succeeded.
Hope this works for you
Please verify your settings is correct.
I had a same issue and I solved this way.
For me, I added Apple Watch extension within this project and deleting them got me into this trouble.
In the Images.xcassets, I do have "icon" and "info", but the error message was exactly same as yours but for "icon" set.
So I searched within xCode project which contains "icon". and found xcodeproj file > build settings > Asset Catalog Compiler - Options with app icon set name as "icon".
So I deleted icon leave it blank and build again, IT WORKS.
This once happened to me, and I solve it correctly with an easy way :->
choose the file "Images.xcassets", if your project does not have such a resource file, create it.
click your mouse's right key in the blanket, and choose "New App Icon"
build your project again, everything works fine now.
IF NOT, check the project's "Build Settings", and find property "Asset Catalog App Icon Set Name" to see if it was "AppIcon".
You have probably deleted the Appicon in a Assets.xcassets, you can fix it by going to Assets.xcassets -> hitting the + -> App Icons & Launch Image -> New iOS App Icon.
Here's an Image
For whoever comes across this issue in the future. Verify That App Icons-> Source is set to AppIcons, and not "None". See pic
Here is a simple solution
Go to assets
Right click -> IOS -> add AppIcon
Run
This problem might be solved by removing the reference of .xcassets file and adding it back if the AppIcon and info is already setup. It worked for me when i removed the reference to Images.xcassets and then added it to project again from Xcode.
On Xcode 13+
Go to your app info -> General
You will see " App Icon and launch Image", be sure to target the right folder in my case AppIcon.
Screen general app info
If you deleted it, simply go to your "Asset", then click on the plus on the top right of your screen and search for missing folder like "AppIcon" or "AccentColor"
Screen explanation to search for elements
Have a great day 👩🏻‍💻
In my case I run Flutter debug app on IOS Simulator. It took me up to 3 days and I still can't run it. Finally the solution that can get it working again is simply restarting my Macbook.
For me - it was assets catalog (that contained the app icon) had no target membership set.
Please make sure you had that set to appropriate target.
For me the target membership was not set on the icons.

Cannot add localization in Xcode - Spritebuilder project

I have finished my first game project with Spritebuilder and its time for localisation. But, when I try to add a new localisation, even though I follow all the correct steps, no language is added in Xcode and no localised project folder are created after I click finish (see attached photo).
Hint: If I try to add the language again the list with the resource files is empty...
Any ideas?
Faced similar issue with SpriteBuilder, if you prefer Xcode's string format. Try this answer to restore this capability
I deleted the Localizations in Xcode, then I cannot add any Localizations back

My localizations are not taken into account

I'm trying to localize an existing application. Here is a simple thing that I can't make work:
I have added the needed languages into localizations from the project info tab
Activated the l10n for one of my storyboards
Adapted the strings into the newly created .strings files
Cleaned the app
Removed the app from the simulator
Relaunched the app in the simulator
Changed the language in the simulator
No effect...
I am used to i18n in other languages & frameworks and I have to say I never saw it as complicated & unintuitive as in Xcode.
Could someone help me with that ? Am I forgetting something here ?
Here is how I fixed it:
Disable localizations for each resource
Make sure to have Use Base internationalization checked from the project's Info tab
Move all resources that needed localizations somewhere specific (From Finder)
Reattach the references from Xcode (with the right Utilities panel location folder button)
Activate localizations for each resource selecting Base as base
The last step moves each file into Base.lproj and creates a strings files into each selected {lang}.lproj.
For future files to localize, don't put them into Base.lproj yourself, otherwise Xcode will create another Base.lproj subfolder to move the file into.
I think that Xcode organizing files into his own "groups" (almost) totally disconnected from the real folder hierarchy is the thing that constantly confuses me (not even talking about git). I don't really understand the advantage of having this detached hierarchy.

How do I recover a storyboard in xcode?

I have a little bit of a situation here. A few days ago, I accidentally deleted my storyboard, so immediately went into my trash and dragged the storyboard back into the project. Everything worked fine. But then I just emptied my trash and the storyboard no longer appears to be in my project; the storyboard file is showing up red and when I click on it, nothing loads. To my dismay, I thought all was lost so I started building a new storyboard and connecting the classes, outlets and actions.
I then went to build the project on the simulator, and it's building with the OLD storyboard. I thought it might just be loading it from memory so I deleted the app on the simulator and built the project again. Same thing again. So then I built it to my iPhone and somehow the old storyboard is still there even though I can't find it anywhere in my project.
What's going on here? Does this mean I'll be able to recover my storyboard?
Also, when I open the project inspector and go to Build Phases > Copy Bundle Resources, and right click on Storyboard.storyboard, and click show in finder, It shows my new storyboard.
1 - There is a place in Derived Data with following path:
/Users/<Your user name>/Library/Developer/Xcode/DerivedData/<Your App Name>/Build/Products/Debug-iphonesimulator/<app Name.app>
Browse to that location.
2 - On your .app file, right click -> Show Package Contents.
3 - In resulting directory list, browse the folder Base.lproj. Under that you are likely to find your old storyboard.
If you have done Delete Derived Data from XCode organizer, you are not likely to find anything up here. But fortunately, XCode doesn't delete it twice against your own wishes.
So try your luck.
I also faced same problem in Xcode 7.
But when I copy and paste it from Derived Data. I got
"Interface Builder cannot open compiled nibs"
So If you delete storyboard by reference. First, check your project folder (using the Finder). If it's there, you can drag it back into your project in Xcode, or you can use the “Add Files to …” menu option. that file is work perfectly.

Resources