PHPackages                             harlangray/languageswitcher - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Localization &amp; i18n](/categories/localization)
4. /
5. harlangray/languageswitcher

ActiveYii2-extension[Localization &amp; i18n](/categories/localization)

harlangray/languageswitcher
===========================

Yii Framework 2.0 Component language switcher

1.0.0(11y ago)117MITPHP

Since Jan 22Pushed 11y ago1 watchersCompare

[ Source](https://github.com/harlangray/languageswitcher)[ Packagist](https://packagist.org/packages/harlangray/languageswitcher)[ RSS](/packages/harlangray-languageswitcher/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

languageswitcher
================

[](#languageswitcher)

Component for Yii2 language switcher

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist "harlangray/languageswitcher": "*"

```

or add

```
"harlangray/languageswitcher": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Once the extension is installed, simply modify your application configuration as follows:

```
return [
    'bootstrap' => ['lang'],
    'components' => [
        'lang' => [
            'class' => 'harlangray\language\Language',
            'queryParam' => 'lang',

        ],
        // ...
    ],
    ...
];
```

You must define available languages in `Yii::$app->params['languages']` as code =&gt; language in the config/params.php

'languages' =&gt; \[ 'en' =&gt; 'english', 'si' =&gt; 'සිංහල', 'ta' =&gt; 'தமிழ்' \]

and use

```
Yii::$app->lang->getMenuItems()

```

In your menu "items"

EX: echo Nav::widget(\[ 'options' =&gt; \['class' =&gt; 'navbar-nav navbar-right'\], 'items' =&gt; \[ \['label' =&gt; 'Home', 'url' =&gt; \['/site/index'\]\], ........ ......... ........ Yii::$app-&gt;lang-&gt;getMenuItems() \],
\]); NavBar::end();

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4180d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/9457042?v=4)[harlangray](/maintainers/harlangray)[@harlangray](https://github.com/harlangray)

---

Top Contributors

[![harlangray](https://avatars.githubusercontent.com/u/9457042?v=4)](https://github.com/harlangray "harlangray (4 commits)")

---

Tags

languageyii2switcher

### Embed Badge

![Health badge](/badges/harlangray-languageswitcher/health.svg)

```
[![Health](https://phpackages.com/badges/harlangray-languageswitcher/health.svg)](https://phpackages.com/packages/harlangray-languageswitcher)
```

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227597.2k13](/packages/lajax-yii2-translate-manager)[devgroup/yii2-multilingual

Allows building yii2 apps for multiple languages using regional URL's and domains

152.6k2](/packages/devgroup-yii2-multilingual)[tigrov/yii2-country

Country data for Yii2 using Intl extension and more.

151.1k](/packages/tigrov-yii2-country)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
