humandevice / yii2-header-language-selector
Bootstrap class to set application language by header attribute.
Installs: 550
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 3
Forks: 1
Open Issues: 0
Type:yii2-extension
Requires
- yiisoft/yii2: *
This package is not auto-updated.
Last update: 2022-02-01 13:06:05 UTC
README
Bootstrap class to set application language by header attribute.
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist humandevice/yii2-header-language-selector "*"
or add
"humandevice/yii2-header-language-selector": "*"
to the require section of your composer.json
file.
Usage
Once the extension is installed, simply use it in your REST API config:
return [
// ...
'bootstrap' => [
// ...
'languageSelector' => [
'class' => 'hd\yii2\bootstrap\LanguageSelector',
'supportedLanguages' => ['en', 'pl'],
'defaultLanguage' => 'pl'
],
],
];