class Loader

Methods

static Loader
getInstance()

Returns the singleton Loader object.

static 
loadFunctions()

Loads global localizaton functions.

static array
listLocales(string $locale)

Figure out all possible locale names and start with the most specific ones. I.e. for sr_CS.UTF-8@latin, look through all of sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr.

getTranslator(string $domain = '')

Returns Translator object for domain or for default domain.

bindtextdomain(string $domain, string $path)

Sets the path for a domain.

textdomain(string $domain)

Sets the default domain.

string
setlocale(string $locale)

Sets a requested locale.

string
detectlocale()

Detects currently configured locale.

Details

at line 70
static Loader getInstance()

Returns the singleton Loader object.

Return Value

Loader object

at line 82
static loadFunctions()

Loads global localizaton functions.

at line 96
static array listLocales(string $locale)

Figure out all possible locale names and start with the most specific ones. I.e. for sr_CS.UTF-8@latin, look through all of sr_CS.UTF-8@latin, sr_CS@latin, sr@latin, sr_CS.UTF-8, sr_CS, sr.

Parameters

string $locale Locale code

Return Value

array list of locales to try for any POSIX-style locale specification

at line 151
Translator getTranslator(string $domain = '')

Returns Translator object for domain or for default domain.

Parameters

string $domain Translation domain

Return Value

Translator

at line 192
bindtextdomain(string $domain, string $path)

Sets the path for a domain.

Parameters

string $domain Domain name
string $path Path where to find locales

at line 202
textdomain(string $domain)

Sets the default domain.

Parameters

string $domain Domain name

at line 214
string setlocale(string $locale)

Sets a requested locale.

Parameters

string $locale Locale name

Return Value

string Set or current locale

at line 233
string detectlocale()

Detects currently configured locale.

It checks:

  • global lang variable
  • environment for LC_ALL, LC_MESSAGES and LANG

Return Value

string with locale name