Register blade - theme-coreuiv2 #651
-
I've seen that theme-coreuiv2 register.blade.php extend plain.blade.php and the first his line is:
I'd like to add a language selector in this register and also login.blade.php Some help ? :) Maybe it's also a good idea to have it default in backpack.. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hey @blondie63 , To be 100% certain of the scope here... the purpose of a language selector in the Register screen would be to... store in the database that a certain user prefers a certain language, correct? Then when that user is logged in, to switch the language of the interface from EN to FR for example, correct? In that case, the steps would be to:
Hope it helps. PS. Seems to me like you're using Backpack outside its primary scope, as an admin panel. You use it as a user interface. While that is perfectly fine, it's not how 90% of all devs use Backpack. Since most admin panels have one/two admins and all of them use one language, I don't thinks this makes the cut as an official feature. I would agree to having an external component... a language picker... that you could include as an add-on. I'll talk to the team to maybe do that, but that might take us some time, so please roll your own solution. |
Beta Was this translation helpful? Give feedback.
-
In the past (Laravel 8) I have added a Localization middleware in the The middleware itself is pretty simple (I am writing just a simple piece of it):
Then you can decide how/when the user can change the locale. Of course, if you prefer, you could also store the locale in the current session and preset it from there. |
Beta Was this translation helpful? Give feedback.
In the past (Laravel 8) I have added a Localization middleware in the
Kernel.php
- in the web$middlewareGroups
.The middleware itself is pretty simple (I am writing just a simple piece of it):
Then you can decide how/when the user can change the locale.
Of course, if you prefer, you could also store the locale in the current session and preset it from there.