Localizing Mobile Apps

115
Localizing Mobile Apps Daniel Schneller, CenterDevice GmbH

description

English Slides for my talk originally given at Developer Week 2014 in Nuremberg, Germany. It covers internationalization and localization of mobile applications, using iOS as an example platform. I look at text, numbers, date and time, images and other resources, using correct plural forms and more. There is an example application available on GitHub: https://github.com/dschneller/I18N-Example

Transcript of Localizing Mobile Apps

Page 1: Localizing Mobile Apps

Localizing Mobile AppsDaniel Schneller, CenterDevice GmbH

Page 2: Localizing Mobile Apps

AgendaI18N vs. L10N

Languages and Regions

Text

Date and Time

Numbers

Images and other Resources

https://github.com/dschneller/I18N-Example

Page 3: Localizing Mobile Apps

I18N vs. L10N

Page 4: Localizing Mobile Apps

I18N

L10N

Page 5: Localizing Mobile Apps

I — 18 Characters — N

L-10 Characters-N

Page 6: Localizing Mobile Apps

InternationalizationI — 18 Characters — N

LocalizationL-10 Characters-N

Page 7: Localizing Mobile Apps

Internationalization

Page 8: Localizing Mobile Apps

Internationalization[…] process of designing a software application so that it

can potentially be adapted to various languages andregions without engineering changes. […]*

* Wikipedia

Page 9: Localizing Mobile Apps

Localization

Page 10: Localizing Mobile Apps

Localization[…] the process of adapting internationalized software fora specific region or language by adding locale-specific

components and translating text. […]*

* Wikipedia

Page 11: Localizing Mobile Apps
Page 12: Localizing Mobile Apps

I18N L10NApp LocalizedApp

!"#$%&!

! 🌐 🌐 !"#

$%&

Page 13: Localizing Mobile Apps

Languages and Regions

Page 14: Localizing Mobile Apps

Languages and RegionsLanguage ≠ Region

12h time used by an American living in Germany

„Jänner“ – „Januar“ [German in Austria vs. in Germany for January]

Localization ≠ Locale German user might prefer English user interface texts

But: 24h time display

Page 15: Localizing Mobile Apps

Languages and Regions

Page 16: Localizing Mobile Apps

Languages and Regions

Page 17: Localizing Mobile Apps

Languages and Regions

Page 18: Localizing Mobile Apps

Languages and RegionsScheme Launch Arguments

-AppleLanguages (ar,de,fr)

Order determines preference

-AppleLocale en_US

Page 19: Localizing Mobile Apps

NSLocaleEncapsulates Region Settings

+ (id)autoupdatingCurrentLocale+ (id)currentLocale

NSCurrentLocaleDidChangeNotification [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(localeDidChange:) name:NSCurrentLocaleDidChangeNotification object:nil]

Refresh formatters, caches NSLocale instances

Refresh screen content

Page 20: Localizing Mobile Apps

NSLocale-[NSLocale objectForKey:]

NSString* NSLocaleIdentifier NSString* NSLocaleMeasurementSystem

NSString* NSLocaleLanguageCode NSString* NSLocaleDecimalSeparator

NSString* NSLocaleCountryCode NSString* NSLocaleGroupingSeparator

NSString* NSLocaleScriptCode NSString* NSLocaleCurrencySymbol

NSString* NSLocaleVariantCode NSString* NSLocaleExemplarCharacterSet

NSString* NSLocaleCurrencyCode NSString* NSLocaleCollatorIdentifier

NSString* NSLocaleCalendar NSString* NSLocaleQuotationBeginDelimiterKey

NSString* NSLocaleCollationIdentifier NSString* NSLocaleQuotationEndDelimiterKey

NSString* NSLocaleUsesMetricSystem

Page 21: Localizing Mobile Apps

NSLocaleDoes not contain the current language!

Locale ≠ Localization [NSBundle mainBundle].localizations; // NSArray, (all)

[NSBundle mainBundle].preferredLocalizations[0]; // (current)

Caveats Localizations of InfoPlist.strings determine content of „localizations“

Intersected with user’s region preferences in Settings.app

AppleLanguages launch parameter

Page 22: Localizing Mobile Apps

Text

Page 23: Localizing Mobile Apps
Page 24: Localizing Mobile Apps
Page 25: Localizing Mobile Apps

Text ≠ TextLanguage of messages, buttons, labels etc. Writing direction & alignment Writing systems (Latin, Hebrew, Arabic…) Numbers in text Names & addresses Phrases, idioms and terminology Plurals Sorting …

Page 26: Localizing Mobile Apps

Text ≠ TextLanguage of messages, buttons, labels etc. Writing direction & alignment Writing systems (Latin, Hebrew, Arabic…) Numbers in text Names & addresses Phrases, idioms and terminology Plurals Sorting …

Page 27: Localizing Mobile Apps

Base Localization

Page 28: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Page 29: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Add Localization

Page 30: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Add Localization

Page 31: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Add Localization

“.strings” files

Page 32: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Add Localization

“.strings” filesgenstrings

Page 33: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Add Localization

“.strings” filesgenstrings

ibtool

Page 34: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Add Localization

“.strings” filesgenstrings

ibtool

One copy per language

Page 35: Localizing Mobile Apps

Base LocalizationOne leading (base) language

Add Localization

“.strings” filesgenstrings

ibtool

One copy per language“.lproj” Ordner

Page 36: Localizing Mobile Apps

Base LocalizationEine Leitsprache (Base)

“.strings” Files genstrings

ibtool

Eine Kopie pro Sprache “.lproj” Ordner

Page 37: Localizing Mobile Apps

Base LocalizationEine Leitsprache (Base)

“.strings” Files genstrings

ibtool

Eine Kopie pro Sprache “.lproj” Ordner

Page 38: Localizing Mobile Apps

Base LocalizationEine Leitsprache (Base)

“.strings” Files genstrings

ibtool

Eine Kopie pro Sprache “.lproj” Ordner

Page 39: Localizing Mobile Apps

Base Localization…

/* Class = "IBUILabel"; text = "Loaded by SecondViewController"; ObjectID = "NDk-cv-Gan"; */

"NDk-cv-Gan.text" = "Loaded by SecondViewController";

"

/* Class = "IBUILabel"; text = "First View"; ObjectID = "KQZ-1w-vlD"; */

"KQZ-1w-vlD.text" = "First View";

Page 40: Localizing Mobile Apps

Base LocalizationPreview in Assistant Editor

Xcode 6: Pick Language

Double-Length Pseudo-Language

Auto Layout

Page 41: Localizing Mobile Apps

NSLocalizedStringFamily of macros

NSLocalizedStringNSLocalizedStringFromTableNSLocalizedStringFromTableInBundleNSLocalizedStringWithDefaultValue

Access “.strings” files

Utilize NSBundle -[[NSBundle mainBundle] localizedStringForKey:value:table:]

Page 42: Localizing Mobile Apps

NSLocalizedStringExample

[button setTitle:NSLocalizedString(@"reset.counter.button.title", @"Reset Counter action button") forState:…];

genstrings — Localizable.strings /* Reset Counter action button */"reset.counter.button.title" = "Zurücksetzen";

Page 43: Localizing Mobile Apps

.strings FilesUpdates?

Page 44: Localizing Mobile Apps

.strings FilesUpdates?

Use ibtool every time you update your labels and text.In the Base.lproj folder:ibtool ChangedNib.xib --generate-strings-file NewStrings.stringsOpen the generated output file and copy all new string entries to ChangedNib.strings in each lproj.

#fail

Page 45: Localizing Mobile Apps

Do not normalize text

Page 46: Localizing Mobile Apps

Do not normalize textDRY! — Do Repeat Yourself

[NSString stringWithFormat:@”…”]

Page 47: Localizing Mobile Apps

Do not normalize textDRY! — Do Repeat Yourself

[NSString stringWithFormat:@”…”]

Localizable.strings“count” = “Anzahl”

“game” = “Spiel”

“reset” = “zurücksetzen”

“save” = “sparen”

“thumbnail” = “Daumennagel”

Page 48: Localizing Mobile Apps

Do not normalize textDRY! — Do Repeat Yourself

[NSString stringWithFormat:@”…”]

Localizable.strings“count” = “Anzahl”

“game” = “Spiel”

“reset” = “zurücksetzen”

“save” = “sparen”

“thumbnail” = “Daumennagel”

“reset count”

”zurücksetzen Anzahl”

“save game”

“sparen Spiel”

Page 49: Localizing Mobile Apps

Do not normalize text

Page 50: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Page 51: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Structure of sentences

Page 52: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Structure of sentences

Declination & conjugation …

Page 53: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Structure of sentences

Declination & conjugation …

Use dedicated strings per use case

Page 54: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Structure of sentences

Declination & conjugation …

Use dedicated strings per use case“reset.counter.button” = “Auf 0 stellen”

Page 55: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Structure of sentences

Declination & conjugation …

Use dedicated strings per use case“reset.counter.button” = “Auf 0 stellen”

Context for translators

Page 56: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Structure of sentences

Declination & conjugation …

Use dedicated strings per use case“reset.counter.button” = “Auf 0 stellen”

Context for translatorsUse self explanatory keys

Page 57: Localizing Mobile Apps

Do not normalize textContext and grammar are lost

Structure of sentences

Declination & conjugation …

Use dedicated strings per use case“reset.counter.button” = “Auf 0 stellen”

Context for translatorsUse self explanatory keys

Provide useful comments (button vs. label, approx. length, etc.)

Page 58: Localizing Mobile Apps

VariablesParameters

[NSString stringWithFormat: NSLocalizedString(@"click.counter.label", @"P1: Current Click Count."), self.clickCount]

"

/* P1: Current Click Count. */"click.counter.label" = "%1d x geklickt”;

Page 59: Localizing Mobile Apps

VariablesDocument parameter order!

“Zeige 4 von 12 gesamt”

“Total 12 — Showing 4”

/* … Param 1: current page; Param 2: total count */"current.page.label" = “Zeige %1d von %2d gesamt”;/* … Param 1: current page; Param 2: total count */"current.page.label" = “Total %2d — Showing %1d”;

Page 60: Localizing Mobile Apps

Special cases: 0 and 1

Plurals

Englisch German

0 No books Keine Bücher1 One book Ein Buch

sonstiges 100 books 100 Bücher

Localizable.strings“books.0” = “No Books”

“books.1” = “One Book”

“books.n” = “%1d books”

“books.0” = “Keine Bücher”

“books.1” = “Ein Buch”

“books.n” = “%1d Bücher”

If-else-clause in the code: Problem solved.

Page 61: Localizing Mobile Apps

Englisch Deutsch

0 No books Keine Bücher1 1 book 1 Buch

Vielleicht nicht ganz…

Plural

Page 62: Localizing Mobile Apps

Englisch Deutsch

0 No books Keine Bücher1 1 book 1 Buch2 2 books 2 Bücher

wenige 3 books 3 Bücherviele 11 books 11 Bücher

sonstiges 100 books 100 Bücher

Vielleicht nicht ganz…

Plural

Page 63: Localizing Mobile Apps

0

1

2

wenige

viele

sonstiges

Englisch

No books1 book2 books3 books11 books100 books

German

Keine Bücher1 Buch

2 Bücher3 Bücher

11 Bücher100 Bücher

Or is it…?

Plural

Page 64: Localizing Mobile Apps

0

1

2

wenige

viele

sonstiges

Englisch

No books1 book2 books3 books11 books100 books

German

Keine Bücher1 Buch

2 Bücher3 Bücher

11 Bücher100 Bücher

Arabic

٠ كتابكتابكتابان

٣ كتب١١ كتابًا١٠٠ كتاب

Or is it…?

Plural

Page 65: Localizing Mobile Apps

.strings + .stringsdict

* http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ar

Page 66: Localizing Mobile Apps

.strings + .stringsdictAvailable since iOS7

* http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ar

Page 67: Localizing Mobile Apps

.strings + .stringsdictAvailable since iOS7

Implements (Unicode*) localization rules forPlural

Gender [rdar://16670931]

* http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ar

Page 68: Localizing Mobile Apps

.strings + .stringsdictAvailable since iOS7

Implements (Unicode*) localization rules forPlural

Gender [rdar://16670931]

Plist FormatName must match .strings

.strings must exist, but may be empty

* http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html#ar

Page 69: Localizing Mobile Apps

.strings + .stringsdict

https://developer.apple.com/library/ios/releasenotes/Foundation/↩︎ RN-Foundation/index.html#//apple_ref/doc/uid/TP30000742-CH2-SW56

<dict>    <key>files.selected.label.%d</key>    <dict>        <key>NSStringLocalizedFormatKey</key> <string>%#@num_files_are@ selected</string>        <key>num_files_are</key>  <dict>            <key>NSStringFormatSpecTypeKey</key> <string>NSStringPluralRuleType</string>            <key>NSStringFormatValueTypeKey</key> <string>d</string>            <key>zero</key>    <string>No file is</string>            <key>one</key>     <string>A file is</string>            <key>other</key>   <string>%d files are</string>        </dict>    </dict></dict>

Page 70: Localizing Mobile Apps

.stringsdictCategories per language according to Unicode

iOS additionally supports „zero“ category for all languages

Others, e. g. „few“, depend on language

Page 71: Localizing Mobile Apps

String TablesLocalizable.strings

Default used by NSLocalizedString()

Big projects — big file

Can be split NSLocalizedStringFromTable(“MyController”, “Key”, “Comment”)

MyController.strings

Project structure — Context for translators

3rd party code

Also works for .stringsdict

Page 72: Localizing Mobile Apps

Date and Time

Page 73: Localizing Mobile Apps

Date and Time NSDateFormatter

Page 74: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatter

Page 75: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatterStyle

NSDateFormatter

Page 76: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatterStyle

German / Germany Englisch / USA

NSDateFormatter

Page 77: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatterStyle

German / Germany Englisch / USA

Short 08.07.14 22:32 7/8/14,10:32 PM

NSDateFormatter

Page 78: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatterStyle

German / Germany Englisch / USA

Short 08.07.14 22:32 7/8/14,10:32 PM

Medium 08.07.2014 22:32:36 Jul 8, 2014, 10:32:36 PM

NSDateFormatter

Page 79: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatterStyle

German / Germany Englisch / USA

Short 08.07.14 22:32 7/8/14,10:32 PM

Medium 08.07.2014 22:32:36 Jul 8, 2014, 10:32:36 PM

Long 8. Juli 2014 22:32:36 MESZ Jul 8, 2014, 10:32:36 PM GMT+2

NSDateFormatter

Page 80: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatterStyle

German / Germany Englisch / USA

Short 08.07.14 22:32 7/8/14,10:32 PM

Medium 08.07.2014 22:32:36 Jul 8, 2014, 10:32:36 PM

Long 8. Juli 2014 22:32:36 MESZ Jul 8, 2014, 10:32:36 PM GMT+2

Full Dienstag, 8. Juli 2014 12:32:36 Mitteleuropäische Sommerzeit

Tuesday, July 8, 2014 at 12:39:16 PM Central European Summer Time

NSDateFormatter

Page 81: Localizing Mobile Apps

Date and TimeTransforms between NSDate and NSString

+[NSDateFormatter localizedStringFromDate:dateStyle:timeStyle:] -[NSDateFormatter setLocale:]

NSDateFormatterStyle

German / Germany Englisch / USA

Short 08.07.14 22:32 7/8/14,10:32 PM

Medium 08.07.2014 22:32:36 Jul 8, 2014, 10:32:36 PM

Long 8. Juli 2014 22:32:36 MESZ Jul 8, 2014, 10:32:36 PM GMT+2

Full Dienstag, 8. Juli 2014 12:32:36 Mitteleuropäische Sommerzeit

Tuesday, July 8, 2014 at 12:39:16 PM Central European Summer Time

No - -

NSDateFormatter

Page 82: Localizing Mobile Apps

Date and TimeNSDateFormatter.h

typedef enum { NSDateFormatterNoStyle = …, NSDateFormatterShortStyle = …, NSDateFormatterMediumStyle = …, NSDateFormatterLongStyle = …, NSDateFormatterFullStyle = …} NSDateFormatterStyle

Combine for date and time portions NSDateFormatterNoStyle — only date / time

Get updated with the OS

NSDateFormatter

Page 83: Localizing Mobile Apps

Date and Time NSDateFormatter

* http://www.unicode.org/reports/tr35/tr35-dates.html#Contents

Page 84: Localizing Mobile Apps

Date and TimeWhat if defaults are not suitable?

NSDateFormatter

* http://www.unicode.org/reports/tr35/tr35-dates.html#Contents

Page 85: Localizing Mobile Apps

Date and TimeWhat if defaults are not suitable?

Do not use hard coded format strings!

NSDateFormatter

* http://www.unicode.org/reports/tr35/tr35-dates.html#Contents

Page 86: Localizing Mobile Apps

Date and TimeWhat if defaults are not suitable?

Do not use hard coded format strings!

Unicode Locale Data Markup Language*

NSDateFormatter

* http://www.unicode.org/reports/tr35/tr35-dates.html#Contents

Page 87: Localizing Mobile Apps

Date and TimeWhat if defaults are not suitable?

Do not use hard coded format strings!

Unicode Locale Data Markup Language*[f setDateFormat:[NSDateFormatter dateFormatFromTemplate:@"u QQ" options:0 locale:LOCALE_EN_US]];NSLog(@“%@", [f stringFromDate:july8th);

NSDateFormatter

* http://www.unicode.org/reports/tr35/tr35-dates.html#Contents

Page 88: Localizing Mobile Apps

Date and TimeWhat if defaults are not suitable?

Do not use hard coded format strings!

Unicode Locale Data Markup Language*[f setDateFormat:[NSDateFormatter dateFormatFromTemplate:@"u QQ" options:0 locale:LOCALE_EN_US]];NSLog(@“%@", [f stringFromDate:july8th);

Q3 2014

NSDateFormatter

* http://www.unicode.org/reports/tr35/tr35-dates.html#Contents

Page 89: Localizing Mobile Apps

Relative formatting [formatter setDoesRelativeDateFormatting:YES];NSLog(@“%@, %@, %@…", [formatter stringFromDate:GESTERN], [formatter stringFromDate:HEUTE], [formatter stringFromDate:MORGEN]);

Gestern, Heute, Morgen… [de_DE]

Yesterday, Today, Tomorrow… [en_US]

Yesterday, Today, Tomorrow…

Page 90: Localizing Mobile Apps

NSDateComponentsFormatter Formats durations

[f stringFromTimeInterval:1234.0]) // seconds

About 20 minutes remaining

NSDateIntervalFormatter Formats time intervals

[f stringFromDate:NOW toDate:LATER])

09.07.14 12:10-13:13

Coming up next: iOS8

Page 91: Localizing Mobile Apps

Numbers

Page 92: Localizing Mobile Apps

Numbers

Page 93: Localizing Mobile Apps

Numbers

“Plain” Numbers

Page 94: Localizing Mobile Apps

Numbers

MassDistance

LengthCurrency

PercentageData Volume

WeightEnergy

Spelled Out

“Plain” Numbers

Page 95: Localizing Mobile Apps

NumbersDecimal separators

Grouping characters

Currency symbols

"

NSNumberFormatter API similar to NSDateFormatter

Page 96: Localizing Mobile Apps

Numbers NSNumberFormatter

German / Germany English / USA

No 1234,56 1234.56

Decimal 1.234,56 1,234.56

Currency 1.234,56 € $1,234.56

Percent 123.456% 123,456%

Scientific 1,23456E+03 1.23456E3

SpellOut eintausendzweihundertvier-unddreißig Komma fünf sechs

one thousand two hundred thirty-four point five six

Page 97: Localizing Mobile Apps

NumbersNSNumberFormatter.h

enum { NSNumberFormatterNoStyle = …, NSNumberFormatterDecimalStyle = …, NSNumberFormatterCurrencyStyle = …, NSNumberFormatterPercentStyle = …, NSNumberFormatterScientificStyle = …, NSNumberFormatterSpellOutStyle = …} typedef NSUInteger NSNumberFormatterStyle

Page 98: Localizing Mobile Apps

Numbers NSNumberFormatter

Page 99: Localizing Mobile Apps

NumbersNSNumberFormatter* f = [[NSNumberFormatter alloc] init];f.numberStyle = NSNumberFormatterNoStyle;

f.locale = LOCALE_DE_AT; NSLog(@"NoStyle de_AT: %@", [f stringFromNumber:@(1234.56)]);

f.locale = LOCALE_EN_US; f.maximumFractionDigits = 2;NSLog(@“NoStyle en_US: %@", [f stringFromNumber:@(1234.56)]);

NSNumberFormatter

Page 100: Localizing Mobile Apps

NumbersNSNumberFormatter* f = [[NSNumberFormatter alloc] init];f.numberStyle = NSNumberFormatterNoStyle;

f.locale = LOCALE_DE_AT; NSLog(@"NoStyle de_AT: %@", [f stringFromNumber:@(1234.56)]);

f.locale = LOCALE_EN_US; f.maximumFractionDigits = 2;NSLog(@“NoStyle en_US: %@", [f stringFromNumber:@(1234.56)]);

NoStyle de_AT: 1235

NoStyle en_US: 1234.56

NSNumberFormatter

Page 101: Localizing Mobile Apps

NumbersMany more customization options

maximumFractionDigits

usesSignificantDigits

minimum/maximumSignificantDigits

paddingCharacter

roundingMode, roundingIncrement

NSNumberFormatter

Page 102: Localizing Mobile Apps

Data VolumeNSByteCountFormatter

File size, amount of memory

Picks suitable unit automatically

Non-numeric display

Allow Non-Numeric Zero KB

File 1,234.57 GB

Memory 1,149.78 GB

Page 103: Localizing Mobile Apps

Coming up next: iOS8NSEnergyFormatter

Energy in joule, calories etc.

NSLengthFormatter Distance, in miles, kilometers etc.

NSMassFormatter Mass and weight in pounds, kg etc.

Page 104: Localizing Mobile Apps

Images and other Resources

Page 105: Localizing Mobile Apps

ImagesButtons

UI Elements

Page 106: Localizing Mobile Apps

UI Elements-[UIImage imageNamed:@"myImage"];

Put image files into .lproj folders

Does not work for asset catalogues

Page 107: Localizing Mobile Apps

Launch ImageDisable asset catalogue

Launch images in .lproj folders

Follows usual naming conventions for Retina

Orientation

iPhone vs. iPad

Page 108: Localizing Mobile Apps

Other RessourcesSame as images

Lookup via -[[NSBundle mainBundle] pathForResource:ofType:]

Use cases HTML

Text files

Page 109: Localizing Mobile Apps

App NameInfo.plist

Application has localized Display Name

<key>LSHasLocalizedDisplayName</key><true />

InfoPlist.strings "CFBundleDisplayName" = "国际范例";

Page 110: Localizing Mobile Apps

Wrap up

Page 111: Localizing Mobile Apps

Cover the BasicsLocale based formatting

NSDateFormatter

NSNumberFormatter

NSByteCountFormatter

Careful and diligent translation Remember resources besides the source code

Page 112: Localizing Mobile Apps

Next StepsImages resources

Launch Images (if relevant)

Addresses, names

Right-to-left support

Location based pre-selection of units (miles, km etc.)

Pre-selection for pickers, options etc.

Color scheme

Page 113: Localizing Mobile Apps

SummaryInitialer effort can be significant

Full translation

Code refactoring

Create workflows and pick tools

Ongoing maintenance rather easy

Consider relevance of individual measures for your audience

Page 114: Localizing Mobile Apps

Merci!

Hvala!Vielen Dank!

Thank You!

Grazie!

Page 115: Localizing Mobile Apps

Questions?

Daniel Schneller — @dschneller [email protected]