IOs7 multiple storyboard localization issue

Sylva1n

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.

Xcode screenshot

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?

Alexandre G.

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 :

  1. Select the storyboard
  2. On the right panel, go to the File inspector tab (first from the left)
  3. In Localization, check all language(s)

You now have two ways to localize your storyboard :

  • Either you choose to create a .strings file for your language by choosing Localizable Strings, this will generate a list of strings xcode found in your storyboard.
  • Or you can choose to create a "sub"-storyboard by choosing Interface Builder Cocoa Touch Storyboard which creates a different version of your storyboard for a particular language.

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.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related