Page 1 of 1

Custom Language Switcher Module

Posted: Sun Jul 01, 2012 7:25 am
by rajprince
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.

Re: Custom Language Switcher Module

Posted: Sun Jul 01, 2012 10:33 am
by infograf768
1. Use Joomla 2.5.6
2. Follow tutorial
http://multilingual.demojoomla.com/mult ... 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.

Re: Custom Language Switcher Module

Posted: Mon Jul 02, 2012 7:11 pm
by rajprince
infograf768 wrote:1. Use Joomla 2.5.6
2. Follow tutorial
http://multilingual.demojoomla.com/mult ... 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.

Re: Custom Language Switcher Module

Posted: Tue Jul 03, 2012 8:26 am
by infograf768
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.

Re: Custom Language Switcher Module

Posted: Sat Jul 07, 2012 8:58 am
by sigull
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?

Re: Custom Language Switcher Module

Posted: Sat Jul 07, 2012 9:04 am
by infograf768
yes, and also INSIDE the xmls

Re: Custom Language Switcher Module

Posted: Sat Jul 07, 2012 9:15 am
by sigull
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?

Re: Custom Language Switcher Module

Posted: Sat Jul 07, 2012 10:04 am
by infograf768
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

Re: Custom Language Switcher Module

Posted: Sat Jul 07, 2012 10:12 am
by sigull
Here is the en-NZ zip file I modified from en-AU
en-NZ_joomla_lang_full_2.5.6v1.zip

Re: Custom Language Switcher Module

Posted: Sun Jul 08, 2012 8:07 am
by infograf768
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

Re: Custom Language Switcher Module

Posted: Sun Jul 08, 2012 8:44 am
by boorsekala
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

Re: Custom Language Switcher Module

Posted: Sun Jul 08, 2012 8:56 am
by infograf768
@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

Re: Custom Language Switcher Module

Posted: Sun Jul 08, 2012 9:03 am
by sigull
thank you Jean-Marie, that works perfectly,

all the best

Re: Custom Language Switcher Module

Posted: Sun Jul 26, 2015 9:51 am
by tomish1212
Thank you for the EN-NZ file.. it saved me quite a few minutes ;)