Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode localization testing scheme arguments

I thought I read this somewhere but can't find it here or on the web. Was I dreaming?

When testing auto layouts and localizations, is there a way in XCode to add an argument to a scheme for it to change the English text to longer text for testing purposes to make sure the layouts adjust to longer languages?

like image 933
Jason Hocker Avatar asked Aug 13 '13 14:08

Jason Hocker


3 Answers

Go to Product->Scheme->Edit scheme. Choose Run section on the left and add to "Arguments Passed On Launch" this (for example):

-AppleLanguages "(Italian)"

To make it more relevant, here is helpful post on NSHipster: http://nshipster.com/launch-arguments-and-environment-variables/

like image 148
Vladimir Shutyuk Avatar answered Oct 10 '22 12:10

Vladimir Shutyuk


Abizern has the correct answer, but a typo. The correct key is NSDoubleLocalizedStrings (note the ending "s"). Add this as an argument passed on launch, like

-NSDoubleLocalizedStrings YES
like image 44
Jerry Avatar answered Oct 10 '22 12:10

Jerry


You weren't dreaming, it was demonstrated in one of the WWDC13 videos. The key you are looking for is:

NSDoubleLocalizedStrings

which doubles the localised strings that your application uses, which means that UI elements that load these strings will be enlarged and you can see that your auto layouts can handle the newly constrained objects.

like image 31
Abizern Avatar answered Oct 10 '22 11:10

Abizern