Localization

Type
Class
Namespace
craft\helpers
Inherits
craft\helpers\Localization
Since
3.0.0

Class Localization

View source (opens new window)

# Public Methods

Method Description
findMissingTranslation() Looks for a missing translation string in Yii's core translations.
localeData() Returns fallback data for a locale if the Intl extension isn't loaded.
normalizeLanguage() Normalizes a language into the correct format (e.g. en-US).
normalizeNumber() Normalizes a user-submitted number for use in code and/or to be saved into the database.

# findMissingTranslation()

Looks for a missing translation string in Yii's core translations.

View source (opens new window)

Arguments

# localeData()

Returns fallback data for a locale if the Intl extension isn't loaded.

View source (opens new window)

Arguments

Returns

array (opens new window), null (opens new window)

# normalizeLanguage()

Normalizes a language into the correct format (e.g. en-US).

View source (opens new window)

Arguments

Returns

string (opens new window)

Throws

# normalizeNumber()

Normalizes a user-submitted number for use in code and/or to be saved into the database.

Group symbols are removed (e.g. 1,000,000 => 1000000), and decimals are converted to a periods, if the current locale uses something else.

View source (opens new window)

Arguments

Returns

mixed – The normalized number.