Skip to content
This repository has been archived by the owner on Jan 6, 2020. It is now read-only.

Internationalization #287

Open
iancoleman opened this issue Oct 30, 2016 · 0 comments
Open

Internationalization #287

iancoleman opened this issue Oct 30, 2016 · 0 comments

Comments

@iancoleman
Copy link

Inspired by the forum post Translations for equal opportunities, I started on a pull request for internationalization (i18n). As I got deeper into it, the size of the task seemed to warrant some discussion.

Looking for some feedback about the following:

  • Choose a library
    • Should support interpolation and pluralization features at a minimum
    • Phrase file format - any specific thoughts? I prefer .po but am happy with any format that can be converted to / fro po. Most javascript i18n libraries use json format.
    • Automatic addition of new phrases to the phrase files is a nice-to-have.
    • I've been using i18n and like it. react-intl is also a contender.
    • Electron releases contain a 'locale' directory with .pak files, but I can't figure any way to hook into them. Seems like a native part of chromium.
    • Electron seems unopinionated about i18n, there's no 'standard' way to do it.
  • Locate strings for translation
    • In the app
      • app/ui/components/*.js
      • app/server/message_contants.js
      • app/ui/constant.js
    • In third-party libraries
      • momentjs (eg 'X seconds ago')
      • zxcvbn (strings seems to be in to app/ui/components/register_acc_*_form.js)
    • Logging and technical/code strings can be left untranslated.
  • Automatically detect the default language for the user - see electron app.getLocale()
  • Implement a manual language override in the UI
    • The ui component
    • Re-rendering ui once selected
    • Caching the override so it doesn't have to be selected every time
  • Implement some processes / documentation
    • for translators to contribute new translations
    • for developers adding new strings to the ui

Any comments or suggestions are most welcome. I'll keep working on the pull request but appreciate any additional thoughts.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant