The Glass
project supports internationalization. This document
describes how to extract and process the translations.
If you want to become a translator, please create a new account at Transifex and join the Aquarium project.
To be able to pull the translations from Transifex, Python 3
must be
installed on your system.
To extract the i18n messages from the HTML templates and the TypeScript
files just run the following command in src/glass
:
$ npm run i18n:extract
The file src/glass/src/assets/i18n/aquarium.pot
will be created. This file
must be uploaded manually to Transifex in order to update the source file of
the resource.
To get the latest translations for every supported language from Transifex run the following command:
$ npm run i18n:pull
The *.po
files for every language (e.g. de_DE.po) will be downloaded into
the directory src/glass/src/assets/i18n
.
Finally, the *.po
files need to be converted into JSON to be used in
the UI.
$ npm run i18n:convert
If the language you support is new to Glass
, then you also need to add the
command into the following: package.json
"i18n:convert:de_DE": "po2json --format mf --pretty src/assets/i18n/de_DE.po src/assets/i18n/de_DE.json"
Update the file src/app/i18n.helper.ts
supportedLanguages
record and append the language you just translated.