Advertisement

Flag plus name of language?

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
maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 489
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Flag plus name of language?

Post by maestroc » Mon Mar 31, 2014 3:13 am

Is there a way to make the Language Chooser module display both the flag and the text of the language? Seems the options in the controls prohibit showing both...

-MaestroC

Advertisement
Harout1981
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Mar 31, 2014 9:02 am

Re: Flag plus name of language?

Post by Harout1981 » Mon Mar 31, 2014 10:01 am

Are u using Joomfish?

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

Re: Flag plus name of language?

Post by infograf768 » Mon Mar 31, 2014 10:54 am

maestroc wrote:Is there a way to make the Language Chooser module display both the flag and the text of the language? Seems the options in the controls prohibit showing both...

-MaestroC
You would have to use an override for the mod_languages layout.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 489
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Flag plus name of language?

Post by maestroc » Mon Mar 31, 2014 6:04 pm

Harout1981 wrote:Are u using Joomfish?
It was originally a J1.0 site using Joomfish and it had the text and flags there. Now I have manually moved everything over to J3.2.3 using the built in language capabilities but wanted to keep the flag+language text.

Harout1981
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Mon Mar 31, 2014 9:02 am

Re: Flag plus name of language?

Post by Harout1981 » Tue Apr 01, 2014 12:54 pm

I would suggest you continue using joomfish if you are used to it since the built in joomla language follows a bit different interface. I don't know about you but I have designed and maintained several websites and Joomfish is one of the most effective part of the process. Thanks

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 489
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Flag plus name of language?

Post by maestroc » Tue Apr 01, 2014 5:16 pm

If I could have used it I would have done so as this whole migration has been a pain. The problem for me was getting from Joomla 1.0 all the way to 3.2.3. I couldn't find the files I needed to migrate to 1.5 and then up to 3.2.3. I decided at the time it would be better just to recreate the site in 3.2.3 by hand.

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 489
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Flag plus name of language?

Post by maestroc » Tue Apr 01, 2014 5:17 pm

infograf768 wrote:
maestroc wrote:Is there a way to make the Language Chooser module display both the flag and the text of the language? Seems the options in the controls prohibit showing both...

-MaestroC
You would have to use an override for the mod_languages layout.
Any idea what an override might look like to do that? Flag + language name ?

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

Re: Flag plus name of language?

Post by infograf768 » Wed Apr 02, 2014 7:53 am

Copy the file
ROOT/modules/mod_languages/tmpl/default.php

Place it in your template after creating the enclosing folders:

name_of_your_template/html/mod_languages/default.php

Edit the file with a text editor or using back-end "Template Manager: Customise Template"

Supposing you have chosen display Flags as parameter in the module, change

Code: Select all

<?php if ($params->get('image', 1)):?>
				<?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', $language->title_native, array('title' => $language->title_native), true);?>
			<?php else : ?>
for example to

Code: Select all

<?php if ($params->get('image', 1)):?>
				<?php echo JHtml::_('image', 'mod_languages/' . $language->image . '.gif', $language->title_native, array('title' => $language->title_native), true);?>
				<?php echo $language->title_native . '<br>'; ?>
			<?php else : ?>
Will display
flgasandnames.png
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

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 489
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Flag plus name of language?

Post by maestroc » Thu Apr 03, 2014 12:54 am

Thank you so much for the help. That worked great! I pasted it in and it worked right away.

One last little customization though... On your example it does not show the abbreviations except for on (UK). On my system it is not like that. It is showing the abbreviation for all of the languages.

How do I remove the (UK) or (RU) from the end of the name of the languages? I am assuming it is in the $language->title_native part but is there a form of this that will just show the name of the language and not the abbreviation?

I thought I could turn them off in the settings for the module but turning off Languages Full Names still makes the abbreviation display next to the name. My settings now are:

Dropdown- No
Flags - Yes
Horizontal - Yes
Active Language- Yes
Language Full Names- No

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

Re: Flag plus name of language?

Post by infograf768 » Thu Apr 03, 2014 9:09 am

Please attach a screenshot of the language switcher as it appears on your site.

The code above will display the NATIVE title as defined in the Content Languages.
It is easy to change these as you wish
See administrator/index.php?option=com_languages&view=languages
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

maestroc
Joomla! Explorer
Joomla! Explorer
Posts: 489
Joined: Sun Dec 04, 2005 7:27 pm
Contact:

Re: Flag plus name of language?

Post by maestroc » Thu Apr 03, 2014 10:41 pm

infograf768 wrote:Please attach a screenshot of the language switcher as it appears on your site.
This was how it looked before I figured out what you were saying. I went in and changed the Native Title on each language to remove the (XX) and now it looks perfect. Thank you!
Image
screengrab

Advertisement

Locked

Return to “Language - Joomla! 3.x”