2

A while ago i decided to make my application multilanguage. I ended up using localizable.strings. So a different file for each language with all the translations in it.

In my main storyboard i just use NSLocalizedString(@"example", nil); on all my elements etc.

The problem i have is that i just found out that i somehow ended up with a storyboard for each language. I can fold out my MainStoryboard_iPhone.storyboard and under this it lists the language specific storyboards (MainStoryboard_iPhone.storyboard (English) and MainStoryboard_iPhone.storyboard (Dutch). Since i do not use this because i do everything with the localizable.strings i do not need this language specific storyboards. Over time they also became inconsistent. The english board has all the current changes and the dutch one does not.

My question is:

How can i safely remove these language specific storyboards and just keep using the localizable.strings. I want to end up with only 1 main storyboard (the top level one in the image above). I do not want to ruin my project and i want to be sure that the solution i use is correct.

Thank you!

geo
  • 1,781
  • 1
  • 18
  • 30
Nipje
  • 43
  • 1
  • 4

2 Answers2

4

I had the same issue.

I solved it by selecting "Base internationalization" in the project settings. Next, click the file inspector icon (right pane) for your storyboard file and make sure only Base is checked. Do not check the other languages.

This will fix the issue.

Don't bother with Base internationalization for your localizable.strings file, you can still use your regular translation setup there (ie, English and Dutch).

1

To "roll back" a localized File. you have to navigate to the folder where your class should be. You see the folder "en.lporj" (and the other languages) and there is the file you need.

enter image description here

-

enter image description here

Now copy to a save place, remove the multi-language file and in xcode and tell to remove from disk. Copy it again into your folder where you need it and import it in xcode.

enter image description here

Now the settings for the translation are resettet. you should recheck if no links went lost (simple clean build should be enought for this).

I handle only .xib file at the moment, but the procedure should be the same for all files :) (if not, please let me know :D)

Greets, geo

geo
  • 1,781
  • 1
  • 18
  • 30
  • So there isn't any way to just get rid of the language specific storyboards and keep the Localizable.strings files? Because that is how i want to realize my translations. Excuse me if i'm a bit lost here! – Nipje May 15 '13 at 08:47
  • the "Localizable.strings" are not included but used seperatly, aren't they? so you don't have to delete them (they are included somewhere else in your project I think) – geo May 15 '13 at 08:56
  • I am not sure. On my project > info tab i have added the languages. Is that what caused the language specific storyboards to appear? – Nipje May 15 '13 at 09:09
  • hmm, so every of your classes is activated for multi-language? haven't set this property and activate every file that I need for localization :/ – geo May 15 '13 at 12:41
  • I don't think i need to activate my classes. I just use NSLocalizedString(@"example", nil); in my viewcontrollers and that gets the value from the localizable.strings file based on the iphone system language. I don't understand where the language specific storyboards come from. – Nipje May 15 '13 at 14:50
  • The whole big problem is that when i change language it also changes to the language specific storyboard. I just want to use 1 single storyboard and the localizable.strings files for translations. Is this possible? – Nipje May 16 '13 at 14:40
  • it is, I also do so. but I have not added the multiple languages to the info.plist but added the Localizable.strings to the project and set only this file as localized. – geo May 16 '13 at 14:49
  • It is possible to use one Storyboard file and have the translations in separate .strings files. You can set it like this: Select the storyboard in Xcode, select File inspector on the right, and you can change between Storyboard/Strings file in the "Localization" section. – gklka Jan 23 '14 at 21:11