Class humhub\components\i18n\I18N
Inheritance | humhub\components\i18n\I18N » yii\i18n\I18N |
---|
I18N provides features related with internationalization (I18N) and localization (L10N).
Public Properties
Property | Type | Description | Defined By |
---|---|---|---|
$beforeTranslateCallback | callable | humhub\components\i18n\I18N | |
$messageOverwritePath | string | Path which contains message overwrites | humhub\components\i18n\I18N |
$unsupportedYiiLanguages | array | List of languages | humhub\components\i18n\I18N |
Public Methods
Method | Description | Defined By |
---|---|---|
autosetLocale() | Automatically sets the current locale and time zone | humhub\components\i18n\I18N |
format() | humhub\components\i18n\I18N | |
getAllowedLanguages() | Returns an array of allowed/available language codes | humhub\components\i18n\I18N |
getMessageSource() | humhub\components\i18n\I18N | |
setDefaultLocale() | Sets the system default locale | humhub\components\i18n\I18N |
setGuestLocale() | Sets the locale for the current guest user. | humhub\components\i18n\I18N |
setUserLocale() | Sets the current locale and time zone for a given user. | humhub\components\i18n\I18N |
translate() | humhub\components\i18n\I18N |
Protected Methods
Method | Description | Defined By |
---|---|---|
setLocale() | Sets the language locale of Yii::$app->language and Yii::$app->formatter . |
humhub\components\i18n\I18N |
Property Details
Path which contains message overwrites
List of languages
Method Details
Automatically sets the current locale and time zone
public void autosetLocale ( ) |
public void format ( $message, $params, $language ) | ||
$message | ||
$params | ||
$language |
Returns an array of allowed/available language codes
public array getAllowedLanguages ( ) | ||
return | array | The allowed languages |
---|
public void getMessageSource ( $category ) | ||
$category |
Sets the system default locale
public void setDefaultLocale ( ) |
Sets the locale for the current guest user.
The language is determined by the a cookie
public void setGuestLocale ( ) |
Sets the language locale of Yii::$app->language
and Yii::$app->formatter
.
protected void setLocale ( $locale ) | ||
$locale |
Sets the current locale and time zone for a given user.
If no user is given the currently logged in user will be used.
public void setUserLocale ( $user ) | ||
$user | humhub\modules\user\models\User |
public void translate ( $category, $message, $params, $language ) | ||
$category | ||
$message | ||
$params | ||
$language |