PHPackages                             wdmg/yii2-translations - 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. wdmg/yii2-translations

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

wdmg/yii2-translations
======================

Translate manager

1.3.1(2y ago)151111MITPHP

Since Sep 10Pushed 2y ago2 watchersCompare

[ Source](https://github.com/wdmg/yii2-translations)[ Packagist](https://packagist.org/packages/wdmg/yii2-translations)[ Docs](https://github.com/wdmg/yii2-translations)[ RSS](/packages/wdmg-yii2-translations/feed)WikiDiscussions master Synced yesterday

READMEChangelog (4)Dependencies (4)Versions (12)Used By (1)

[![Yii2](https://camo.githubusercontent.com/3f29058a9886ae3e9efc09df82d551051f8ea6c8da1176d9e8ca8a64be6f9b40/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f72657175697265642d596969325f76322e302e34302d626c75652e737667)](https://packagist.org/packages/yiisoft/yii2)[![Downloads](https://camo.githubusercontent.com/3816f5e180f1a1430f0de74f020a8af650b86664eddc99e5b183c3ec129996a7/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f77646d672f796969322d7472616e736c6174696f6e732e737667)](https://packagist.org/packages/wdmg/yii2-translations)[![Packagist Version](https://camo.githubusercontent.com/4468ceec6eb3050829795126999dbad66586fb9e5f7f99278380d6439085a874/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f77646d672f796969322d7472616e736c6174696f6e732e737667)](https://packagist.org/packages/wdmg/yii2-translations)[![Progress](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)](https://camo.githubusercontent.com/d2c102b075c16f8a841e697b04c43bc93c8d092c5795ad8b3090d7fa993c258a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f70726f67726573732d72656164795f746f5f7573652d677265656e2e737667)[![GitHub license](https://camo.githubusercontent.com/2879604426cc09ce25fcf4aff2191e8c1105bb0ba64a4321f99876f55407f11a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f77646d672f796969322d7472616e736c6174696f6e732e737667)](https://github.com/wdmg/yii2-translations/blob/master/LICENSE)

[![Yii2 Translations manager](./docs/images/yii2-translations.png)](./docs/images/yii2-translations.png)

Yii2 Translations
=================

[](#yii2-translations)

Translate manager for Yii2. The module manages the translations and languages of the system. Outputs language versions to the frontend of the site through its own component. The functionality of the module interacts with other modules and provides multilingual content.

This module is an integral part of the [Butterfly.CMS](https://butterflycms.com/) content management system, but can also be used as an standalone extension.

Copyrights (c) 2019-2023 [W.D.M.Group, Ukraine](https://wdmg.com.ua/)

Requirements
============

[](#requirements)

- PHP 5.6 or higher
- Yii2 v.2.0.40 and newest
- [Yii2 Base](https://github.com/wdmg/yii2-base) module (required)

Installation
============

[](#installation)

To install the module, run the following command in the console:

`$ composer require "wdmg/yii2-translations"`

After configure db connection, run the following command in the console:

`$ php yii translations/init`

And select the operation you want to perform:

1. Apply all module migrations
2. Revert all module migrations
3. Scan and add translations

Migrations
==========

[](#migrations)

In any case, you can execute the migration and create the initial data, run the following command in the console:

`$ php yii migrate --migrationPath=@vendor/wdmg/yii2-translations/migrations`

Configure
=========

[](#configure)

To add a module to the project, add the following data in your configuration file:

```
'modules' => [
    'translations' => [
        'class' => 'wdmg\translations\Module',
        'routePrefix' => 'admin',
        'supportLocales' => ["en", "en-US", "uk", "uk-UA", "ru", "ru-RU", "de", "de-DE", "fr", "fr-FR", "hi", "hi-IN"], // support languages (locales)
        'forceTranslation' => false, // force message translation when the source and target languages are the same
        'sourceLanguage' => 'en-US', // the language of the original messages
        'enableCaching' => false, // enable caching translated messages
        'cachingDuration' => 3600 // time in seconds that the messages can be cached
        'languageScheme' => 'before', // language Scheme (position in URL): before (by default), after, query, subdomain
        'urlManagerConfig' => [], // UrlManager configuration
        'languageOpenGraph' => true, // add OpenGraph markup
        'languageHrefLang' => true, // add HrefLang attribute
        'useExtendedPatterns' => false, // extend search by full code of locale
        'hideDefaultLang' => true, // hide default language locale in URL`s
        ...
    ],
    ...
],

```

Routing
=======

[](#routing)

Use the `Module::dashboardNavItems()` method of the module to generate a navigation items list for NavBar, like this:

```

```

Status and version \[ready to use\]
===================================

[](#status-and-version-ready-to-use)

- v.1.3.1 - Fix url manager for set lang
- v.1.3.0 - Fixes, update dependencies and copyrights
- v.1.2.3 - Update README.md and added/updated languages

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity64

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

Every ~138 days

Recently: every ~290 days

Total

11

Last Release

1053d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1635637?v=4)[Alexsander Vyshnyvetskyy](/maintainers/alex-wdmg)[@alex-wdmg](https://github.com/alex-wdmg)

---

Top Contributors

[![alex-wdmg](https://avatars.githubusercontent.com/u/1635637?v=4)](https://github.com/alex-wdmg "alex-wdmg (39 commits)")

---

Tags

translationsyii2wdmgyii2-translations

### Embed Badge

![Health badge](/badges/wdmg-yii2-translations/health.svg)

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

###  Alternatives

[uran1980/yii2-translate-panel

Yii2 Translate Panel makes the translation of your application awesome!

2518.3k1](/packages/uran1980-yii2-translate-panel)[yiimaker/yii2-translatable

Translatable behavior aggregates logic of linking translations to the primary model

1534.0k1](/packages/yiimaker-yii2-translatable)

PHPackages © 2026

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