Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Internationalizing Your App

Internationalizing Your App

This talk explores how to make your iOS app global ready and does a brief overview of what internationalization is, some technical tools and tricks you can use to build your app for different languages and cultures, and considers the business side of things if you ever have to sunset your product.

Debuted at UIKonf in Berlin, Germany in May 2019.

Kristina Fox

May 27, 2019
Tweet

More Decks by Kristina Fox

Other Decks in Technology

Transcript

  1. I N T E R N A T I O

    N A L I Z I N G Y O U R A P P KRISTINA FOX | SENIOR IOS ENGINEER | INTUIT @KRSTNFX KRISTINA.IO
  2. D E F I N I N G I N

    T E R N A T I O N A L I Z A T I O N
  3. @KRSTNFX KRISTINA.IO A means of adapting computer software to in·ter·na·tion·al·i·za·tion

    and , different languages regional peculiarities technical requirements of a target locale
  4. @KRSTNFX KRISTINA.IO A means of adapting computer software to in·ter·na·tion·al·i·za·tion

    and , different languages regional peculiarities technical requirements of a target locale
  5. @KRSTNFX KRISTINA.IO A means of adapting computer software to in·ter·na·tion·al·i·za·tion

    and , different languages regional peculiarities technical requirements of a target locale
  6. @KRSTNFX KRISTINA.IO technical requirements String formatters UI constraints Currency formatters

    Timezones Animations Right-to-left languages Testing Accessibility
  7. @KRSTNFX KRISTINA.IO tester questionnaire - Current vs. new user -

    Demographic (age, gender, etc.) - Lifestyle - Experience in your field
  8. @KRSTNFX KRISTINA.IO let str = String.localizedStringWithFormat( NSLocalizedString("%d songs played", comment:

    “[count] songs played“), numSongsPlayed) localize your plural strings
  9. @KRSTNFX KRISTINA.IO localize your plural strings <key>NSStringLocalizedFormatKey</key> ... <dict> <key>NSStringFormatSpecTypeKey</key>

    <string>NSStringPluralRuleType</string> <key>NSStringFormatValueTypeKey</key> <string>d</string> <key>one</key> <string>%d song played</string> <key>other</key> <string>%d songs played</string> </dict>
  10. @KRSTNFX KRISTINA.IO string and number formatters - Currency - Numbers

    (decimal point and comma markers) - Dates (short, medium and long length) - Quotes - Uppercase, lowercase and capitalization
  11. A R C H I T E C T I

    N G Y O U R C O D E
  12. @KRSTNFX KRISTINA.IO simple conditionals let localeId = Locale.current.identifier
 if localeId

    == "en_US" { print("Hello America") } else if localeId == "de_DE" { print("Hallo Deutschland") }
  13. @KRSTNFX KRISTINA.IO simple conditionals Feature 1 Feature 2 Feature 3

    Feature 4 let localeId = Locale.current.identifier
 if localeId == "en_US" { print("Hello America") } else if localeId == "de_DE" { print("Hallo Deutschland") } let localeId = Locale.current.identifier
 if localeId == "en_US" { print("Hello America") } else if localeId == "de_DE" { print("Hallo Deutschland") } let localeId = Locale.current.identifier
 if localeId == "en_US" { print("Hello America") } else if localeId == "de_DE" { print("Hallo Deutschland") } let localeId = Locale.current.identifier
 if localeId == "en_US" { print("Hello America") } else if localeId == "de_DE" { print("Hallo Deutschland") }
  14. @KRSTNFX KRISTINA.IO global manager func getPostalCodeTitle(locale: Locales) -> String {

    switch locale { case .US: return NSLocalizedString("Zip code", comment: "postal code") case .UK , .AU: return NSLocalizedString("Postcode", comment: "postal code") case .CA: return NSLocalizedString("Postal code", comment: "postal code") } }
  15. @KRSTNFX KRISTINA.IO UIView.transition ( with: titleLabel, duration: 0.5, options: .transitionFlipFromTop,

    animations: { self.titleLabel.text = self.titleStringArray[self.titleCounter] }, completion: nil )
  16. @KRSTNFX KRISTINA.IO // App code let button = UIButton() button.setTitle(NSLocalizedString("Save",

    comment: "Save"), for: .normal) button.accessibilityIdentifier = "saveButton" // UI test code let app = XCUIApplication() let button = app.buttons["saveButton"] XCTAssertTrue(button.exists) localized UI tests
  17. W E I G H T I N G T

    H E C O S T S A N D B E N E F I T S
  18. @KRSTNFX KRISTINA.IO North America First market Europe Low numbers, high

    growth Asia Low numbers, low potential app growth
  19. @KRSTNFX KRISTINA.IO things to consider - Product performance - Time

    and effort spent developing and testing in low performing locales
  20. @KRSTNFX KRISTINA.IO things to do - Message your users way

    ahead of time - Pull the app out of the App Store first - Give users a way to backup their data - Shut down backend support
  21. 1 2 3 4 User research Localization Architecting your code

    Handling UI Testing Weighing cost and benefits 5 6 internationalization