Loader
class Loader (View source)
Methods
Returns the singleton Loader object.
Loads global localization functions.
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.
Sets factory responsible for composing a CacheInterface
Returns Translator object for domain or for default domain.
Sets the path for a domain.
Sets the default domain.
Sets a requested locale.
Detects currently configured locale.
Details
static Loader
getInstance()
Returns the singleton Loader object.
static void
loadFunctions()
Loads global localization 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.
static void
setCacheFactory(CacheFactoryInterface|null $cacheFactory)
Sets factory responsible for composing a CacheInterface
Translator
getTranslator(string $domain = '')
Returns Translator object for domain or for default domain.
void
bindtextdomain(string $domain, string $path)
Sets the path for a domain.
void
textdomain(string $domain)
Sets the default domain.
string
setlocale(string $locale)
Sets a requested locale.
string
detectlocale()
Detects currently configured locale.
It checks:
- global lang variable
- environment for LC_ALL, LC_MESSAGES and LANG