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, usei18n-label
tag for text that needs to be translated.Run
make update
inside this directory.Edit
${LOCALE}.po
. For each new / changed text, translate them accordingly inside the.po
file.Commit the code changes together with
.po
file changes.
Modifying code in board overlay¶
Write codes, and mark text that need to be translated by
_("Translatable text")
. For static HTML, usei18n-label
tag for text that needs to be translated.Run
make update BOARD=board
inside this directory.Edit
po/${LOCALE}.po
in board overlay. For each new / changed text, translate them accordingly inside the.po
file.Commit the code changes together with
.po
file changes.
Adding translations for a new locale in public repository¶
Run
make init LOCALE=xx-YY
inside this directory, wherexx-YY
is the new locale to be translated to. (e.g.zh-CN
).A new
xx-YY.po
would be generated. Edit the file and add translations.Commit the new
.po
file.
Adding translations for a locale that exists in public repository into board overlay¶
Run
make update BOARD=board
inside this directory.Edit
po/${LOCALE}.po
in board overlay and add translations. The.po
file would only contain text extracted from files in board overlay.Commit the new
.po
file.
Adding translations for a new locale that would only exist in board overlay¶
Run
make init BOARD=board LOCALE=xx-YY
inside this directory , wherexx-YY
is the new locale to be translated to. (e.g.zh-CN
).A new
po/xx-YY.po
would 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
.po
file.