Translations¶
How to translate Kanboard to a new language?¶
Translations are stored inside the directory
app/LocaleThere is a subdirectory for each language, for example in French we have
fr_FR, Italianit_ITetc.A translation is a PHP file that returns an Array with a key-value pairs
The key is the original text in English and the value is the translation of the corresponding language
French translations are always up to date
Always use the last version (master branch)
Create a new translation:
Make a new directory:
app/Locale/xx_XXfor exampleapp/Locale/fr_CAfor French CanadianCreate a new file for the translation:
app/Locale/xx_XX/translations.phpUse the content of the French locales and replace the values
Update the file
app/Model/Language.phpCheck with your local installation of Kanboard if everything is OK
Send a pull-request with Github
How to update an existing translation?¶
Open the translation file
app/Locale/xx_XX/translations.phpMissing translations are commented with
//and the values are empty, just fill blank and remove the commentCheck with your local installation of Kanboard and send a pull-request
How to add new translated text in the application?¶
Translations are displayed with the following functions in the source code:
t(): display text with HTML escapinge(): display text without HTML escaping
Always use the english version in the source code.
Text strings use the function sprintf() to replace elements:
%sis used to replace a string%dis used to replace an integer
All formats are available in the PHP documentation.
How to find missing translations in the applications?¶
From a terminal, run the following command:
./cli locale:compare
All missing and unused translations are displayed on the screen. Put that in the French locale and sync other locales (see below).
How to synchronize translation files?¶
From a Unix shell run this command:
./cli locale:sync
The French translation is used a reference to other locales.