Custom Language Switcher Module

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.
rajprince
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 22, 2009 3:13 am

Custom Language Switcher Module

Postby rajprince » Sun Jul 01, 2012 7:25 am

Hi,

I am developing a Multi-Lingual site in Joomla 2.5. Unfortunately JoomFish is not yet released for Joomla 2.5. So i decided to use the native multi-lingual support for 2.5.

Now, i want to have the language switcher like this:

Image

How is language switched in default module.

Can i link to something like, http://site/en for english and http://site/fr for french.

Also i would want the site to remember users selection , can i do it using a cookie?
Also i have to replace the flag with current language, how do i detect it?

Please let me know.

Thanks.

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

Re: Custom Language Switcher Module

Postby infograf768 » Sun Jul 01, 2012 10:33 am

1. Use Joomla 2.5.6
2. Follow tutorial
http://multilingual.demojoomla.com ... steps.html

This means that you need at least a site language per Content language
English en-GB is in core.
English en-US is available
French (fr-FR) is available and grace to the languagecode system plugin you can change the tag to fr-CA

We have no Irish language pack.

In 2.5.6 a cookie is set which remembers last language displayed by the user.

You can change the default flags by creating an override in your template for
ROOT/modules/mod_languages/tmpl/default.php
And use also your own css.

In the language switcher module you can choose names OR flags.
Etc.

I suggest you first test and play with the languagefilter plugin parameters as well as with the langswitcher module parameters, and then ask any supplementary question before doing any override.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

rajprince
Joomla! Fledgling
Joomla! Fledgling
Posts: 3
Joined: Sun Nov 22, 2009 3:13 am

Re: Custom Language Switcher Module

Postby rajprince » Mon Jul 02, 2012 7:11 pm

infograf768 wrote:1. Use Joomla 2.5.6
2. Follow tutorial
http://multilingual.demojoomla.com ... steps.html

This means that you need at least a site language per Content language
English en-GB is in core.
English en-US is available
French (fr-FR) is available and grace to the languagecode system plugin you can change the tag to fr-CA

We have no Irish language pack.

In 2.5.6 a cookie is set which remembers last language displayed by the user.

You can change the default flags by creating an override in your template for
ROOT/modules/mod_languages/tmpl/default.php
And use also your own css.

In the language switcher module you can choose names OR flags.
Etc.

I suggest you first test and play with the languagefilter plugin parameters as well as with the langswitcher module parameters, and then ask any supplementary question before doing any override.



Thanks for your answer.

Now, i want english for all the four countries shown in above image.
That way i want to group countries , so basically the URL Language Code should change not the language.


Also how can i assign a menu item to multiple languages.


Thanks.

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

Re: Custom Language Switcher Module

Postby infograf768 » Tue Jul 03, 2012 8:26 am

You do NEED one site language pack per Content Language. There is no way to go over this in present core.

Therefore as you need 4 English instances and en-GB as well as en-US are available to install, this is what you can do.
Install the en-US pack.
Install the en-AU language packs and change its tag to en-CA for Canada using the language code system plugin.

Copy one of these packs and mass change the tag (name of files, tag inside the xml(s), function en_GBLocalise to en_EILocalise in the localise.php) to en-EI for Ireland.

Zip the same way it was done for the original pack and install.

You will then get 4 instances of English to create your content languages.

Follow the tutorial to create your site. You can create specific menus containing menu items set to ALL language when necessary.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

sigull
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Mar 15, 2011 7:30 am

Re: Custom Language Switcher Module

Postby sigull » Sat Jul 07, 2012 8:58 am

infograf768 wrote:Copy one of these packs and mass change the tag (name of files, tag inside the xml(s), function en_GBLocalise to en_EILocalise in the localise.php) to en-EI for Ireland.


Do you mean we have to re-name every .ini file inside the folders too?

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

Re: Custom Language Switcher Module

Postby infograf768 » Sat Jul 07, 2012 9:04 am

yes, and also INSIDE the xmls
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

sigull
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Mar 15, 2011 7:30 am

Re: Custom Language Switcher Module

Postby sigull » Sat Jul 07, 2012 9:15 am

thats what I thought,
I have renamed all the files in an en-AU language to en-NZ however when I enabled the en-NZ language on the site, the en-NZ site went blank.
Not sure what I missed?

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

Re: Custom Language Switcher Module

Postby infograf768 » Sat Jul 07, 2012 10:04 am

Copy one of these packs and mass change the tag (name of files, tag inside the xml(s), function en_GBLocalise to en_EILocalise in the localise.php) to en-EI for Ireland.


Attach here the full zip of the en-EI language pack and I will check it
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

sigull
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Mar 15, 2011 7:30 am

Re: Custom Language Switcher Module

Postby sigull » Sat Jul 07, 2012 10:12 am

Here is the en-NZ zip file I modified from en-AU

en-NZ_joomla_lang_full_2.5.6v1.zip
You do not have the required permissions to view the files attached to this post.

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

Re: Custom Language Switcher Module

Postby infograf768 » Sun Jul 08, 2012 8:07 am

As I said above, you have to modify, both in admin and site, in the en-NZ.localise.php, the name of the class.
I.e. it should be

Code: Select all

abstract class en_NZLocalise {

and NOT

Code: Select all

abstract class en_AULocalise {

Also, the tag is missing in admin en-NZ.xml

Here is a corrected pack:
en-NZ_joomla_lang_full_2.5.6v1.zip
You do not have the required permissions to view the files attached to this post.
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

boorsekala
Joomla! Apprentice
Joomla! Apprentice
Posts: 28
Joined: Mon Jul 02, 2012 7:14 am
Contact:

Re: Custom Language Switcher Module

Postby boorsekala » Sun Jul 08, 2012 8:44 am

joomla 2.5 dosnt need any language package.
you must install language ini files as en and fr on your extension on admin.
ad make enable and set to default.
then for each language you can make one menu. total menues count= all languages +1
+1 because you can have one default men with one child that it can link to each home page of your languages home.

you can use links in pages by ..test.com/en/ or /fr/
but when visitor coms wit .com default menu read and it can point to home of /en/ or /fr/ and you can set it to target home page of each language.

joomla 2.5 has single language switcher module you can enable it.

with joomla redirect component on admin, you can redirect 301 all other old urls to new urls in sef mode. because in joomla 2,5 we must use parent alias in link.
grandfather/father/child

second way is use htaccess redirect 301 old pages to new sef url. old /aboutus can redirected 301 to /fr/aboutus

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

Re: Custom Language Switcher Module

Postby infograf768 » Sun Jul 08, 2012 8:56 am

@boorsekala

Your comment, apart from being confusing and wrong ("joomla 2.5 does'nt need any language package"), is useless here and out of Topic
Jean-Marie Simonet / infograf · http://www.info-graf.fr
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group

sigull
Joomla! Apprentice
Joomla! Apprentice
Posts: 29
Joined: Tue Mar 15, 2011 7:30 am

Re: Custom Language Switcher Module

Postby sigull » Sun Jul 08, 2012 9:03 am

thank you Jean-Marie, that works perfectly,

all the best

tomish1212
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Sun Jul 26, 2015 9:41 am

Re: Custom Language Switcher Module

Postby tomish1212 » Sun Jul 26, 2015 9:51 am

Thank you for the EN-NZ file.. it saved me quite a few minutes ;)


Return to “Language - Joomla! 2.5”

Who is online

Users browsing this forum: No registered users and 2 guests