PHPackages                             dvixi/yii2-i18n - 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. dvixi/yii2-i18n

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

dvixi/yii2-i18n
===============

Yii2 i18n (internalization) module makes the translation of your application so simple

0.1.3(10y ago)062MITPHP

Since Jan 3Pushed 10y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (5)Used By (0)

Yii2 I18N module
================

[](#yii2-i18n-module)

added caching for messages and source messages

modification of [Zelenin Yii2 i18n](https://github.com/zelenin/yii2-i18n-module)
--------------------------------------------------------------------------------

[](#modification-of-zelenin-yii2-i18n)

[Yii2](http://www.yiiframework.com) i18n (internalization) module makes the translation of your application so simple

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

[](#installation)

### Composer

[](#composer)

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

Either run

```
php composer.phar require dvixi/yii2-i18n "dev-master"

```

or add

```
"dvixiyii2-i18n": "dev-master"

```

to the require section of your `composer.json`

Usage
-----

[](#usage)

Configure I18N component in common config:

```
'i18n' => [
	'class' => dvixi\yii2\I18n\components\I18N::className(),
	'languages' => ['ru-RU', 'de-DE', 'it-IT']
],
```

Configure I18N component in backend config:

```
'modules' => [
	'i18n' => dvixi\yii2\I18n\Module::className()
],
```

Run:

```
php yii migrate --migrationPath=@Zelenin/yii/modules/I18n/migrations

```

Go to `http://backend.yourdomain.com/translations` for translating your messages

### PHP to DB import

[](#php-to-db-import)

If you have an old project with PHP-based i18n you may migrate to DbSource via console.

Run:

```
php yii i18n/import @common/messages

```

where `@common/messages` is path for app translations

### DB to PHP export

[](#db-to-php-export)

Run:

```
php yii i18n/export @dvixi/yii2/I18n/messages dvixi/yii2/i18n

```

where `@dvixi/yii2/I18n/messages` is path for app translations and `zelenin/modules/i18n` is translations category in DB

### Using `yii` category with DB

[](#using-yii-category-with-db)

Import translations from PHP files

```
php yii i18n/import @yii/messages

```

Configure I18N component:

```
'i18n' => [
    'class'=> dvixi\yii2\I18n\components\I18N::className(),
    'languages' => ['ru-RU', 'de-DE', 'it-IT'],
    'translations' => [
        'yii' => [
            'class' => yii\i18n\DbMessageSource::className()
        ]
    ]
],
```

Info
----

[](#info)

Component uses yii\\i18n\\MissingTranslationEvent for auto-add of missing translations to database

See [Yii2 i18n guide](https://github.com/yiisoft/yii2/blob/master/docs/guide/tutorial-i18n.md)

Source author
-------------

[](#source-author)

[Aleksandr Zelenin](https://github.com/zelenin/), e-mail:

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity56

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.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

3783d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6e04fbe18bfb1c8a3d6ca739919ea9ff097ea43709c6448750ced46b091c7a1f?d=identicon)[athl64](/maintainers/athl64)

---

Top Contributors

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

---

Tags

i18ntranslationstranslationyii2

### Embed Badge

![Health badge](/badges/dvixi-yii2-i18n/health.svg)

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

###  Alternatives

[uran1980/yii2-translate-panel

Yii2 Translate Panel makes the translation of your application awesome!

2518.3k1](/packages/uran1980-yii2-translate-panel)[om/potrans

Command line tool for translate Gettext with Google Translator API or DeepL API

10515.0k4](/packages/om-potrans)[yiimaker/yii2-translatable

Translatable behavior aggregates logic of linking translations to the primary model

1534.0k1](/packages/yiimaker-yii2-translatable)[geertw/yii2-translatable-url-rule

A custom URL rule class for Yii 2 which allows to create translated URL rules

1420.3k](/packages/geertw-yii2-translatable-url-rule)[instaclick/translation-editor-bundle

Web editor UI to manage Symfony2 translations (Symfony2 bundle)

2019.5k](/packages/instaclick-translation-editor-bundle)[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)
