2017 © Pedro Peláez
 

yii2-extension yii2-i18n

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

image

dvixi/yii2-i18n

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

  • Sunday, January 3, 2016
  • by athl64
  • Repository
  • 1 Watchers
  • 0 Stars
  • 56 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Yii2 I18N module

added caching for messages and source messages, (*1)

modification of Zelenin Yii2 i18n

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

Installation

Composer

The preferred way to install this extension is through Composer., (*3)

Either run, (*4)

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

or add, (*5)

"dvixiyii2-i18n": "dev-master"

to the require section of your composer.json, (*6)

Usage

Configure I18N component in common config:, (*7)

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

Configure I18N component in backend config:, (*8)

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

Run:, (*9)

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

Go to http://backend.yourdomain.com/translations for translating your messages, (*10)

PHP to DB import

If you have an old project with PHP-based i18n you may migrate to DbSource via console., (*11)

Run:, (*12)

php yii i18n/import @common/messages

where @common/messages is path for app translations, (*13)

DB to PHP export

Run:, (*14)

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, (*15)

Using yii category with DB

Import translations from PHP files, (*16)

php yii i18n/import @yii/messages

Configure I18N component:, (*17)

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

Info

Component uses yii\i18n\MissingTranslationEvent for auto-add of missing translations to database, (*18)

See Yii2 i18n guide, (*19)

Source author

Aleksandr Zelenin, e-mail: aleksandr@zelenin.me, (*20)

The Versions

03/01 2016

dev-master

9999999-dev

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

  Sources   Download

MIT

The Requires

 

translations yii2 translation i18n

03/01 2016

0.1.0

0.1.0.0

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

  Sources   Download

MIT

The Requires

 

translations yii2 translation i18n

03/01 2016

0.1.1

0.1.1.0

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

  Sources   Download

MIT

The Requires

 

translations yii2 translation i18n

03/01 2016

0.1.2

0.1.2.0

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

  Sources   Download

MIT

The Requires

 

translations yii2 translation i18n

03/01 2016

0.1.3

0.1.3.0

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

  Sources   Download

MIT

The Requires

 

translations yii2 translation i18n