-
I am using this and underlying tags package for managing tags in my application. Application is multilingual. I use locale middleware for detecting /{locale_code} (where English is just plain root) and setting app locale for frontend. The site is being imported from WP. as such I have imported and programatically assigned values to respective places. This results in, say, posts in different locales w/tags respectively. Content appears normally when viewing on frontend. Note that locale middleware uses However, when using Laravel Nova, which, obviously, doesn't use locale middleware, tags are not visible in other than English (default) locale. I imagine this is somewhat designed (by original package) behaviour. But it doesn't make much sense w/Nova, where localization is not necessary. Any ideas? Do you think it is something you could improve? Or perhaps any suggestions for local workaround? Thanks for the good work! |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
I've got an idea! One is to set Laravel locale to entry's locale when retrieving. It can be achieved by registering Nova::serving limits scope to Nova request only, thus avoiding registering at other times. |
Beta Was this translation helpful? Give feedback.
-
@flexchar Could you PR this? |
Beta Was this translation helpful? Give feedback.
-
@freekmurze to be honest, I am not sure how should the issue be solved... My approach is application specific as I have locale field/column on my model's table. While I could imagine this showing all tag translations, it would create more mess than help. |
Beta Was this translation helpful? Give feedback.
-
Having same issue. |
Beta Was this translation helpful? Give feedback.
I've got an idea!
One is to set Laravel locale to entry's locale when retrieving. It can be achieved by registering
retrieved
event listener inboot
method inapp\Providers\NovaServiceProvider.php
.Nova::serving limits scope to Nova request only, thus avoiding registering at other times.