Reputation: 119
I use several storyboards and I have just decided to localize them (.strings files have been generated by Xcode).
I notice that in the Build Phases > Copy Bundle Resources, all resources related to localization appear in red.
At run time, localization works only on the main storyboard. Localization with Localizable.strings also works. But it doesn't on the other storyboards.
I tried to restart Xcode but it didn't change anything. (cf Base internationalization and multiple storyboard not working right)
My localized storyboards were previously compiled. I f I add another storyboard, localize it and lauch the compilation, it fails with this error:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'Maintenance' in bundle NSBundle (...)
Do you have any idea to solve this issue?
Upvotes: 3
Views: 4041
Reputation: 36
One of the reasons for the red Localizable.strings or other Localization-files which can't be copied in the 'Copy Bundle Resources' can be the setting for the 'Localization native development region' in your Target settings.
This region should be added to the 'Localizations' of your project.
I.e. if the 'Localization native development region' is 'en', then 'English' should be added as Localization in your project settings.
Upvotes: 0
Reputation: 1779
This error is probably due to the fact that you didn't implement one of more languages you chose to localize in your application settings.
In order to implement a language in a storyboard :
You now have two ways to localize your storyboard :
.strings
file for your language by choosing Localizable Strings, this will generate a list of strings xcode found in your storyboard.So far I only found one way to refresh the .strings file in xcode if you add new strings : simply uncheck and recheck the language and select "Replace File" when asked. Apple also provides a tool you can use in the terminal. Finally there's a script that does it automatically.
Upvotes: 1
Reputation: 129
Now you see that the Build Phases is correct, and you should be able to run your project.
Upvotes: 0