Internationalization (i18n) class.

package Core
subpackage i18n

 Methods

Returns translation of a specific text, wrapper for translate().

__(string $string, string $domain) : string
Static

Parameters

$string

string

The string to translate

$domain

string

The domain to look up

Returns

stringReturns the translation

Emulates GNU gettext

emulateGettext(string $string, string $domain) : string
Static

Parameters

$string

string

The string to translate

$domain

string

The domain to look up

Returns

stringReturns the translation

Returns list of cached tranlations

getCache() : array
Static

Returns

array

Returns list of registered domains

getDomains() : array
Static

Returns

array

Returns list of cached tranlation files

getFiles() : array
Static

Returns

array

Returns the current language (if already defined)

getLanguage() : string | false
Static

Returns

stringfalse

Initializes the i18n.

init(string $localePath, string $langCode) 
Static

Parameters

$localePath

string

Path to the locales

$langCode

string

Language code to set

Registers a new i18n domain.

registerDomain(string $domain, string $localePath) : string
Static

Parameters

$domain

string

Domain to bind to

$localePath

string

Path to the locales

Returns

stringReturns the translation

Resets cached translation data (language, domains, files, and cache)

reset() 
Static

Returns translation of a specific text

translate(string $string, string $domain) : string
Static

Parameters

$string

string

The string to translate

$domain

string

The domain to look up

Exceptions

\cException if this is the backend mode and the $belang is not set

Returns

stringReturns the translation

Loads gettext translation and file does some operations like stripping comments on the content.

_loadTranslationFile(string $translationFile) : string
Static

Parameters

$translationFile

string

Returns

stringThe preparend translation file content

 Properties

 

$_i18nData : array