diff options
-rw-r--r-- | docs/translations.markdown | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/docs/translations.markdown b/docs/translations.markdown index c01fa2fa..0e01fa9b 100644 --- a/docs/translations.markdown +++ b/docs/translations.markdown @@ -32,12 +32,29 @@ How to add new translated text in the application? Translations are displayed with the following functions in the source code: -- `t()`: escaped HTML text -- `e()`: displayed with no escaping -- `dt()`: date using `strftime()` formats +- `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? ----------------------------------------------------- |