- Translations are stored inside the directory
app/Locale - There is sub-directory for each language, by example for the French we have
fr_FR, Italianit_ITetc... - A translation is a PHP file that return an Array with a key-value pairs
- The key is the original text in english and the value is the translation for the corresponding language
- French translations are always up to date
- Always use the last version (branch master)
- Make a new directory:
app/Locale/xx_XXby exampleapp/Locale/fr_CAfor French Canadian - Create a new file for the translation:
app/Locale/xx_XX/translations.php - Use the content of the French locales and replace the values
- Inside the file
app/Model/Config.php, add a new entry for your translation inside the functiongetLanguages() - Check with your local installation of Kanboard if everything is ok
- Send a pull-request with Github
- Open the translation file
app/Locale/xx_XX/translations.php - Missing translations are commented with
//and the values are empty, just fill blank and remove the comment - Check with your local installation of Kanboard and send a pull-request
Translations are displayed with the following functions in the source code:
t(): dispaly text with HTML escapinge(): display text without HTML escapingdt(): display date and time using thestrftime()function formats
Always use the english version in the source code.
Date strings use the function strftime() to format the date.
By example, the original English version can be defined like that Created on %B %e, %Y at %k:%M %p and that will output something like that Created on January 11, 2015 at 15:19 PM. The French version can be modified to display a different format, Créé le %d/%m/%Y à %H:%M and the result will be Créé le 11/01/2015 à 15:19.
All formats are available in the PHP documentation.
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.
From a Unix shell run:
./scripts/find-strings.shAll missing translations are displayed on the screen. Put that in the french locale and sync other locales (see below).
From a Unix shell run this command:
./scripts/sync-locales.phpThe french translation is used a reference for other locales.