Ios – How to preview Storyboard in Xcode using Non-Base localisation

ioslocalizationstoryboardxcode

I have a Storyboard in Xcode 5.1 with a base Localization of English, and a second Localization in French.

When I'm using the Xcode Storyboard editor the strings are shown in English, as expected. Is there any way to make Xcode display the Storyboard in my other localization (French)?

I don't want to change Mac OSX's language, I'm hoping there's an option in Xcode somewhere.

EDIT: I have this in my resources folder
one storyboard and one strings folder

If I double-click Main.storyboard then the storyboard opens showing English (base language), as expected.

Is there a way to view Main.storyboard, but showing the text displayed in Main.strings?

EDIT:
I've since discovered (thanks to this tutorial) that there's a 'preview' option in Xcode. To get this, open the storyboard, click the 'assistant' editor, click the 'assistant editor menu button' (immediately to the right of the > arrow at the top left of the assistant window) and select Preview. This shows how the ViewController will look in landscape/portrait 568/480 high modes. Very handy, but still shows everything in English.

If only this'd let me select a localization, it'd be a great way to check the text layout works in different languages..

xcode preview feature

Best Answer

I believe that Xcode is not prepared to show localized storyboards in Interface Builder when using string files. However, it allows for you to convert formats quite easily. Select your storyboard file and in the utilities panel, select the language you want to preview:

Utilities Panel

Change the "Localizable Strings" to "Interface Build Cocoa Touch Storyboard":

Selection

You should now be able to select the French storyboard file and preview it within IB.

Once you are done, you can convert the file back to "Localizable Strings" reversing this procedure, or using your source code version control system. Then you can update the base file with any necessary adjustments, and verify it is to your liking using this method again.

Related Topic