Improve translation documentation
This commit is contained in:
parent
39dab436ea
commit
8b73025f18
|
|
@ -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?
|
||||
-----------------------------------------------------
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue