http://www.yiichina.com/doc/guide/2.0/tutorial-i18n

config/main.php

外层加

'language' => 'en-US',
'sourceLanguage' => 'zh-CN',
components里加
'i18n' => [
'translations' => [
'*' => [
'class' => 'yii\i18n\PhpMessageSource',
//'basePath' => '/messages',
'fileMap' => [
'collection' => 'collection.php'
],
],
],
],

  

简单使用

Yii::t('app', 'This is a string to translate!');

  

config同级目录下建messages目录

最新文章

  1. NoSql数据库使用半年后在设计上面的一些心得
  2. mysql 修改 character_set_database 编码格式
  3. Altium Designer PCB 常用功能键
  4. Ubuntu下VIM(GVIM)环境配置
  5. 【Java SE】如何用Java实现直接选择排序
  6. Win32线程安全问题.同步函数
  7. 【XSY2190】Alice and Bob VI 树形DP 树剖
  8. highChart 缺值-曲线断开问题
  9. dubbo框架原理
  10. How-to Install VMware Tools on Debian Stretch 9 32/64bit Linux+GNU
  11. 并发编程之 Condition 源码分析
  12. plsql 导出查询结果
  13. APM最佳实践: 诊断平安城市视频网性能问题
  14. PAT 1057 Stack [难][树状数组]
  15. JDK版本Java SE、Java EE、Java ME的区别
  16. P2672 推销员 优先队列 + 贪心
  17. eclipse的最新版本luna的中建立svn和maven
  18. Powershell 获取文件版本信息
  19. 到底什么是hash
  20. win vista系统的ReadyBoost性能测试

热门文章

  1. table表头固定
  2. makefile opencv的案例
  3. pl/sql游标
  4. 1-N中1出现的次数
  5. python——TypeError: 'str' does not support the buffer interface
  6. Apache 配置:是否显示文件列表
  7. openerp config file
  8. 为每一个应用程序池单独设置aspnet.config配置文件
  9. Jmeter-安装及配置(一)
  10. Hibernate单向“一对多”关联