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

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

vintage/yii2-i18n
=================

Internalization module for automatic adding of translations to database

1.3.0(8y ago)55.2k↑50%2[1 issues](https://github.com/Vintage-web-production/yii2-i18n/issues)BSD-3-ClausePHP

Since Jun 7Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Vintage-web-production/yii2-i18n)[ Packagist](https://packagist.org/packages/vintage/yii2-i18n)[ RSS](/packages/vintage-yii2-i18n/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (4)Dependencies (1)Versions (5)Used By (0)

 [ ![](https://avatars1.githubusercontent.com/u/25753250) ](https://github.com/Vintage-web-production)

Internalization module for Yii2
===============================

[](#internalization-module-for-yii2)

Internalization module for automatic adding of translations to database.

Based on [Zelenin](https://github.com/zelenin/yii2-i18n-module) I18N module.

[![Total Downloads](https://camo.githubusercontent.com/a922ce82d812d75ccae1eedbe529468c0692c71fbe856a163b3f0b945721f6eb/68747470733a2f2f706f7365722e707567782e6f72672f76696e746167652f796969322d6931386e2f646f776e6c6f616473)](https://packagist.org/packages/vintage/yii2-i18n)[![Latest Stable Version](https://camo.githubusercontent.com/951ec21a6acbe33ff54e79ea875dc298b6a210fd2ab351147c5178bae5fd8d3c/68747470733a2f2f706f7365722e707567782e6f72672f76696e746167652f796969322d6931386e2f762f737461626c65)](https://packagist.org/packages/vintage/yii2-i18n)[![Latest Unstable Version](https://camo.githubusercontent.com/5bf798778a761acbea948d4ea731fadcd12dd197e2eb893f453e492f7393ccb5/68747470733a2f2f706f7365722e707567782e6f72672f76696e746167652f796969322d6931386e2f762f756e737461626c65)](https://packagist.org/packages/vintage/yii2-i18n)

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

[](#installation)

#### Install package

[](#install-package)

Run command

```
composer require vintage/yii2-i18n

```

or add

```
"vintage/yii2-i18n": "~1.1"
```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

1. Configure I18N component in common part of your application

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

2. Configure module in backend part of your application

```
'modules' => [
	'i18n' => vintage\i18n\Module::className(),
	// ...
],
```

3. Applying migrations

```
./yii migrate --migrationPath=@vintage/i18n/migrations

```

Usage
-----

[](#usage)

Go to `http://backend.your-app.dev/translations` for translating of messages.

### PHP to database import

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

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

Run command

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

```

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

### Database to PHP export

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

Run command

```
./yii i18n/export @vintage/i18n/messages vintage/i18n

```

where `@vintage/i18n/messages` is path to app translations and `vintage/i18n` is translations category in DB.

### Using `yii` category with database

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

Import translations from PHP files

```
./yii i18n/import @yii/messages

```

Configure I18N component

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

### Caching

[](#caching)

Cache will be updates automaticly if you updates translations in dashboard.

If you using `\yii\caching\FileCache` your config should be like following

```
// common/config/main.php
`components` => [
    // ...
    'i18n' => [
        'class'=> vintage\i18n\components\I18N::className(),
        'languages' => ['ru-RU', 'de-DE', 'it-IT'],
        'enableCaching' => true,
        'cache' => 'i18nCache',
    ],
    'i18nCache' => [
        'class' => \yii\caching\FileCache::className(),
        'cachePath' => '@frontend/runtime/cache',
    ],
],
```

Other
-----

[](#other)

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

Read more about I18N in [official guide](https://github.com/yiisoft/yii2/blob/master/docs/guide/tutorial-i18n.md).

Licence
-------

[](#licence)

[![License](https://camo.githubusercontent.com/0844b951c9b554d8202720e76a81c3bbcfabe21d438e15657bb67618102ad14d/68747470733a2f2f706f7365722e707567782e6f72672f76696e746167652f796969322d6931386e2f6c6963656e7365)](https://packagist.org/packages/vintage/yii2-i18n)

This project is released under the terms of the BSD-3-Clause [license](LICENSE).

Copyright (c) 2017, [Vintage Web Production](https://vintage.com.ua/)

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity28

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity66

Established project with proven stability

 Bus Factor1

Top contributor holds 55.6% 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 ~27 days

Total

4

Last Release

3184d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/22162d77618ce0d31a3280f4645890120b52c41dac52432192bc0ea0119bd65f?d=identicon)[Vintage-web-production](/maintainers/Vintage-web-production)

---

Top Contributors

[![zelenin](https://avatars.githubusercontent.com/u/1427885?v=4)](https://github.com/zelenin "zelenin (45 commits)")[![greeflas](https://avatars.githubusercontent.com/u/17636915?v=4)](https://github.com/greeflas "greeflas (30 commits)")[![insane-dev](https://avatars.githubusercontent.com/u/3304603?v=4)](https://github.com/insane-dev "insane-dev (5 commits)")[![notgosu](https://avatars.githubusercontent.com/u/2412202?v=4)](https://github.com/notgosu "notgosu (1 commits)")

---

Tags

i18ntranslation-managementyii2yii2-extensioni18ntranslationstranslationyii2

### Embed Badge

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

```
[![Health](https://phpackages.com/badges/vintage-yii2-i18n/health.svg)](https://phpackages.com/packages/vintage-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)
