Class cI18n
Internationalization (i18n) class.
Methods summary
public static
|
#
init( string $localePath, string $langCode, string $domain = 'contenido' )
Initializes the i18n.
Parameters
- $localePath
string $localePath Path to the locales
- $langCode
string $langCode Language code to set
- $domain
string $domain Language domain
|
public static
string
|
#
__( string $string, string $domain = 'contenido' )
Returns translation of a specific text, wrapper for translate().
Returns translation of a specific text, wrapper for translate().
Parameters
- $string
string $string The string to translate
- $domain
string $domain The domain to look up
Returns
string Returns the translation
|
public static
string
|
#
translate( string $string, string $domain = 'contenido' )
Returns translation of a specific text
Returns translation of a specific text
Parameters
- $string
string $string The string to translate
- $domain
string $domain The domain to look up
Returns
string Returns the translation
Throws
cException
if this is the backend mode and the $belang is not set
|
public static
string|false
|
#
getLanguage( )
Returns the current language (if already defined)
Returns the current language (if already defined)
Returns
string|false
|
public static
array
|
#
getDomains( )
Returns list of registered domains
Returns list of registered domains
Returns
array
|
public static
array
|
#
getFiles( )
Returns list of cached tranlation files
Returns list of cached tranlation files
Returns
array
|
public static
array
|
#
getCache( )
Returns list of cached tranlations
Returns list of cached tranlations
Returns
array
|
public static
|
#
reset( )
Resets cached translation data (language, domains, files, and cache)
Resets cached translation data (language, domains, files, and cache)
|
public static
string
|
#
emulateGettext( string $string, string $domain = 'contenido' )
Emulates GNU gettext
Parameters
- $string
string $string The string to translate
- $domain
string $domain The domain to look up
Returns
string Returns the translation
|
public static
|
#
registerDomain( string $domain, string $localePath )
Registers a new i18n domain.
Registers a new i18n domain.
Parameters
- $domain
string $localePath Path to the locales
- $localePath
string $domain Domain to bind to
|
protected static
string
|
#
_loadTranslationFile( string $translationFile )
Loads gettext translation and file does some operations like stripping
comments on the content.
Loads gettext translation and file does some operations like stripping
comments on the content.
Parameters
- $translationFile
string $translationFile
Returns
string The preparend translation file content
|
Properties summary
protected static
array
|
$_i18nData
|
array(
'language' => NULL,
'domains' => array(),
'files' => array(),
'cache' => array()
) |
#
i18n related assoziative data cache.
i18n related assoziative data cache.
|