Localizing your app. Traps and pitfalls
Localizing your app. Traps and pitfallsRoman Imankulov
View Slide
About me• taking care of localizing todoist.com since 2012
that’s how it looks like (18 languages in total)
How to choose the language?
Ask user!
Get it from HTTP request
Get it from the URL
Confused search engines
Use hreflang
How translations are stored?
How to use them in the code?
Not touching the questions• How to seed translation files• How to extract strings from the code• How to work with translators• How to compile files• How to merge translations• etc…
String interpolations
Which one is correct?
String interpolation strikes back
Try pofilter from translate-toolkit
Plural forms
Naive approach
Plurals are complicated in Russian
Arabic plurals Source: http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html
ngettext to the rescue
More issues
Order of words in a sentence _(“%s assigned %s tasks to %s”)_(“{user1} assigned {n} tasks to {user2}”)
Gender variations _(“%s completed a task”)
String concatenations _(“Welcome to”) + website_name
Missing context _(“May”)pgettext(“month name”, “May”)pgettext(“availability”, “May”)
And many many more
What can we realistically do?• Brace yourself and get ready for failures• Use linters, automated tests, etc• Explain to developers how different languages work• Explain to translators how localization in the app works• Make sure there’s a communication channel between developers andtranslators• Make sure there’s a feedback channel from users to translators anddevelopers