Nipje
Nipje

Reputation: 43

Xcode removing language specific storyboards iOS

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!

Upvotes: 2

Views: 1486

Answers (2)

user3816012
user3816012

Reputation: 41

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).

Upvotes: 4

geo
geo

Reputation: 1791

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

Upvotes: 1

Related Questions