Tuesday, March 27, 2018

NSDoubleLocalizedStrings and Friends

The NSDoubleLocalizedStrings user default is a reasonably well-known and officially documented localization debugging aide. It repeats the text of each localized string, making it double-length so that you can test whether your layout still works.

Another longstanding one is NSShowNonLocalizedStrings, which logs to Console when a string can’t be found.

Interface Builder also lets you preview views using an “Accented Pseudolanguage” and a “Bounded String Pseudolanguage.” These correspond to the NSAccentuateLocalizedStrings and NSSurroundLocalizedStrings user defaults.

Finally, there are NSForceRightToLeftLocalizedStrings and AppleTextDirection to enable the “Right to Left Pseudolanguage.” This lets you use test right-to-left layout (e.g. for Arabic) using strings from your development language.

1 Comment RSS · Twitter

When testing support for the right-to-left layout, there is another handy option called `NSForceRightToLeftWritingDirection`. Compared to `NSForceRightToLeftLocalizedStrings`, it is applied to the whole UI instead of the localized strings only.

Leave a Comment