Beginning iOS App Localization

Preview:

DESCRIPTION

Slides from Kyle Davis's iOS App Localization presentation at the Houston iPhone Developer Meetup Group

Citation preview

Beginning iOS Localization

!

Kyle Davis, Head Geek BigSprocket

http

://w

ww.

flickr.

com

/pho

tos/

5601

3895

@N0

0/12

2872

445

When Was My Last?My first localized app. !Currently: Spanish, French, German (and, of course, English)

http://whenwasmylast.com

Example Project - “Events”

Small app, unlocalized

“Localize” to English

Localize to Spanish

Demo

UnlocalizedStrings are hard-coded, and spread throughout the app

System-localizable elements are in English, even when simulator is in Spanish

Preparing for LocalizationUse system items (UIBarButtonSystemItem, UIDatePicker, etc)

Use Auto Layout

Tell Xcode you’ll be localizing the project

Use NSLocalizedString

NSLocalizedStringInstead 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”

Demo

Localized to English✓Auto Layout

✓Added Localization in Project file

✓Added NSLocalizedString macro

✓Used genstrings to create base localization

✓Ready for Translation

Personal Design DecisionsNo NIB localization

Strings Factory

You may decide to do things differently.

Language.lprojAny file with localized content

.strings, .xib, html, text

image, sound, video

Standard file loaders understand it

imageNamed:

pathForResource:ofType:

Language ResourcesFriends

Google Translate (sparingly, and only if you have to)

Third party professional translators

AppleGlot

Third Party TranslatorsApple maintains a list athttp://developer.apple.com/internationalization

iCanLocalize.com

oneskyapp.com

AppleGlot http://developer.apple.com/internationalization

Reads translation glossaries and substitutes text directly back into nib files

Supports incremental translations

I did not use it …

… but Apple also supplies their glossaries, which are damn handy

Demo

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

Almost There!App Store Metadata

Description

Screenshots

Keywords

NSLocalizedStringFromTable

NSLocalizedStringFromTable(@“key”, @“table”, @“comment”)

Reads from table.strings

Save time and money

No need to have 3rd parties translate Apple’s text

Reuse your tables on the next project

Tools I Didn’t Coveribtool - localize your nib files

.stringsdict - rules-based handling of special cases, like plurals

twine - fix some of the broken parts of the process

LinksApple 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

Twinehttps://github.com/mobiata/twine

LinksSlide deckhttp://www.slideshare.net/bigsprocket/beginning-ios-app-localization

Final project source http://github.com/bigsprocket/Localization

When Was My Last?http://whenwasmylast.com/

Kyle Daviskyle@bigsprocket.com @kylebits

http

://te

xtim

age.

usinfo@bigsprocket.com @bigsprocket

Recommended