I18n handles translation of Text and time format strings.
integer
0 integer
1 integer
2 integer
6 integer
3 integer
4 integer
5 $_categories protected array$_domains protected array$_escape protected string$_lang protected string$_noLocale protected booleanSet to true when I18N::_bindTextDomain() is called for the first time. If a translation file is found it is set to false again
$category public stringstring$domain public string$l10n public Used by the translation functions in basics.php Returns a translated string based on current language and translation files stored in locale folder
__construct( )
Constructor, use I18n::getInstance() to get the i18n translation object.
_bindTextDomain( string $domain )
Binds the given domain to a file in the specified directory.
$domain _parseLiteralValue( string $string )
Auxiliary function to parse a symbol from a locale definition file
$string _pluralGuess( string $header , integer $n )
Attempts to find the plural form of a string.
$header $n _translateTime( string $format , string $domain )
Returns a Time format definition from corresponding domain
$format $domain clear( )
Clears the domains internal data array. Useful for testing i18n.
getInstance( )
Return a static instance of the I18n class
I18ninsertArgs( string $translated , array $args )
Puts the parameters in raw translated strings
$translated $args loadLocaleDefinition( string $filename )
Parses a locale definition file following the POSIX standard
$filename loadMo( string $filename )
Loads the binary .mo file and returns array of translations
$filename loadPo( string $filename )
Loads the text .po file and returns array of translations
$filename translate( string $singular , string $plural null , string $domain null , string $category self::LC_MESSAGES , integer $count null , string $language null , string $context null )
Used by the translation functions in basics.php Returns a translated string based on current language and translation files stored in locale folder
$singular $plural optional null $domain optional null Domain The domain of the translation. Domains are often used by plugin translations. If null, the default domain will be used.
$category optional self::LC_MESSAGES $count optional null $language optional null Language to translate string to. If null it checks for language in session followed by Config.language configuration variable.
$context optional null CakeExceptionprotected array
Translation categories
array(
'LC_ALL', 'LC_COLLATE', 'LC_CTYPE', 'LC_MONETARY', 'LC_NUMERIC', 'LC_TIME', 'LC_MESSAGES'
) protected array
Translation strings for a specific domain read from the .mo or .po files
array()
protected boolean
Set to true when I18N::_bindTextDomain() is called for the first time. If a translation file is found it is set to false again
false
© 2005–2016 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/2.9/class-I18n.html