I18n
extends PlatformUtility
in package
Provides internationalization support.
Tags
Table of Contents
- DEFAULT_LANGUAGE_ISO = 'en'
- I18N_TEMPLATE_FILE_EXTENTION = '.json'
- I18N_TEMPLATE_PATH = '/admin/i18n/'
- formatNumber() : string
- Format a number using the locale for the current session.
- get() : string
- Get a label defined in the template localisation file, for the current session language.
- getCountry() : string
- Get the Alpha-2 code for the current session language.
- getDeliveryCountry() : string
- Get the delivery country iso for the current session language
- getLocale() : string
- Get the IETF BCP 47 tag for the current session language.
- getPhoneCode() : int
- Get the phone code for the current session language
- getTitle() : string
- Get the name of the current session language.
Constants
DEFAULT_LANGUAGE_ISO
public
mixed
DEFAULT_LANGUAGE_ISO
= 'en'
Tags
I18N_TEMPLATE_FILE_EXTENTION
public
mixed
I18N_TEMPLATE_FILE_EXTENTION
= '.json'
Tags
I18N_TEMPLATE_PATH
public
mixed
I18N_TEMPLATE_PATH
= '/admin/i18n/'
Tags
Methods
formatNumber()
Format a number using the locale for the current session.
public
formatNumber([float|null $value = null ]) :
string
Parameters
- $value : float|null = null
Tags
Return values
string —get()
Get a label defined in the template localisation file, for the current session language.
public
get(string $key[, array<string|int, mixed> $variables = [] ]) :
string
If the label does not exists, this function will return the key argument in this format.
<<< key >>>
Parameters
- $key : string
- $variables : array<string|int, mixed> = []
Tags
Return values
string —getCountry()
Get the Alpha-2 code for the current session language.
public
getCountry() :
string
Tags
Return values
string —getDeliveryCountry()
Get the delivery country iso for the current session language
public
getDeliveryCountry() :
string
Tags
Return values
string —getLocale()
Get the IETF BCP 47 tag for the current session language.
public
getLocale() :
string
Tags
Return values
string —getPhoneCode()
Get the phone code for the current session language
public
getPhoneCode() :
int
Tags
Return values
int —getTitle()
Get the name of the current session language.
public
getTitle() :
string