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

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

metalguardian/yii2-i18n-module
==============================

Yii2 internalization module

2186PHP

Since Oct 13Pushed 10y ago1 watchersCompare

[ Source](https://github.com/MetalGuardian/yii2-i18n-module)[ Packagist](https://packagist.org/packages/metalguardian/yii2-i18n-module)[ RSS](/packages/metalguardian-yii2-i18n-module/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

I18n module
===========

[](#i18n-module)

Yii2 internalization module

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist metalguardian/yii2-i18n-module "*"

```

or add

```
"metalguardian/yii2-i18n-module": "*"

```

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

Usage
-----

[](#usage)

How to configure component:

```
'components' => [
    // ...
    'i18n' => [
        'class' => '\metalguardian\i18n\components\I18n',
        // you can configure message sources, which will be used to handle all sources
        'messageSourceConfig' => [
            // here you can change all message source settings
            //'class' => \yii\i18n\DbMessageSource::className(),
        ],
        // you can turn off handling missing translations
        'handleMissing' => true,
        // here you can setup which categories to handle
        'only' => [
            'app',
            '*',
            // for example, you can add 'yii' core category
            //'yii',
        ],
        // do you want to override already configured message sources?
        'override' => true,
         // a list of languages
        'languages' => ['en', 'uk', 'fr', 'es'],
    ],
],
```

You can handle ALL message sources like this:

```
'components' => [
    // ...
    'i18n' => [
        'class' => '\metalguardian\i18n\components\I18n',
        'only' => false,
        'override' => true,
        'languages' => ['en', 'uk', 'fr', 'es'],
    ],
],
```

This will override all other message sources and setup '\*' source, which handle all translations in application

If you don't have message tables in your database yet, you may use migrations:

```
./yii migrate --migrationPath=@vendor/metalguardian/yii2-i18n-module/src/migrations
```

In admin application you need to configure translation module:

```
'modules' => [
    // ...
    'i18n' => [
        'class' => 'metalguardian\i18n\Module',
    ],
],
```

If you set 'i18n' name to the module, you can simply call \\metalguardian\\i18n\\Module::getUrl() to get link to the translation controller

Using this module you can export and import translations from and into database:

Export all messages from database:

```
./yii message/export ./common/messages
```

Export only `app` category from database:

```
./yii message/export ./common/messages app
```

Import translations from all files in ./vendor/yiisoft/yii2/messages/. Script will ask you some questions, like category message and language for the importing file

```
./yii message/import ./vendor/yiisoft/yii2/messages/
```

You can add `override` argument to override existing translations with translations stored in files

```
./yii message/import ./vendor/yiisoft/yii2/messages/   1
```

Or you can import only one file. Than you need to specify all parameters as arguments:

```
./yii message/import-file ./vendor/yiisoft/yii2/messages/uk/yii.php yii uk
```

And if you need override existing translations:

```
./yii message/import-file ./vendor/yiisoft/yii2/messages/uk/yii.php yii uk 1
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

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/b9c4538fa5cd95fe3ad0e4e98c7d5dba9c4a0145bc6cb8506c82d6a9f75b30c1?d=identicon)[MetalGuardian](/maintainers/MetalGuardian)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[joedixon/laravel-translation

A tool for managing all of your Laravel translations

717911.4k11](/packages/joedixon-laravel-translation)[illuminate/translation

The Illuminate Translation package.

6936.4M495](/packages/illuminate-translation)[lajax/yii2-translate-manager

Translation management extension for Yii 2

227578.8k13](/packages/lajax-yii2-translate-manager)[larswiegers/laravel-translations-checker

Make sure your laravel translations are checked and are included in all languages.

256423.2k2](/packages/larswiegers-laravel-translations-checker)[inpsyde/multilingual-press

Simply THE multisite-based free open source plugin for your multilingual websites.

2414.0k1](/packages/inpsyde-multilingual-press)[statikbe/laravel-chained-translator

The Laravel Chained Translator can combine several translators that can override each others translations.

36149.4k6](/packages/statikbe-laravel-chained-translator)

PHPackages © 2026

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