5. Unlocalized
Strings are hard-coded, and spread throughout the
app
System-localizable elements are in English, even when
simulator is in Spanish
6. Preparing for Localization
Use system items (UIBarButtonSystemItem,
UIDatePicker, etc)
Use Auto Layout
Tell Xcode you’ll be localizing the project
Use NSLocalizedString
7. NSLocalizedString
Instead of @“foo”, use
NSLocalizedString(@“foo”…
Looks for a string with the key “foo” in the file
Localizable.strings, in the language folder
If it doesn’t exist, it looks in the Base folder
If it doesn’t exist there, it returns “foo”
9. Localized to English
✓Auto Layout
✓Added Localization in Project file
✓Added NSLocalizedString macro
✓Used genstrings to create base localization
✓Ready for Translation
11. Language.lproj
Any file with localized content
.strings, .xib, html, text
image, sound, video
Standard file loaders understand it
imageNamed:
pathForResource:ofType:
16. Localized to Spanish
✓
Use language glossaries to find translations
✓
Use 3rd parties for things not covered by Apple already
✓
Use date formatter templates for locale differences
✓
Use InfoPlist.strings to localize app name
19. Tools I Didn’t Cover
ibtool - localize your nib files
.stringsdict - rules-based handling of special cases, like
plurals
twine - fix some of the broken parts of the process
20. Links
Apple Internationalization resources
http://developer.apple.com/internationalization
Florian Kugler on string localization
http://www.objc.io/issue-9/string-localization.html
Ole Begemann on Automating Strings Extraction from
Storyboards/Nibs
http://tinyurl.com/mmxaeeq
Twine
https://github.com/mobiata/twine