ZMLocale
public interface ZMLocale
| Constant Summary | |
|---|---|
| final static str | |
| Method Summary | |
|---|---|
| string | getCode() Get the active locale code. |
| string | getFormat(string group, string type) Get a format. |
| string | getName() Get the locale name. |
| string | init(string locale) Init locale. |
| string | translate(string text, mixed context, string domain) Translate the given text. |
| string | translatePlural(string single, int number, string plural, mixed context, string domain) Translate the given text with plural option. |
public final static str DEFAULT_DOMAIN = 'defaults'
public string getCode()
Get the active locale code.
public string getFormat(string group, string type)
Get a format.
null.public string getName()
Get the locale name.
public string init(string locale)
Init locale.
Init the configured locale implementation. This includes creating the singleton instance of the locale and calling init($locale)
on the locale instance.
The locale instance, in turn, will typically try to load the default language mappings for the locale/language given. Depending on the actual implementation used this can be a file (yaml, mo) or just a static map kept in memory.
[language code]_[country code] or just [language code]; for exampe de_DE, en_NZ or es.public string translate(string text, mixed context, string domain)
Translate the given text.
null.ZMLocale::DEFAULT_DOMAIN.public string translatePlural(string single, int number, string plural, mixed context, string domain)
Translate the given text with plural option.
null to default to the single case.null.ZMLocale::DEFAULT_DOMAIN.
Locale resolver.