lang.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. // +----------------------------------------------------------------------
  12. // | 多语言设置
  13. // +----------------------------------------------------------------------
  14. use think\facade\Env;
  15. return [
  16. // 默认语言
  17. 'default_lang' => Env::get('lang.default_lang', 'zh-cn'),
  18. // 允许的语言列表
  19. 'allow_lang_list' => ['zh-cn', 'en-us'],
  20. // 多语言自动侦测变量名
  21. 'detect_var' => 'lang',
  22. // 是否使用Cookie记录
  23. 'use_cookie' => true,
  24. // 多语言cookie变量
  25. 'cookie_var' => 'cb_lang',
  26. // 扩展语言包
  27. 'extend_list' => [
  28. 'zh_cn' => app()->getBasePath() . 'lang/zh_cn.php',
  29. 'en_us' => app()->getBasePath() . 'lang/en_us.php',
  30. ],
  31. // Accept-Language转义为对应语言包名称
  32. 'accept_language' => [
  33. 'zh-hans-cn' => 'zh_cn',
  34. 'en-hans-us' => 'en_us',
  35. ],
  36. // 是否支持语言分组
  37. 'allow_group' => true,
  38. ];