Language Switcher - includes default language code

More
4 years 4 months ago #79122 by iamrobert
Hi,

Why does the default language include "/en/" when I switch languages?

www.2020.taichungdesigner.com/en/about
www.2020.taichungdesigner.com/about

In my System - Language Filter - I have removed URL Language Code:

i.imgur.com/uE9Jo0Q.png


But, when clicking on the language switcher:

/en/about - it includes /en/ in the title.

I'm looking at this Joomla site - and it doesn't seem to include it when switching languages:

joomlaseo.com/joomla-seo-basics

Is there something I missed?

Thanks

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago - 4 years 4 months ago #79123 by ggppdk
Hello

The removal of language code is done by JRoute not by the component router
(according to the Joomla language filter plugin)

If you are currently viewing default language then the language switcher will show URLs without the code
If you are currently viewing any non-default language then the language switcher will show URLs with the code

Here is an example of Joomla category view in non-default language you can see that language code for default language is included
(currently default language for this website is Greek)

After you click the URL.
The website should redirect to same URL without the language code


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...
Attachments:
Last edit: 4 years 4 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
4 years 4 months ago - 4 years 4 months ago #79124 by iamrobert
Hi ggppdk,

Thanks for taking the time to explain it. It helped solve my issue as the page wasn't redirecting from /en/ to /.

My Joomla! Template was causing the issue. I’m using PJAX via barba.js ( barba.js.org/v1/ ). So – the header info sent to redirect the page was not being picked up by barba.js.

Disabling barba.js on language switch by adding class “no-barba” to the links seems to solve the issue.

Cheers,

Robert
Last edit: 4 years 4 months ago by iamrobert.

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.485 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline