1. Multilingual through behavior Behavior support/thinkphp/library/behavior/checklangbehavior.class.php
2. A total of 4 language packs, after the definition to overwrite the first defined (similar configuration file config.php overwrite/thinkphp/conf/convention.php)
3. Open multi-lingual support in config.php
' lang_switch_on ' + true,//turn on the language pack function ' Lang_auto_detect ' + true,//Auto Detect language to open multi-lingual function after effective ' lang_list ' = = ' ZH-CN ',//allowed to toggle the list of languages separated by commas ' var_language ' = ' + ',//default language toggle Variable
4. Ensure behavior Behavior Code execution
4.1 Manually start the CheckLangBehavior.class.php behavior
4.2 home/common/conf/tags.php
<?php ReturnArray (//Add the following line definition can//' App_begin ' =>array (' Behavior\checklang '),//if it is 3. 2.1 version needs to be changed to//' App_begin ' =>array (' Behavior\checklangbehavior ');
5 Language Packs 4 levels
"e:\huiyukeji-php\text\thinkphp/lang/zh-cn.php"//The language pack that is called by default
"./application/common/lang/zh-cn.php"//Read Common language pack
"./application/home/lang/zh-cn.php"//Read the specified module language pack
"./application/home/lang/zh-cn/index.php"//Read the specified module specific controller for the language pack
6 Getting language variable information
6.1 L () Quick function gets all the language variables
6.2 Assign () Passing language variables to the stencil for output
6.3 {$Think. lang. Variable name}
6.4 One language pack per language
This article is from the "Wang Zhiqiang" blog, make sure to keep this source http://wangzhiqiang.blog.51cto.com/12079071/1865142
thinikphp Framework support for multiple languages