ez.no / exponential / documentation / reference / template operators / formatting / i18n
$input_string|i18n( [ context [, comment [, arguments ] ] ] )
| Name | Type | Description | Required |
|---|---|---|---|
| context | string | Context describing where the string belongs | no |
| comment | string | Comment describing text futher | no |
| arguments | hash | Hash containing arguments in input_string | no |
input_string translated to current language if translation exists, else input_string if none exists.
eZ i18n handles text conversion between various charsets, its primary use is for converting to and from UTF8. Text manipulation regardless of the charset used is possible by using the eZTextCodec class. It's also possible to query for information on various charsets.
eZ i18n supports the mbstring extension which can be compiled in PHP, when used the conversion will be much faster. mbstring is only used for those charsets it supports.
Text translation is also possible by using the eZTranslatorManager and XML translation files¹.
¹ Use Qt's linguist to translate files
{" This is a test"|i18n}
returns "This is a test" translated to current language.
{let number=5} {"Please enter %number characters"|i18n( '', '', hash( '%number', $number ) )} {/let}
returns "Please enter 5 characters". When translated, %number is replaced by the variable dynamicly.
log in or create a user account to comment.
Comments