lang.php 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | 多语言设置
  4. // +----------------------------------------------------------------------
  5. return [
  6. // 默认语言
  7. 'default_lang' => env('lang.default_lang', 'en'),
  8. // 允许的语言列表
  9. 'allow_lang_list' => ['zh','zh-tw','en','jp','ar','fr','de','es','it','id','th','tr','vi','ko'],
  10. // 多语言自动侦测变量名
  11. 'detect_var' => 'lang',
  12. // 是否使用Cookie记录
  13. 'use_cookie' => true,
  14. // 多语言cookie变量
  15. 'cookie_var' => 'think_lang',
  16. // 扩展语言包
  17. 'extend_list' => [
  18. 'zh' => [
  19. app()->getBasePath() . 'lang/zh.php',
  20. ],
  21. 'zh-cn' => [
  22. app()->getBasePath() . 'lang/zh_cn.php',
  23. ],
  24. 'zh-tw' => [
  25. app()->getBasePath() . 'lang/zh-tw.php',
  26. ],
  27. 'en-us' => [
  28. app()->getBasePath() . 'lang/en_us.php',
  29. ],
  30. 'en' => [
  31. app()->getBasePath() . 'lang/en.php',
  32. ],
  33. 'jp' => [
  34. app()->getBasePath() . 'lang/jp.php',
  35. ],
  36. 'ar' => [
  37. app()->getBasePath() . 'lang/ar.php',
  38. ],
  39. 'fr' => [
  40. app()->getBasePath() . 'lang/fr.php',
  41. ],
  42. 'de' => [
  43. app()->getBasePath() . 'lang/de.php',
  44. ],
  45. 'es' => [
  46. app()->getBasePath() . 'lang/es.php',
  47. ],
  48. 'it' => [
  49. app()->getBasePath() . 'lang/it.php',
  50. ],
  51. 'id' => [
  52. app()->getBasePath() . 'lang/id.php',
  53. ],
  54. 'th' => [
  55. app()->getBasePath() . 'lang/th.php',
  56. ],
  57. 'tr' => [
  58. app()->getBasePath() . 'lang/tr.php',
  59. ],
  60. 'vi' => [
  61. app()->getBasePath() . 'lang/vi.php',
  62. ],
  63. 'ko' => [
  64. app()->getBasePath() . 'lang/ko.php',
  65. ],
  66. ],
  67. // Accept-Language转义为对应语言包名称
  68. 'accept_language' => [
  69. // 'zh-Hans' => 'zh-cn',
  70. 'zh-cn' => 'zh', // 让 zh-cn 指向 zh
  71. 'zh-CN' => 'zh', // 兼容大写
  72. 'en-us' => 'en', // 可选:让 en-us 指向 en
  73. 'en' => 'en',
  74. ],
  75. // 是否支持语言分组
  76. 'allow_group' => true,
  77. ];