PHPackages                             humanized/yii2-translation - 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. humanized/yii2-translation

ActiveYii2-extension

humanized/yii2-translation
==========================

Yii2 module which provides functionality to deal with translation in a sane way.

087PHP

Since Oct 24Pushed 9y ago1 watchersCompare

[ Source](https://github.com/humanized/yii2-translation)[ Packagist](https://packagist.org/packages/humanized/yii2-translation)[ RSS](/packages/humanized-yii2-translation/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2-Translation - README
=========================

[](#yii2-translation---readme)

[![Yii2](https://camo.githubusercontent.com/d6b0929173e28cc627430d2519ca1853466a70f37395877eaf4820cb3e1e1909/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f506f77657265645f62792d5969695f4672616d65776f726b2d677265656e2e7376673f7374796c653d666c6174)](http://www.yiiframework.com/)

Provides various interfaces to deal with routine tasks dealing with site translation management.

Features
--------

[](#features)

Yii2 Site Translation Module

Provides interfaces to deal with:

- Enable/disable application languages using database storage (GUI,CLI)
- Set default application language using database storage (GUI,CLI)

Provides various flexible language selection widgets:

- Inline List
- Bootstrap Dropdown Button
- Bootstrap Dropdown List

Dependencies
------------

[](#dependencies)

This package relies on following dependecies:

- Codemix Yii2 Locale Urls version 1.3.0.
- Humanized PHP Locale helpers dev:master

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

[](#installation)

### Install Using Composer

[](#install-using-composer)

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

Either run

```
$ php composer.phar require humanized/yii2-translation "*"

```

or add

```
"humanized/yii2-translation": "*"

```

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

### Run Migrations

[](#run-migrations)

```
$ php yii migrate/up --migrationPath=@vendor/humanized/yii2-translation/migrations
```

### Edit Configuration File

[](#edit-configuration-file)

Add following lines to the configuration file:

```
'modules' => [
    'translation' => [
        'class' => 'humanized\translation\Module',
    ],
],
```

Adding these lines allows access to the various interfaces provided by the module. Here, the chosen module-name is translation, as such the various routes will be available at translation/controller-id/action-id, though any module-name can be chosen.

This package contains an urlManager component which extends the urlManager component provided by the [Codemix Yii2-LocaleUrls](https://github.com/codemix/yii2-localeurls) package. Here setup of the default application language and population of the enabled website languages are handled automatically. Other configuration options are inherited between components.

```
'components' => [
..
        // Languages enabled populated through database storage
        // Further configuration options available at https://github.com/codemix/yii2-localeurls
        'urlManager' => [
            'class' => 'humanized\translation\components\UrlManager',
            'enablePrettyUrl' => true,
            'showScriptName' => false,
        ],
..
],
```

### Getting Started

[](#getting-started)

Once configured, one or multiple languages should be enabled using the various interfaces provided by the module. To get up-and-running quickly, an example is given to enable some languages using the CLI provided by the package:

```
$ php yii translation/language/enable en
$ php yii translation/language/enable fr
$ php yii translation/language/enable nl
$ php yii translation/language/set-default en
```

Above mentioned lines enables the English, French and Dutch language ands sets English as the default language

For full instructions on how to use the fully-configured module, check the [USAGE](USAGE.md)-file.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/1a07fca5b8f6fe268961a6744dbfd2175da8c785f5e26b2edaeb552f9bbcabd2?d=identicon)[jeffrey.geyssens](/maintainers/jeffrey.geyssens)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/humanized-yii2-translation/health.svg)

```
[![Health](https://phpackages.com/badges/humanized-yii2-translation/health.svg)](https://phpackages.com/packages/humanized-yii2-translation)
```

PHPackages © 2026

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