22

Click here to load reader

Beginning iOS App Localization

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Beginning iOS App Localization

Beginning iOS Localization

!

Kyle Davis, Head Geek BigSprocket

http

://w

ww.

flickr.

com

/pho

tos/

5601

3895

@N0

0/12

2872

445

Page 2: Beginning iOS App Localization

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

http://whenwasmylast.com

Page 3: Beginning iOS App Localization

Example Project - “Events”

Small app, unlocalized

“Localize” to English

Localize to Spanish

Page 4: Beginning iOS App Localization

Demo

Page 5: Beginning iOS App Localization

UnlocalizedStrings are hard-coded, and spread throughout the app

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

Page 6: Beginning iOS App Localization

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

Use Auto Layout

Tell Xcode you’ll be localizing the project

Use NSLocalizedString

Page 7: Beginning iOS App Localization

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”

Page 8: Beginning iOS App Localization

Demo

Page 9: Beginning iOS App Localization

Localized to English✓Auto Layout

✓Added Localization in Project file

✓Added NSLocalizedString macro

✓Used genstrings to create base localization

✓Ready for Translation

Page 10: Beginning iOS App Localization

Personal Design DecisionsNo NIB localization

Strings Factory

You may decide to do things differently.

Page 11: Beginning iOS App Localization

Language.lprojAny file with localized content

.strings, .xib, html, text

image, sound, video

Standard file loaders understand it

imageNamed:

pathForResource:ofType:

Page 12: Beginning iOS App Localization

Language ResourcesFriends

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

Third party professional translators

AppleGlot

Page 13: Beginning iOS App Localization

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

iCanLocalize.com

oneskyapp.com

Page 14: Beginning iOS App Localization

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

Page 15: Beginning iOS App Localization

Demo

Page 16: Beginning iOS App Localization

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

Page 17: Beginning iOS App Localization

Almost There!App Store Metadata

Description

Screenshots

Keywords

Page 18: Beginning iOS App Localization

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

Page 19: Beginning iOS App Localization

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

Page 20: Beginning iOS App Localization

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

Page 21: Beginning iOS App Localization

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/