That should work just fine. As you can see here, you can nest it: https://github.com/laravel/laravel/blob/9.x/lang/en/validation.php#L28
Nov 8, 2022
5
Level 8
How can I access nested translation values in localization file?
I have a translation file called translations.php:
return [
'key1' => 'value1',
'key2' => 'value2',
]
But what if I want to organize it by "subjects":
return [
'subject1' => ['key1' => 'value1', 'key2' =>'value2'],
'subject2' => ['key3' => 'value3', 'key4' =>'value4']
]
Is it possible? Or for that I should use the translation strings approach, something like:
// translations.json
{
"subject1.key1": "value1",
"subject1.key2": "value2",
"subject2.key3": "value3",
"subject2.key4": "value4",
}
Thanks
Level 102
1 like
Please or to participate in this conversation.