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 [optional] 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 [optional] The domain to look up
Returns
string Returns the translation
Throws
|
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 [optional] 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 [optional] The domain to look up
Returns
string Returns the translation
Throws
|
public static
|
#
registerDomain( string $domain, string $localePath )
Registers a new i18n domain.
Registers a new i18n domain.
Parameters
- $domain
string $domain Domain to bind to
- $localePath
string $localePath Path to the locales
|
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
Throws
|