Language flags not showing

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

Moderators: infograf768, 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.
Post Reply
a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Language flags not showing

Post by a0394 » Mon Jun 29, 2020 8:39 am

Hi, i have both the language switcher plugin and module set to enabled, yet the language switcher flags don't appear in my top menu.
My website url:
https://verticalife.it/it

We used to have the flags enabled then a colleague disabled them, so i doubt it has to do with menu items and such, because we do have multiple languages installed and a default page for each one. I'll pm user data if requested for help.
Looking forward to your reply, best regards

 
User avatar
mjparadac
Joomla! Hero
Joomla! Hero
Posts: 2083
Joined: Mon Oct 29, 2012 3:58 pm

Re: Language flags not showing

Post by mjparadac » Mon Jun 29, 2020 2:54 pm

Hello a0394

Are you using an extension to display the flags?

Regards,
Joomla Community Ambassador for A2 Hosting | A2 Hosting - Our speed, your success | https://www.a2hosting.com/joomla-hosting

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

Re: Language flags not showing

Post by infograf768 » Tue Jun 30, 2020 9:31 am

Are you sure the language switcher module is enabled and set to an existing position in your template?
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Re: Language flags not showing

Post by a0394 » Tue Jun 30, 2020 12:00 pm

Hi, thanks for your replies! In the meantime i fidgeted some and finally made it.
Now i have another big question: we have 3 languages installed on our website, it-it, en-gb and en-us. However, the en-us language is being used for the USA branch of our brand, which has a different template and other changes. Is it possible to show only two of the languages' flags (it-it and en-gb)?
Looking forward to your reply, have a nice day!

a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Re: Language flags not showing

Post by a0394 » Thu Jul 02, 2020 8:49 am

remove if not proper, but "up" lol

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

Re: Language flags not showing

Post by infograf768 » Fri Jul 03, 2020 6:22 am

In the meantime i fidgeted some and finally made it.
Still can't find any switcher on your site.
Is it possible to show only two of the languages' flags (it-it and en-gb)?
You mean you do not want people to be able to switch to en-us?
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Re: Language flags not showing

Post by a0394 » Fri Jul 03, 2020 12:49 pm

I've enabled it only on this test page i'm working on:
https://verticalife.it/it/contatti-new
what i want to achieve is showing only the it-it and en-gb switches, thus hiding the en-us (which leads to our USA branch, which uses a different template)

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

Re: Language flags not showing

Post by infograf768 » Sat Jul 04, 2020 7:23 am

That is easy.
Create an override for mod_languages and add $language->lang_code !== 'en-US' in the conditional.

In your case, as you use the list type I guess it would be line 75

Code: Select all

<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>
or, if you display the active language line 89

Code: Select all

<?php elseif ($params->get('show_active', 1) && $language->lang_code !== 'en-US') : ?>
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Re: Language flags not showing

Post by a0394 » Sat Jul 04, 2020 10:09 am

Hi infograf768, thanks for your reply!
However, i'm not sure i got what you mean lol
Do you mean this: templates/MYTEMPLATE/html/mod_languages/default.php ?
And if there's no such line with that content, do i have to add it?

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

Re: Language flags not showing

Post by infograf768 » Sun Jul 05, 2020 7:25 am

Code: Select all

Do you mean this: templates/MYTEMPLATE/html/mod_languages/default.php ?
Yes.

Code: Select all

And if there's no such line with that content, do i have to add it?
default.php in your template should be a copy of the core file.

Look at the lines I indicated and modify as suggested.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Re: Language flags not showing

Post by a0394 » Sun Jul 05, 2020 8:06 am

Hi, yes i copied that file from the core to mytemplate/html/mod_languages(had to create the folder as well).
Yet i can't find any line like "<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>" in it...

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

Re: Language flags not showing

Post by infograf768 » Sun Jul 05, 2020 8:12 am

As I explained, you have to ADD the code $language->lang_code !== 'en-US' in the conditional

We have

Code: Select all

<?php if (!$language->active) : ?>
Change to

Code: Select all

<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Re: Language flags not showing

Post by a0394 » Sun Jul 05, 2020 1:23 pm

Ok i have changed line 75 according to your posts with "<?php if (!$language->active && $language->lang_code !== 'en-US') : ?>", but unfortunately the en-US flag is still there: https://verticalife.it/it/contatti-new

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

Re: Language flags not showing

Post by infograf768 » Tue Jul 07, 2020 7:12 am

That is because it may not be that precise setting you use...
It could be the other line (89) as I already said above...

Code: Select all

<?php elseif ($params->get('show_active', 1) && $language->lang_code !== 'en-US') : ?>
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

a0394
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Sat Jun 22, 2019 12:34 pm

Re: Language flags not showing

Post by a0394 » Tue Jul 07, 2020 8:20 am

I also changed line 89 to

Code: Select all

<?php elseif ($params->get('show_active', 1) && $language->lang_code !== 'en-US') : ?>

but to no avail...

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

Re: Language flags not showing

Post by infograf768 » Wed Jul 08, 2020 6:08 am

Can't help anymore without superuser access to your backend.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

 

Post Reply

Return to “Language - Joomla! 3.x”