-
Notifications
You must be signed in to change notification settings - Fork 55
Support for array translations #324
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Nice PR! 🚀 It is also interesting to apply it to the locale that I passed to the Example: __('validation.attributes.question', locale: 'pt-BR') Check the |
…nto Fox-for-array-translations-#18
…nto Fox-for-array-translations-#18
…nto Fox-for-array-translations-#18
@rmartinoscar for me, this works: ![]() ![]() Something like this, doesn't work: ![]() I'm afraid that feature would be impossible with the current parser. |
Yes cause you have return [
'requirements' => [
'sections' => [
'0' => [
'title' => 'PHP version',
],
'1' => [
'title' => 'PHP extensions',
],
]
]
];; and i have which works but the extension doesn't like it return [
'requirements' => [
'sections' => [
[
'title' => 'PHP version',
],
[
'title' => 'PHP extensions',
],
]
]
];; |
@joetannenbaum Would love to see that merged :) |
Fixes #300, #428
This PR adds support for array translations for example:
resources/lang/en/validation.php:
Currently, the code:
shows:
Translation [validation.attributes.question] not found.Laravel Extension(translation)
but this key exists, it's only an array with nested elements.
This PR adds support for such keys for hovering and linking to the first element in the array. However, the value is not shown in the hover, because it's an array.
This code needs futher refactoring and testing.