These two days by the multi-lingual force, first summed up the document type.
1, to params.php configuration language type
2, to the view Layer site--index.php language output, the language will be changed in the field to write:
Get the page:
3, in the corresponding JS file, using jquery Ajax to obtain the language tag ID, etc., transferred to sitecontroller.php
4, to sitecontroller.php to establish the language method to receive AJAX data, and processing:
5, at the top of the sitecontroller.php, behavior add language, otherwise no permissions, AJAX data can not pass, reported forbidden 403:
6, to main.php to configure the multi-language i18n
7, write massage, field translation of the file:
8. Configure multiple languages in main.php
9, to component, configure the detection of cookies
10, to the browser, refresh, click on the language will change:
Compared to thinkphp is a lot of trouble, the next summary from the database to tune dynamic multi-language.
YII2 Multi-language configuration with cookies