-
Notifications
You must be signed in to change notification settings - Fork 34
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
Localization does not work in some places #2515
Comments
|
Well, then the docs about this are wrong. There it shows
So when do I have to write my translations into I am using the coderello/laravel-nova-lang package and the generated file get's put into |
I have the same problem. Some standard labels like Search btn or Action btns are translated from my ru.json. |
I have the same problem. |
Follow-up: it seems the JS translations are at the moment read from resources/lang/de.json. When you put something there, that will be used. This seems wrong, though, doesn't it? Because that is where the general Laravel de.json belongs. This seems like a but to me. I will try to find out if I can PR a solution. |
As I am digging deeper ist seems it is the other way around - the JS translations are read correctly, but those wrong translations are NOT generated by Vue files but before in PHP Classes. |
Sorry to those following this issue - the problem was actually happening when I included one of my own composer packages that was also dealing with some Nova stuff. Everything works fine using a vanilla Nova installation. |
@manogi Did you find out why your composer package is causing this issue. I am seeing the same issue and I also have a custom nova composer package but can't think of anything causing this... |
@monaye This is now some time ago, so I'm not sure. I do think one of the problem was that the Vue components did not pick up on the translations from the json files. The thing is that I switched to using php translation files and use them like it is described here in the Laravel docs, because this way seems to work nicely out of the box. |
If anyone still having problem with this please create a new issue instead of an old one as I just tested this today and seem fine. A full reproducing code example such the one under https://github.com/nova-issues would be great to understand the issue on your use case. |
I have same issue. |
I have same issue too. Quick fix: just copy your nova lang file into /resources/lang folder. |
As mentioned above a simple workaround could be to just create a symlink between desired json lang file into
|
You can do this with filesystems.php
|
I have same "issue" :
Translate file path : With the following content: <?php
return [
'Some label'=> 'Translated text',
]; Can be used as follows: // please pay attention to the symbols :: and spaces
Text::make(__('nova::admin.Some label'), 'name') It would be great to add the solutions from this thread to the official Nova documentation. |
Description:
When trying to localize things like the Resource
label()
orsingularLabel()
, by usingreturn __('Users')
, it won't translate. Also in the sidebar: "Resources" and "Dashboard" does not translate... I have a correct de.json in resources/lang/vendor/nova/de.json and I load it via this:app()->getLocale()
returnde
(correct!).The translations for the primary blue buttons like "Create :resource" does work fine!
The text was updated successfully, but these errors were encountered: