我如何强制 laravel 使用我的翻译文件夹中的 en.json 文件?

How do I force laravel to use the en.json file on my translation folder?

我正在尝试在 laravel 上实现多语言支持。我在 ko.jso 和 es.json 文件中有其他语言,如韩语和西班牙语。但问题是如果我包括 en.json。它不会被 laravel 检测到。它使用在我的代码中找到的默认字符串,而不是使用 en.json 文件中的值。我如何强制 laravel 使用我的翻译文件夹中的 en.json 文件?

在我的翻译 en.json 文件中有这样的内容。

{"2117-Company Information": "Company Information"}

在我的代码中,我是这样做的:

__('2117-Company Information')

我使用这段代码输出了我当前使用的语言

dd(App::getLocale()); // Output "eng"

感谢所有我找到了问题

第一个问题是我的文件名是 "en.json" 而不是 "eng.json"

其次,我的 eng.json 文件中有数字键,例如

{
"1000": "test 1",
"1001": "hello world",
"1002": "awesome world",
..... 
 "2000": "test word 2000"
}

当我尝试使用键“1000”时,它输出了键“2000”的值。我认为这是一个错误。但是我把所有的钥匙都换成了这样的东西

{
"1000-test 1": "test 1",
"1001-hello world": "hello world",
"1002": "awesome world",
..... 
 "2000-test word 2000": "test word 2000"
}

在我这边效果很好