Can't switch to default language using language switcher – causes redirect
-
Support,
I have looked everywhere online for months and can’t seem to figure it out.
I’m using qTranslate X 3.4.2 and WordPress 4.2.2.*For privacy reasons, I’m unable to provide you with a link to the current development site.
THE PROBLEM
Switching to the default language (en) using the language switcher causes the current page (second language, ja) to be refreshed – It doesn’t go to the default language page.Switching to the second language from the default language works fine (www.mysite.com, select Japanese from the language switcher, and https://www.mysite.com/ja/ is loaded).
Now on the second language (www.mysite.com/ja/), selecting English from the drop down does not go back to the English version (www.mysite.com); the current page just refreshes. I also noticed that the url for the English link in the language switcher has the ‘en’ prefix – this shouldn’t be there if ‘pre-path’ and ‘hide default url’ are selected, right?
If I uncheck ‘hide default url’, everything works fine – switching back and forth using the language switcher works as it should. However, the default language shows the prefix, which I don’t want.
WHAT I WANT
I want to hide the language prefix of the default language (en) and be able to switch to the default non-prefixed language version from the second language.Like this:
// Select Japanese from default en homepage
https://www.mysite.com -> https://www.mysite.com/ja/then, from:
// Select English to return to the default homepage (no en prefix)
https://www.mysite.com/ja/ -> https://www.mysite.comCurrent Settings
- Fresh WordPress install
- Fresh qTranslate X install
- English default language
- Only Japanese enabled
- SELECTED – “Use Pre-Path Mode (Default, puts /en/ in front of URL). SEO friendly.”
- CHECKED – “Hide URL language information for default language.”
- CHECKED – “Show displayed language prefix when content is not available for the selected language. “
- CHECKED – “Detect the language of the browser and redirect accordingly.”
- UNCHECKED – “Disable language client cookie “qtrans_front_language” (not recommended).”
- All other options are DEFAULT
Recreating the Problem
Use any fresh install of qTranslate X and one other language, such as Japanese. Apply the settings above.- Go to the default non-prefixed homepage: ex, https://www.mysite.com
- Select the second language from the language switcher
- User is taken to the second language version of the page: ex, https://www.mysite.com/ja/
- From the second language version of the page, select the default language
- User is NOT taken to the default language of the page (www.mysite.com). The current second language page (ex, https://www.mysite.com/ja/) is refreshed. The destination url on the language switcher for the default language is also prefixed ‘www.mysite.com/en/’.
Any help in this matter would be GREATLY appreciated – this has been driving me insane for months.
Thank you,
Jacob
- The topic ‘Can't switch to default language using language switcher – causes redirect’ is closed to new replies.