Language Code for Content Language Ignored?

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
SloanThrasher
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Mon Jul 19, 2010 10:06 pm

Language Code for Content Language Ignored?

Post by SloanThrasher » Mon Mar 12, 2018 6:41 am

Hi All,

I have a site setup for multiple languages, and for installed languages it works correctly. I have no need for the languages on the backend/admin, just for content on the front-end. So I added a Content Language for Spanish Castellano. There is no "official" language pack for this language.

For all of the other languages, the site detects (via url) the language, and then uses the proper menu/articles/modules/etc. For this content language, it ignores the language code in the url and returns "Category Not Found".

For example, the following urls work correctly:
  • http://mysite.com/en-gb/home-en-gb
    http://mysite.com/fr-fr/home-fr-fr
But if I use the code for the Content Language (es-cn), it keeps the current language code. From a French page, if I enter:

http://mysite.com/es-cn/home-es-cn

It displays:

http://mysite.com/fr-fr/es-cn/home-es-cn

Any ideas on how to get Joomla 3.8.x to respect/understand the sef language code for a Content Language?

Thanks!

Sloan

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30926
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: Language Code for Content Language Ignored?

Post by Per Yngve Berg » Mon Mar 12, 2018 1:41 pm

Mod. Note: Relocated the topic to the Language forum

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

Re: Language Code for Content Language Ignored?

Post by infograf768 » Thu Mar 15, 2018 10:07 am

A content language without a language pack will NOT work in frontend

1. Install the Spanish pack es-ES as it is de facto Castillano.
2. EDit the content language if you really need to. Modify (if you like) the URL Language code and the Image (you may add a new image)
3. Do NOT modify the Language Tag: it shall remain as es-ES
4. Do as you usually do to create your home page in Spanish, etc.
5. If you do not like your frontend pages to use es-es as language in the head, use the System Language Code plugin to modify that tag.

Be aware though that there is NO ISO country code for Castilla (CL is for Chile and not for Castilla y Leon). No idea where you took es-cn from as cn is for China... I doubt google bots would understand this correctly.

I see no reason for you not to use es-ES
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

SloanThrasher
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Mon Jul 19, 2010 10:06 pm

Re: Language Code for Content Language Ignored?

Post by SloanThrasher » Thu Mar 15, 2018 6:26 pm

Jean-Marie,

Thanks for the info. For Castilla, I'll be sure to take your advise. We were told by a translator that it wasn't the same as "Spanish", ie es-ES.

We do have other languages that aren't found in the Joomla Languages such as Tagalog. I did find an ISO code for it. Should I make a copy of another language pack, edit the filenames and content (at least where the lang code is used), and then install it? We don't need or care about the language strings in the language pack as they will never be used on the site. We just need the site to recognize the language code in the url and display the related pages.

Out of curiosity, if a "Content Language"'s code isn't recognized, and used to determine which pages/menu items/etc. to display, what is the purpose of them?

Thanks again for the info!

Sloan

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

Re: Language Code for Content Language Ignored?

Post by infograf768 » Fri Mar 16, 2018 9:20 am

Tagalog language (tl-PH) is indeed not proposed yet as accredited language.

In the mean time, one can indeed create an untranslated tagalog language pack based on en-GB for example. Here is one I did in a few minutes using com_localise
tl-PH_joomla_lang_full_3.8.6v1.zip
Drop this image in /media/mod_languages/images/
tl_ph.gif


and choose it in Content Languages after installing the language pack (normally should already be chosen)

Concerning Content Languages:
1. One can create a full set of items tagged to a new content language (with the correct ISO code, for Tagalog it is tl-PH), even before installing its language pack.
2. It serves to define an image/flag and the URL language code (fr for French, en for English, etc.)
3. One can also define its native title, specific metadata, custom site name.
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

SloanThrasher
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Mon Jul 19, 2010 10:06 pm

Re: Language Code for Content Language Ignored?

Post by SloanThrasher » Fri Mar 16, 2018 1:24 pm

Jean-Marie,

Thank you so much for the info. You've been very helpful and cleared up some questions I've had. I really appreciate the info about com_localize, I'll be sure to check that out.

Sloan

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

Re: Language Code for Content Language Ignored?

Post by infograf768 » Fri Mar 16, 2018 2:20 pm

You can find the component here
https://github.com/joomla-projects/com_ ... e/releases

For any new language you need, just first create the site and admin xml. When saved, you will have the possibility to copy the reference language to the new language.
Then Create a package.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

ajayprabhakar
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sat May 12, 2018 11:15 am

Re: Language Code for Content Language Ignored?

Post by ajayprabhakar » Sat May 12, 2018 5:18 pm

I have installed com_localize. Do I need to create core package or extension package.
Can you please help with the steps to create a new language xx_YY (using en-GB as reference)


Locked

Return to “Language - Joomla! 3.x”