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. |
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
# normalizeLanguage()
Normalizes a language into the correct format (e.g. en-US
).
View source (opens new window)
Arguments
$language
(string (opens new window))
Returns
Throws
- yii\base\InvalidArgumentException (opens new window)
if $language is invalid.
# 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
$number
(mixed
) – The number that should be normalized.$localeId
(string (opens new window), null (opens new window)) – The locale ID that the number is set in
Returns
mixed
– The normalized number.
← Json MailerHelper →