Jump to content

Problem with the default language of the "guest" user


A.Schmidt
 Share

Recommended Posts

Hello, I have a problem with the default language of the "guest" user. After changing it from "default" to any another language and open the "Home" page (I filled out its fields in 2 languages), the page is still shown in default language. Neither the translated version is shown nor a redirect to the localized version happens.

When I set names for each language's version of the Home page and open for example "http://localhost:8888/de" the correct localized version is shown.

What am I  doing wrong?

Link to comment
Share on other sites

Yes, I checked it in incognito mode.

Here is what I did:

  • Blank install. I also tried the "site-languages" installation template, same problem here
  • Modules "Languages Support", "Languages Support - Fields", "Languages Support - Page Names" and "Languages Support - Tabs" installed (in correct order)Language Modules.jpg
  • Added new language named "de" in "Setup" / "Languages"Languages.jpg
  • Changed type of field "title" to "PageTitleLanguage"Field title.jpg
  • Edited page "Home" and entered "Startseite" in new language tabHome - de.jpg
  • Edited PHP Template "basic-page.php" to prove that user is guestbasic-page.jpg

 

Now I open the procject's admin area a new incognito browser session. After login, Home page looks like that:Home - logged in.jpg

 

After logout and a browser restart, I open the homepage in a incognito window again:Home - guest access.jpg

That's ok, because guest still having default language set. Now I change the default language of the "guest" user in the backend:Guest.jpg

 

Logout, browser restart... Then I load the Home page again and it's still english (default):Home - guest access.jpg

 

To be sure that the german version works, I enter a name for the german home page in the Pw backend:Pages - Home - Settings.jpg

 

Now when I open the URL (Logout, Browser restart...) adding "/de" to the URL, the correct version is shown:Home - guest access (de).jpg

 

I do not know what's wrong. My collegue tested a Processwire installation in Windows by XAMPP, I use a Debian 8 Vagrant Box. We also tested older versions of Processwire, we could not get it work in any version :'(

 

Link to comment
Share on other sites

Others with more experience in this field might correct me, but I do not think that Admin -> Access -> Users -> guest -> Language is for changing the default language of the frontend. It is for backend only. Since a guest user cannot access the backend, it is kinda useless in this case. But I might be mistaken. Anyone else?

  • Like 2
Link to comment
Share on other sites

@szabesz is correct. The language option on the User is for the backend access only. 

@A.Schmidt your setup is correct. When the guest user access the homepage using just "/' Processwire will show the default language, in this case, English. Using "/de" will show German. This is how PW works.

And there is no redirect either. If you want to redirect based on browser settings and other stuff, there is a module for that . But I don't recommend it as it a UX flaw in most cases, so you have to be careful.

  • Like 3
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...