Skip to content
This repository has been archived by the owner on Feb 25, 2023. It is now read-only.

Latest commit

 

History

History
55 lines (41 loc) · 1.82 KB

i18n.md

File metadata and controls

55 lines (41 loc) · 1.82 KB

I18N Translator Guide

The Glass project supports internationalization. This document describes how to extract and process the translations.

How to become a translator

If you want to become a translator, please create a new account at Transifex and join the Aquarium project.

Process translations in Glass

Prerequisites

To be able to pull the translations from Transifex, Python 3 must be installed on your system.

Extract translations

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.

Pull translations

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.

Convert the translations

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"

Adding new translation into Glass languages support

Update the file src/app/i18n.helper.ts supportedLanguages record and append the language you just translated.