refactor: 使用官方support\Translation替代自定义Lang类
- 创建 config/translation.php 配置文件
- 将翻译文件从 lang/ 移动到 resource/translations/ 目录
- 按照 Symfony Translation 标准重命名文件 (messages.{locale}.php)
- 删除自定义的 app\util\Lang 类
- 使用官方的 trans() 和 locale() 函数
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
<?php
|
||||
/**
|
||||
* Multilingual configuration
|
||||
*/
|
||||
return [
|
||||
// Default language
|
||||
'locale' => 'zh',
|
||||
// Fallback language
|
||||
'fallback_locale' => ['zh', 'en'],
|
||||
// Folder where language files are stored
|
||||
'path' => base_path() . '/resource/translations',
|
||||
];
|
||||
Reference in New Issue
Block a user