WhoBuilt

Localizing React Native apps from start to end

Sep 27, 2022· 30 min· 2.1K views·Watch on YouTube

Speaker

Vojtech Novak, a React Native library maintainer, compares localization tools and practices at React Native EU 2022, presented by Callstack.

Choosing a localization library

Novak compares FBT with i18next, using examples for static text, plurals, variables, and styled text. FBT generates translation IDs, keeps strings searchable in source code, and has a smaller bundle size, but its community and file format support are limited. i18next has a larger community and many plugins, though its handwritten keys can hide the original text and its bundle is larger.

Building a translator-friendly workflow

Novak recommends translation platforms such as Crowdin, Phrase, and Lokalise over email or spreadsheets. He explains how translators use translation memory to reuse prior work, machine translation to draft strings, term bases to protect names such as Apple, and quality checks to catch typos and missing parameters. Screenshots and design context help translators understand where strings appear.

Preventing common translation errors

Concatenating fragments such as an error label and a missing field can produce sentences that do not work in other languages. Novak argues that repeating complete messages can be worthwhile for translation quality. To catch missing strings, he points to TypeScript checks, fallbacks, and component tests.

Localizing the native app experience

Novak recommends keeping native and JavaScript translations aligned so user interface text and system menus do not appear in different languages. On iOS, developers can add locales and translations in project settings and change an app's language in device settings. Android 13 introduced per-app language preferences, and React Native 0.70 made Intl APIs available in Hermes on iOS and Android, with some features potentially needing polyfills.

Takeaways

  • Choose a localization library based on your tooling, team, and translation workflow.
  • Give translators whole sentences and enough context to translate them accurately.
  • Use translation platforms to reuse prior work and check terms, typos, and placeholders.
  • Catch missing translations with type checks, fallbacks, and component tests.
  • Keep native UI translations aligned with app content, and verify fonts for the target languages.

Mentioned in this talk

Search inside this talk

What was claimed 8

  • feature
    FBT: Extracts source strings and generates translation IDs; supports pluralization, parameters, and translator descriptions.
    “The description gives the translator more context about the string”
    YouTube
    Unverified1 source· Talk
  • feature
    React Intl: Uses handwritten translation IDs, supports plugins, and can use different tooling and output formats.
    “i18next puts more emphasis on using handwritten translation IDs”
    YouTube
    Unverified1 source· Talk
  • feature
    FBT: Has a smaller bundle size than i18next.
    “FBT also has a smaller bundle size.”
    YouTube
    Unverified1 source· Talk
  • feature
    Crowdin: Supports the FBT file format.
    Supports the FBT file format.
    “probably only Crowdin supports the FBT file format”
    YouTube
    Unverified1 source· Talk
  • feature
    FBT: Requires Babel for string extraction and uses a Facebook-developed proprietary file format.
    “it requires Babel to extract the sentences”
    YouTube
    Unverified1 source· Talk
  • feature
    Phrase: Provides an iframe-based in-context translation tool for websites.
    “the translator can run the website, select strings, and translate them in place”
    YouTube
    Unverified1 source· Talk
  • feature
    Android: Android 13 introduced per-app language preferences.
    “as of Android 13, there's a new feature called per-app language preferences”
    YouTube
    Unverified1 source· Talk
  • feature
    Intl API: Available in Hermes on Android and iOS as of React Native 0.70; some features may need polyfills.
    Available in Hermes on Android and iOS as of React Native 0.70; some features may need polyfills.
    “as of React Native 0.70, Intl APIs are available in Hermes”
    YouTube
    Unverified1 source· Talk

Related talks