source code: po/README.md
Localization for ChromeOS Factory Software¶
This folder contains translated resources for labels and messages used in ChromeOS factory software, in GNU gettext format.
Usage¶
There are several different scenarios that would involve text translations. This shows the workflow for each scenario.
Modifying code in public repository¶
- Write codes, and mark text that need to be translated by - _("Translatable text"). For static HTML, use- i18n-labeltag for text that needs to be translated.
- Run - make updateinside this directory.
- Edit - ${LOCALE}.po. For each new / changed text, translate them accordingly inside the- .pofile.
- Commit the code changes together with - .pofile changes.
Modifying code in board overlay¶
- Write codes, and mark text that need to be translated by - _("Translatable text"). For static HTML, use- i18n-labeltag for text that needs to be translated.
- Run - make update BOARD=boardinside this directory.
- Edit - po/${LOCALE}.poin board overlay. For each new / changed text, translate them accordingly inside the- .pofile.
- Commit the code changes together with - .pofile changes.
Adding translations for a new locale in public repository¶
- Run - make init LOCALE=xx-YYinside this directory, where- xx-YYis the new locale to be translated to. (e.g.- zh-CN).
- A new - xx-YY.powould be generated. Edit the file and add translations.
- Commit the new - .pofile.
Adding translations for a locale that exists in public repository into board overlay¶
- Run - make update BOARD=boardinside this directory.
- Edit - po/${LOCALE}.poin board overlay and add translations. The- .pofile would only contain text extracted from files in board overlay.
- Commit the new - .pofile.
Adding translations for a new locale that would only exist in board overlay¶
- Run - make init BOARD=board LOCALE=xx-YYinside this directory , where- xx-YYis the new locale to be translated to. (e.g.- zh-CN).
- A new - po/xx-YY.powould be generated in board overlay, which would contains all text extracted from both public repository and board overlay. Edit the file and add translations.
- Commit the new - .pofile.