humandevice/yii2-header-language-selector

This package is abandoned and no longer maintained. No replacement package was suggested.

Bootstrap class to set application language by header attribute.

1.0 2017-03-10 06:50 UTC

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'
        ],
    ],
];