首页
开发手册
应用中心
工具
用户中心
Ease Template Multi-language
English
中文简体
English
上一篇
下一篇
### Ease Template Multi-language This problem is both a headache and troublesome for many programmers. Ease Template has tailored multi-language functions for programmers. Just define a label on the text that needs to be translated and it can be recorded in the language pack. Even a long text can be defined in the language pack and there is no need to worry about the language pack being too large, because Ease Template will automatically divide the language pack into Different small language packs will be automatically loaded when they are read. The default language pack will be written into the language directory under the current program directory. When there is no write permission, the program will give up building language packs. Note:`When developing the ET multi-language function, consider that the default language pack conflicts with the language packs of other countries, so it is mandatory that the user must have a motherboard language pack, and the name must be language/default.php. Otherwise, when you add a new language tag, it will not be added automatically。` Explanation of language package structure: For example, the text "`Ease Template is great!`" is recorded in the language package. Generate language pack format: ``` $fp_lang['7ec49c5eb48abf8293354daedb9e2820'] = <<< EOT Ease Template Great! EOT; ``` After the English version is automatically translated, the same language package en.php will be generated ``` $fp_lang['7ec49c5eb48abf8293354daedb9e2820'] = <<< EOT Ease Template Very Good! EOT; ``` test_15.php ``` 'language' , //The directory where the language files are stored 'Language' =>$lang , //language default file ) ); $tpl->set_file('test_15'); $tpl->p(); ?> ``` The language tag is loaded in the template, and two links to switch languages are provided below: view/test_15.htm ```
Ease Template Great!
Chiese
English
```