mirror of
https://github.com/balena-io/etcher.git
synced 2025-04-23 06:47:17 +00:00

- 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
1.2 KiB
1.2 KiB
i18n
How it was done
Using the open-source lib i18next.
How to add your own language
- Go to
lib/gui/app/i18n
and add a file namedxx.ts
(use the codes mentioned in the link, and we support styles asfr
,de
,es-ES
andpt-BR
) . - Copy the content from an existing translation and start to translate.
- Once done, go to
lib/gui/app/i18n.ts
and add a line ofimport xx_translation from './i18n/xx'
after the already-added imports and addxx: xx_translation
in theresources
section ofi18next.init()
function. - Now go to
lib/shared/catalina-sudo/
and copy thesudo-askpass.osascript-en.js
, change it to besudo-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 thoseOk
s andCancel
s to your own language. - If, your language has several variations when they are used in several countries/regions, such as
zh-CN
andzh-TW
, orpt-BR
andpt-PT
, edit thelangParser()
in thelib/gui/app/i18n.ts
file to meet your need. - Make a commit, and then a pull request on GitHub.