diff options
author | Frederic Guillot <fred@kanboard.net> | 2015-08-29 20:00:53 -0400 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2015-08-29 20:00:53 -0400 |
commit | 6c711f696f73bc59813f6834ec241aef3b626cbd (patch) | |
tree | ded4f0e8c7f8c672414ff3f2f84eac0f6d9073e5 /docs/translations.markdown | |
parent | ef087f5e22df1a0d97babef26aaf9b8960ee6d5d (diff) |
Include documentation in the application
Diffstat (limited to 'docs/translations.markdown')
-rw-r--r-- | docs/translations.markdown | 79 |
1 files changed, 0 insertions, 79 deletions
diff --git a/docs/translations.markdown b/docs/translations.markdown deleted file mode 100644 index 7a4e325b..00000000 --- a/docs/translations.markdown +++ /dev/null @@ -1,79 +0,0 @@ -Translations -============ - -How to translate Kanboard to a new language? --------------------------------------------- - -- Translations are stored inside the directory `app/Locale` -- There is sub-directory for each language, by example for the French we have `fr_FR`, Italian `it_IT` etc... -- 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 for the corresponding language -- **French translations are always up to date** -- Always use the last version (branch master) - -### Create a new translation: - -1. Make a new directory: `app/Locale/xx_XX` by example `app/Locale/fr_CA` for French Canadian -2. Create a new file for the translation: `app/Locale/xx_XX/translations.php` -3. Use the content of the French locales and replace the values -4. Inside the file `app/Model/Config.php`, add a new entry for your translation inside the function `getLanguages()` -5. Check with your local installation of Kanboard if everything is ok -6. Send a [pull-request with Github](https://help.github.com/articles/using-pull-requests/) - -How to update an existing translation? --------------------------------------- - -1. Open the translation file `app/Locale/xx_XX/translations.php` -2. Missing translations are commented with `//` and the values are empty, just fill blank and remove the comment -3. Check with your local installation of Kanboard and send a [pull-request](https://help.github.com/articles/using-pull-requests/) - -How to add new translated text in the application? --------------------------------------------------- - -Translations are displayed with the following functions in the source code: - -- `t()`: dispaly text with HTML escaping -- `e()`: display text without HTML escaping -- `dt()`: display date and time using the `strftime()` function formats - -Always use the english version in the source code. - -### Date and time translation - -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](http://php.net/strftime). - -### Placeholders - -Text strings use the function `sprintf()` to replace elements: - -- `%s` is used to replace a string -- `%d` is used to replace an integer - -All formats are available in the [PHP documentation](http://php.net/sprintf). - -How to find missing translations in the applications? ------------------------------------------------------ - -From a terminal, run the following command: - -```bash -./kanboard 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: - -```bash -./kanboard locale:sync -``` - -The French translation is used a reference for other locales. |