etcher/lib/gui/app/i18n/README.md
r-q 17f2008d88 refactor: split translations to files
- split translations from i18n.ts to several .ts files in lib/gui/app/i18n
- make a README for new language changes
- add zh-TW instead of only zh-CN
2022-12-12 18:36:32 -08:00

1.2 KiB

i18n

How it was done

Using the open-source lib i18next.

How to add your own language

  1. Go to lib/gui/app/i18n and add a file named xx.ts (use the codes mentioned in the link, and we support styles as fr, de, es-ES and pt-BR) .
  2. Copy the content from an existing translation and start to translate.
  3. Once done, go to lib/gui/app/i18n.ts and add a line of import xx_translation from './i18n/xx' after the already-added imports and add xx: xx_translation in the resources section of i18next.init() function.
  4. Now go to lib/shared/catalina-sudo/ and copy the sudo-askpass.osascript-en.js, change it to be sudo-askpass.osascript-xx.js and edit the 'balenaEtcher needs privileged access in order to flash disks.\n\nType your password to allow this.' line and those Oks and Cancels to your own language.
  5. If, your language has several variations when they are used in several countries/regions, such as zh-CN and zh-TW , or pt-BR and pt-PT, edit the langParser() in the lib/gui/app/i18n.ts file to meet your need.
  6. Make a commit, and then a pull request on GitHub.