You can translate the website online on the elementary Weblate instance: https://l10n.elementaryos.org/projects/website/. Please don't update directly files in _lang/ on Github as they'll be overridden when pulling new translations.
You can propose new languages if they're not listed. Make sure to avoid requesting languages that already exist, for instance adding Russian (Russia) when Russian is available.
It's not a good practice to review strings translated by ourselves. Instead, find someone else speaking your language and ask them to join the reviewers team (you can send a message to the i18n team to ask this).
Languages are updated automatically when code is changed. This may take time to update, so please be patient.
Translations strings are extracted from HTML files. A little command line PHP file is included to make this easier. Just run php _backend/Console/Translation.php to update the translation files. You can use --help for more options.
The translation tool supports the following command line options:
-
--language,-l- Extract translations for a specific language only- Example:
php _backend/Console/Translation.php --language fr
- Example:
-
--page,-p- Extract translations for a specific page only- Example:
php _backend/Console/Translation.php --page code-of-conduct
- Example:
-
--verbose,-v- Show more detailed output during the extraction process- Example:
php _backend/Console/Translation.php --verbose
- Example:
-
--help- Display help information about the command
You can combine multiple options:
php _backend/Console/Translation.php --language ar --page code-of-conduct --verboseIf you want to change a translation key for an element, just add a data-l10n-id attribute:
<p data-l10n-id="mylongparagraph">Blablabla</p>To ignore a translation string, set it to false in /_lang/en/<page>.json:
{
"elementary OS": false // Can't be translated
}Alternatively, you can add the data-l10n-off attribute to a tag:
<p data-l10n-off="1">I'm ignored.</p>The list of available languages is hard-coded in _backend/Lib/L10n.php. If a new language is complete, you can add it by appending it to the list. Languages are sorted by index (see ISO 639-1) and are localized.