balena-io--etcher
i18n
How it was done
Using the open-source lib i18next.
How to add your own language
- Go to
lib/gui/app/i18nand add a file namedxx.ts(use the codes mentioned in the link, and we support styles asfr,de,es-ESandpt-BR) . - Copy the content from an existing translation and start to translate.
- Once done, go to
lib/gui/app/i18n.tsand add a line ofimport xx_translation from './i18n/xx'after the already-added imports and addxx: xx_translationin theresourcessection ofi18next.init()function. - Now go to
lib/shared/catalina-sudo/and copy thesudo-askpass.osascript-en.js, change it to besudo-askpass.osascript-xx.jsand edit the'balenaEtcher needs privileged access in order to flash disks.\n\nType your password to allow this.'line and thoseOks andCancels to your own language. - If, your language has several variations when they are used in several countries/regions, such as
zh-CNandzh-TW, orpt-BRandpt-PT, edit thelangParser()in thelib/gui/app/i18n.tsfile to meet your need. - Make a commit, and then a pull request on GitHub.