2017 © Pedro Peláez
 

yii2-extension yii2-multilanguage

Multi Language support for Yii2 Framework.

image

cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  • Thursday, March 1, 2018
  • by cinghie
  • Repository
  • 2 Watchers
  • 3 Stars
  • 1,728 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 4 Forks
  • 0 Open issues
  • 8 Versions
  • 9 % Grown

The README.md

Yii2 MultiLanguage

License Latest Stable Version Latest Release Date Latest Commit Total Downloads, (*1)

Multi Language support for Yii2 Framework based on this post on Official Forum:
http://www.yiiframework.com/forum/index.php/topic/56027-yii2-multilingual-website-url-rules/, (*2)

Installation

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

Either run, (*4)

php composer.phar require cinghie/yii2-multilanguage "*"

or add this line to the require section of your composer.json file., (*5)

"cinghie/yii2-multilanguage": "*"

Configuration

Set in Configuration File:, (*6)

// Language Settings
'language'   => 'en',
'sourceLanguage' => 'en_GB',

Make sure you have set the parameter 'language': the default language will be that, (*7)

Set URL Manager in 'component' Configuration File:, (*8)

// Url Manager
'urlManager' => [
    'class' => 'codemix\localeurls\UrlManager',
    'languages' => ['en', 'it', 'fr', 'de', 'es'], // List all supported languages here
    'enablePrettyUrl' => true,
    'showScriptName' => false,
],

Images

Copy the img folder from the project root to your web folders to see flag's images, (*9)

Widgets

You can load the MultiLanguage Widget in the your view like this:, (*10)

<?= MultiLanguageWidget::widget([
    'addCurrentLang' => true, // add current lang
    'calling_controller' => $this->context,
    'image_type'  => 'classic', // classic or rounded
    'link_home'   => true, // true or false
    'widget_type' => 'classic', // classic or selector
    'width'       => '28'
]); ?>

There are 4 params in the Widget: * Widget Type can be classic or selector * Image Type can be classic or rounded * Width in pixel of the flags * The Calling Controller (Do not Edit), (*11)

Changelog

  • Version 2.0.2 - Adding options to add current Lang on widgets
  • Version 2.0.1 - Adding Ca, Ch, In, Ne, Ru, Us flags
  • Version 2.0.0 - Refactoring project adding Yii2 Locale URLs: https://github.com/codemix/yii2-localeurls
  • Version 1.2.0 - Minor improvements
  • Version 1.1.2 - Fixing error to extends yii Widget problem
  • Version 1.1.1 - Update Copyright and license
  • Version 1.1.0 - Bug Fixed not home View
  • Version 1.0.0 - Initial Release

The Versions

01/03 2018

dev-master

9999999-dev https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD-3-Clause BSD 3-Clause

The Requires

 

language yii2 translate lang yii2 multilanguage yii2 language yii2 lang yii2 translate

18/12 2016

2.0.1

2.0.1.0 https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD 3-Clause

The Requires

 

language yii2 translate lang

14/01 2016

v2.0.0

2.0.0.0 https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD 3-Clause

The Requires

 

language yii2 translate lang

16/06 2015

v1.2.0

1.2.0.0 https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD 3-Clause

The Requires

 

language yii2 translate lang

11/06 2015

v1.1.2

1.1.2.0 https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD 3-Clause

The Requires

 

language yii2 translate lang

16/03 2015

v1.1.1

1.1.1.0 https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD 3-Clause

The Requires

 

language yii2 translate lang

16/03 2015

v1.1

1.1.0.0 https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD 3-Clause

The Requires

 

language yii2 translate lang

16/03 2015

v1.0

1.0.0.0 https://github.com/cinghie/yii2-multilanguage

Multi Language support for Yii2 Framework.

  Sources   Download

BSD 3-Clause

The Requires

 

language yii2 translate lang