How to use default language code's instead of region bound?

General questions regarding the use of languages in Joomla! 3.x.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Locked
gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

How to use default language code's instead of region bound?

Post by gijs007 » Tue Jul 14, 2015 3:16 am

I've noticed that by default the English language in Joomla tags my content with a en-GB tag.

The audience of my website is English users from around the world, so I can't really use the "en-GB" or "en-US" language tag because they specify a region.

I've been looking around for people with the same problem and also came across the following tool: http://www.internationalseomap.com/href ... generator/
When I choose to leave the region to default and specify the language to English it generates a "en" language tag.

When I try to set this in Joomla I get the following error:
Error

Save failed with the following error:
The Language Tag should contain 2 or 3 lowercase letters corresponding to the ISO language, a dash and 2 uppercase letters corresponding to the ISO country code.
This should be the exact prefix used for the language installed or to be installed. Example: en-GB, srp-ME.
I have the same problem with other language tags, e.g. Dutch, which is mainly used in The Netherlands and Belgium. And French which is used in France and Canada, as well as other places in Europe and Africa.

I could target each region, but this would create a huge list of choices on the language selector tool, and it would require more maintenance work since I need to have a copy of article's for each region.

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 28202
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: How to use default language code's instead of region bou

Post by imanickam » Tue Jul 14, 2015 3:59 am

The error you are noticing is generated when you define a Content Language. Do not change anything here. Provide the full language code (e.g., en-GB).
gijs007 wrote:When I choose to leave the region to default and specify the language to English it generates a "en" language tag.
You can do this Joomla! by the following steps.
  • Go to the Plugin Manager
  • Enable the plugin "System - Language Code"
  • Open the plugin "System - Language Code" for Edit
  • You could notice a tab titled "Language Codes" and click on the tab
  • For each of the language shown (e.g., en-GB), type only the language code (e.g., en) without specifying the region/country code (e.g., GB)
  • Save the Plugin
Now you would notice that in the tag <link ... />, hreflang defined would refer the language without the region/country code.
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Tue Jul 14, 2015 9:04 pm

It seems that the Canonical Tag / hreflang Tags ignore this setting and use the settings from the language pack.

e.g. when I check my site with http://seorch.eu/ it reports links to the different versions of my website:
Language attribute: fr-fr, URL: https://www.elitegameservers.net/fr/
Language attribute: nl-nl, URL: https://www.elitegameservers.net/nl/
Language attribute: en-gb, URL: https://www.elitegameservers.net/

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 28202
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: How to use default language code's instead of region bou

Post by imanickam » Wed Jul 15, 2015 2:55 am

Are you using the core features of Joomla! to build this multilingual site or are you using any other extension for building this multilingual site?
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Wed Jul 15, 2015 3:02 am

I'm using the core features.

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 28202
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: How to use default language code's instead of region bou

Post by imanickam » Wed Jul 15, 2015 3:11 am

Please post a copy of the screenshots of the link/tab Content Languages (from the Language Manager) and the tab "Language Codes" (from the plugin "System - Language Code")
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Wed Jul 15, 2015 1:56 pm

Please see the attachments.
You do not have the required permissions to view the files attached to this post.

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: How to use default language code's instead of region bou

Post by infograf768 » Thu Jul 16, 2015 6:04 am

If you parameter the language filter plugin to display alternate meta tags and have changed the language code as you did above via the language code plugin, you will get something like this (I have changed en-GB to "en" in the language code plugin and left the other languages alone)
<link href="http://localhost:8888/testwindows/trunkgitnew/index.php" rel="alternate" hreflang="en" />
<link href="http://localhost:8888/testwindows/trunk ... ex.php/fr/" rel="alternate" hreflang="fr-FR" />
<link href="http://localhost:8888/testwindows/trunk ... ex.php/de/" rel="alternate" hreflang="de-DE" />
<link href="http://localhost:8888/testwindows/trunk ... ex.php/it/" rel="alternate" hreflang="it-IT" />
<link href="http://localhost:8888/testwindows/trunk ... ex.php/es/" rel="alternate" hreflang="es-ES" />
<link href="http://localhost:8888/testwindows/trunk ... ex.php/mk/" rel="alternate" hreflang="mk-MK" />
<link href="http://localhost:8888/testwindows/trunk ... ex.php/ta/" rel="alternate" hreflang="ta-IN" /
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Thu Jul 16, 2015 7:26 pm

"If you parameter the language filter plugin to display alternate metadata"
How do I do this? ;)

My settings are in the attachment.
You do not have the required permissions to view the files attached to this post.

User avatar
imanickam
Joomla! Master
Joomla! Master
Posts: 28202
Joined: Wed Aug 13, 2008 2:57 am
Location: Chennai, India

Re: How to use default language code's instead of region bou

Post by imanickam » Fri Jul 17, 2015 2:28 am

The alternate meta tags are available in the Content Language (of the Language Manager).

Are you using any third party SEO extension?
Ilagnayeru (MIG) Manickam | இளஞாயிறு மாணிக்கம்
Joomla! - Global Moderators Team | Joomla! Core - Tamil (தமிழ்) Translation Team Coordinator
Former Joomla! Translations Coordination Team Lead
Eegan - Support the poor and underprivileged

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: How to use default language code's instead of region bou

Post by infograf768 » Fri Jul 17, 2015 6:00 am

@gijs007
Your settings are fine. Please paste here the source of a page which has associated items.
@imanickam
I corrected above.
I was not speaking of metadata (Keywords and Description) which are indeed set in the content language concerned), but alternate meta tags which are set in the languagefilter.plugin
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Fri Jul 17, 2015 3:56 pm

Code: Select all

<link href="https://www.elitegameservers.net/fr/" rel="alternate" hreflang="fr-FR"><link href="https://www.elitegameservers.net/nl/" rel="alternate" hreflang="nl-NL"><link href="https://www.elitegameservers.net/" rel="alternate" hreflang="en-GB"><link href="https://www.elitegameservers.net/templates/rt_oculus/favicon.ico" rel="shortcut icon" type="image/vnd.microsoft.icon"><link rel="stylesheet" href="Affordable%20Game%20Server%20Hosting%20in%20the%20EU%20and%20USA%20-%20Elite%20Game%20Servers.net_bestanden/settings.css"
That's the relevant part of the code, perhaps it's caused by SH404sef, although I doubt it because I previously had an issue with the language tags which was fixed in 3.4.2 update. (https://github.com/joomla/joomla-cms/issues/6809) without changing SH404sef, so I assume this part of the plugins is parsed directly.

If you need the full code simply download the mainpage of http://www.elitegameservers.net with your browser ;) (it's too big to paste here)

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: How to use default language code's instead of region bou

Post by infograf768 » Sat Jul 18, 2015 6:36 am

I see

Code: Select all

<link hreflang="fr-FR" rel="alternate" href="https://www.elitegameservers.net/fr/game-servers">
<link hreflang="nl-NL" rel="alternate" href="https://www.elitegameservers.net/nl/game-servers">
<link hreflang="en-GB" rel="alternate" href="https://www.elitegameservers.net/game-servers">
Which is perfectly OK for a default site language en-GB
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Sun Jul 19, 2015 2:59 am

infograf768 wrote:I see

Code: Select all

<link hreflang="fr-FR" rel="alternate" href="https://www.elitegameservers.net/fr/game-servers">
<link hreflang="nl-NL" rel="alternate" href="https://www.elitegameservers.net/nl/game-servers">
<link hreflang="en-GB" rel="alternate" href="https://www.elitegameservers.net/game-servers">
Which is perfectly OK for a default site language en-GB
Are you saying it's not really a problem to have a region code in the country language tag?

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: How to use default language code's instead of region bou

Post by infograf768 » Sun Jul 19, 2015 6:30 am

As explained above, you can change the hreflang if desired to anything convenient for you in the languagecode plugin, i.e. get:

Code: Select all

<link href="http://mysite.com/index.php/" rel="alternate" hreflang="en" />
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Sun Jul 19, 2015 5:56 pm

infograf768 wrote:As explained above, you can change the hreflang if desired to anything convenient for you in the languagecode plugin, i.e. get:

Code: Select all

<link href="http://mysite.com/index.php/" rel="alternate" hreflang="en" />
But I've set it in the language code plugin to show as en, fr and nl. yet the tags from the language pack are used ???

See my (previous) screenshot Image

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: How to use default language code's instead of region bou

Post by infograf768 » Mon Jul 20, 2015 6:26 am

Is the plugin enabled?
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Mon Jul 20, 2015 11:09 am

Of course :)

User avatar
infograf768
Joomla! Master
Joomla! Master
Posts: 19133
Joined: Fri Aug 12, 2005 3:47 pm
Location: **Translation Matters**

Re: How to use default language code's instead of region bou

Post by infograf768 » Tue Jul 21, 2015 8:29 am

Then there is an issue on your site that I can't solve through the forum. It may be due to the orders of the system plugins, to a 3rd party extension or to your template.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

gijs007
Joomla! Intern
Joomla! Intern
Posts: 88
Joined: Sat Oct 30, 2010 1:43 pm

Re: How to use default language code's instead of region bou

Post by gijs007 » Mon Aug 03, 2015 12:20 am

Yes, changing the order of the plugin to be just after the System - Language Filter plugin has solved this.
So it's not a bug after all :)

Thank you for your help imanickam and infograf768 :)


Locked

Return to “Language - Joomla! 3.x”