navatech/yii2-multi-language This will help multi-language for Yii2

multilanguagemultiphraselanguage

yii2-multi-language

Packagist Version Total Downloads

This module allow you to create multi language use database. By default, Yii use Yii::t() for multi language. But you must stored the sentences on file, and it never suggested keywords for you. Now you can store it on mySql.

Requirements

Install & config:

Install

Preferred way to install this extension through composer
Either run

composer require navatech/yii2-multi-language "^2.0"

Or add to require section of composer.json then run composer update

"navatech/yii2-multi-language" : "^2.0" 

Config:

[php]
    'language'   => 'en', //TODO Change this to 2 characters
    .....................
    'bootstrap'           => [
        'log',
        'multiLanguage',
    ],
    'components' => [
        'multiLanguage' => [
           'class' => '\navatech\language\Component',
        ],
    ],
    'modules'    => [
        'gridview' => [
            'class' => '\kartik\grid\Module',
        ],
        'language' => [
        'class'    => '\navatech\language\Module',
        /*TODO uncommented if you want to custom view*/
        //'viewPath' => '@app/vendor/navatech/yii2-multi-language/src/views',
        /*TODO uncommented if you want to change suffix of translated table / model.
        should be one word, lowercase only.*/
        //'suffix' => 'translate',
        ],
    ],

Run Yii Migration, you will have two default language (English & Vietnamese):

php yii migrate/up --migrationPath=@vendor/navatech/yii2-multi-language/src/migrations

Usage

LanguageWidget

Multi language on model

Translate

Custom Url Route

Statistics

Downloads
GitHub Stars
GitHub Forks

Releases

Comments



2.0.2.2 is the latest of 16 releases



MIT license
Stats
4 github stars & 3 github forks
0 downloads in the last day
0 downloads in the last 30 days
1046 total downloads