SebastianP Posted August 29, 2017 Posted August 29, 2017 Hi there, I've build a website with a language switch. If the user is logged in in the same browser, the website displays also an "edit"-button, whitch opens the page in the backend - thats why I cannot 2 different browsers for viewing/editing. So far, so good:-) But if I change the language in the frontend ($user->language = ...), the language in the backend is also changed - that's not so good, because not all pages are translated and have titles in the other language. Is there a way to force the backend language to the logged in users default language? Or can I set the language of the frontend without change the users language? Thank you in advance, regards Sebastian
LostKobrakai Posted August 29, 2017 Posted August 29, 2017 You could build some custom logic into templates/admin.php to switch the language to something else temporarily. But by default switching languages for users does use one and the same field to store that switch. So you'd probably need to add another field to the user to store something like a "backend_language". 2
SebastianP Posted August 29, 2017 Author Posted August 29, 2017 Thank you very much for the idea - a simple "wire("user")->language = wire("languages")->get("name=default");" on the top of the admin template does the job (in this case all admin users use the default language, so a separate field is not necessary) Regards Sebastian 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now