Customize Language Switcher Description

General questions regarding the use of languages in Joomla! 2.5.

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.
Locked
cktchan2
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jun 23, 2014 11:02 am

Customize Language Switcher Description

Post by cktchan2 » Mon Jun 23, 2014 12:21 pm

Hi there, greatly appreciate if you can help me to solve the below queries:
I'm running Joomla! 2.5.22.

Question 1:

I have 3 languages on my site on English (UK), Traditional Chinese, Simplified Chinese. And the respective URL Language Code from the Language Manager are: en, zh-HK, zh-CN.

Currently, my website language switcher are displaying; ZH-HK ZH-CN EN at my website, I would like to change the texts of the switcher so that it is different from the URL Language code. Is it possible?

I have created a language module Switcher on all my pages and currently the settings are:

Use Dropdown: NO
Use Image Flags: NO
Horizontal Display: YES
Active Language: YES
Languages Full Names: NO



Question 2:

How can I add something in between the language switcher link: E.g. ZH-HK | ZH-CN | EN


Many thanks for your great helps!!!!

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

Re: Customize Language Switcher Description

Post by infograf768 » Sat Jun 28, 2014 5:43 am

1. Change in Extensions=> Language Manager=>Content Languages the Native Title of the languages.
Enter EN for en-GB, ZH-HK for Traditional Chinese, ZH-CN for Simplified

2. Change the settings in the language switcher module to display FULL NAMES, i.e.
Languages Full Names: YES

3_ to change anything else (i.e. add the |), you will have to create an override in your template.

Create, if it does not exist, an html folder in the template, then a folder called mod_languages. In that folder, add a copy of the default.php file from mod_languages:
https://github.com/joomla/joomla-cms/tr ... uages/tmpl

You will get:
mytemplate/html/mod_languages/default.php
4_ Then edit that file.
You will have to add after line 40

Code: Select all

<?php else : ?>
				<?php echo $params->get('full_name', 1) ? $language->title_native : strtoupper($language->lang_code);?>
			<?php endif; ?>
			</a>
			</li>
		<?php endif;?>
to add for example after the </li>:

Code: Select all

<?php else : ?>
				<?php echo $params->get('full_name', 1) ? $language->title_native : strtoupper($language->lang_code);?>
			<?php endif; ?>
			</a>
			</li>
			<?php echo '|'; ?>
		<?php endif;?>
I also suggest you use the languagecode plugin to change zh-TW to zh-HK when the page renders. This will help search engines.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

cktchan2
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon Jun 23, 2014 11:02 am

Re: Customize Language Switcher Description

Post by cktchan2 » Mon Jun 30, 2014 2:30 pm

Dear Infograf768,

Thats work perfectly! Thanks a lot for your detailed reply!!!

Many thanks.


Locked

Return to “Language - Joomla! 2.5”