Localization Realization

  • 195 views
Uploaded on

Most of us know the drill - write the app, crank out the code and localize later. Thinking about localizing your iOS app up front will save you tons of time later. I'll also talk about a great …

Most of us know the drill - write the app, crank out the code and localize later. Thinking about localizing your iOS app up front will save you tons of time later. I'll also talk about a great project that can help you put translation into the hands of your users.

More in: Technology , Business
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
195
On Slideshare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
0
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Localization Realization Aaron Douglas @astralbodies
  • 2. Who am I? • Aaron Douglas • Red Arrow Labs in Milwaukee • Mobile (iOS & Android) & Enterprise Java Developer
  • 3. Internationalization vs Localization • i18n vs L10n • i18n = adapting to work everywhere • L10n = additional features for a specific locale
  • 4. What Is the Point? • Language • Culture • Conventions • Legal
  • 5. Sounds hard. • It can be difficult • It’s not as easy as translate.google.com • It can pay off big
  • 6. Why Localize? • Opens up markets for your product(s) • Apple gives “free” insertion into localized App Stores • Greater income • Your power users = your translators
  • 7. When do I start? • From day one • Existing application
  • 8. What do I localize? • Strings • Numbers • Dates • Images • Layouts
  • 9. NSLocale
  • 10. NSLocale • Encapsulates a lot of information • Language • Cultural conventions • Dates • Numbers
  • 11. Different Locales • System Locale • Current Locale • NSCurrentLocaleDidChangeNotification
  • 12. Strings
  • 13. Strings • NSLocalizedString • XIB/NIB/Storyboards • Localizable.strings • lproj folders • UTF-16 files
  • 14. Keys, Values and Comments cell.textLabel.text = NSLocalizedString(@"All-day", @"All-day switch label"); /* All-day switch label */ "All-day" = "All-day";
  • 15. genstrings & ibtool find . -name *.m | xargs genstrings -o en.lproj/ ibtool --generate-strings-file MainMenu.strings MainMenu.xib ibtool --strings-file MainMenu.strings -write ../French.lproj/MainMenu.xib MainMenu.xib
  • 16. Looks can be deceiving • Keys are unique to each strings file • Don’t overload! • UTF-16 plays hell with email • Use the comments properly • Positional parameters
  • 17. Comparing & Sorting • A a B b C c D d = English • a, A, b, B, c, C, ä, Ä = Swedish • Called collation • -compare: is wrong • Use -localizedStandardCompare:
  • 18. Validation • Your validation logic may be localedependent • Postal codes • Regular Expressions
  • 19. Debugging NSDictionary *defaults = @{ @"NSShowNonLocalizableStrings": @(YES), @"NSShowNonLocalizedStrings": @(YES)}; ! [[NSUserDefaults standardUserDefaults] registerDefaults:defaults]; ! [[NSUserDefaults standardUserDefaults] synchronize];
  • 20. Numbers
  • 21. NSNumberFormatter • +localizedStringFromNumber:number Style: • Styles: General, Currency, Percentage, Scientific, Spell-Out
  • 22. Examples • @45678.90 • General: 45,678.90 • Currency: $45,678.90 • Percentage: 4,567,890% • Scientific: 4.56789E+04 • Spell-Out: Forty five thousand six ...
  • 23. Locale Specific Formats • 45 678,90 • ¥456.78
  • 24. Number Tips • Avoid intValue • Use NSNumberFormatter • Unit conversion is important
  • 25. Dates
  • 26. Dates • One of the most messed up concepts • NSDate is a wrapped NSTimeInterval • Simply a point in time
  • 27. Why Are Dates Hard? • Time Zones • Leap Years • Leap Seconds • Date Math • Calendar Conversion
  • 28. Calendars • Gregorian • Islamic • Hindu • Hebrew • and on and on
  • 29. Don’t Assume • Date formats / Input masks • Length of days/weeks/months • Gregorian • Location hasn’t changed since launch (timezones!)
  • 30. Do Assume • API calls with date formats • Internally stored dates • NSDate has no timezone
  • 31. Images
  • 32. Images • Use Core Graphics to draw text • No text on launch images • Keep cultural references in mind
  • 33. Cultural Images
  • 34. Layouts
  • 35. Layouts • Words can be different lengths in another language • Mac OS X has autolayouts • iOS may “some day” have autolayout • [UIBarButtonItem possibleTitles]
  • 36. ibtool • Separate NIBs for each locale • Don’t make layout changes in localespecific NIB! • Programmatically move items • Wait until iOS 6...
  • 37. Translation
  • 38. Process • Collect Strings files/resources • Send to translators • Incorporate new strings • Test, test, test, test!
  • 39. translate.google.com
  • 40. Greenwich
  • 41. Greenwich • Mac & iOS Apps! • iOS requires a Mac & Bonjour • http://github.com/fadingred/ Greenwich
  • 42. Services • gengo - http://gengo.com • Applingua - http://applingua.com • Amazon Mechanical Turk
  • 43. Resources
  • 44. Apple Developer Library • Internationalization Programming Topics • International Mountains (Sample Code)
  • 45. WWDC Videos • 2011 - 131 - Getting Your Apps Ready
 for China and Other Hot Markets • 2012 - 244 - Internationalization Tips and Tricks
  • 46. Demo
  • 47. Questions?