Domanda

I'm migrating away from one-XIB-per-locale to a single Base interface with Auto-Layout that is localized using .strings files.

How can I easily preview localized versions of my interface?

I'd like to see how my UI looks in German, Chinese and Arabic without having to change system-wide language preferences each time.

Selecting another language in Interface Builder's "Jump Bar" just shows me raw the .strings file source. IB's "Simulate Document" only shows me document in my current language.

È stato utile?

Soluzione

You can launch application in a particular language with an extra argument:

Foo.app/Contents/MacOS/Foo  -AppleLanguages '(de)'

However, that's not enough for Arabic, as it sets the language, but doesn't enable RTL layout:

app -AppleLanguages '(ar)' -NSForceRightToLeftWritingDirection YES -AppleTextDirection YES
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top