-
Notifications
You must be signed in to change notification settings - Fork 3
Add artisan test, Laravel 9 compat for Collection::dot() #7
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
| ->dot() | ||
| ->keys() | ||
|
|
||
| $data = Collection::make($this->translator->get('*')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you let me know what this part does?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. $this->translator->get('*') loads the global (non-namespaced) translations in lang/{$baseLocale}.json.
I wonder if it might be better to use the found translations via scanning to build a list of groups/namespaces to load, that would support non-standard loaders.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't the point of the lang/{lang}.json, that the key is already in the base language?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I don't think there's anything technically preventing you from using a json file for the base locale, but it doesn't seem like it is very common.
Contains:
lang/*.jsoninfindInArraylang/*.jsonexists infindInArrayArr::dot()instead ofCollection::dot()for Laravel 9 compatibilityLet me know if that all makes sense, I will test it a bit more on my codebase soon hopefully.
The commits should make sense individually, so could use the macro instead if that's preferable.
Closes #5