Custom Language Switcher Module
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.
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.
-
- Joomla! Fledgling
- Posts: 3
- Joined: Sun Nov 22, 2009 3:13 am
Custom Language Switcher Module
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:
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.
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:
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.
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Custom Language Switcher Module
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.
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.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Fledgling
- Posts: 3
- Joined: Sun Nov 22, 2009 3:13 am
Re: Custom Language Switcher Module
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.
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Custom Language Switcher Module
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.
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
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 29
- Joined: Tue Mar 15, 2011 7:30 am
Re: Custom Language Switcher Module
Do you mean we have to re-name every .ini file inside the folders too?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.
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Custom Language Switcher Module
yes, and also INSIDE the xmls
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 29
- Joined: Tue Mar 15, 2011 7:30 am
Re: Custom Language Switcher Module
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?
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?
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Custom Language Switcher Module
Attach here the full zip of the en-EI language pack and I will check itCopy 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.
Jean-Marie Simonet / infograf
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 29
- Joined: Tue Mar 15, 2011 7:30 am
Re: Custom Language Switcher Module
Here is the en-NZ zip file I modified from en-AU
You do not have the required permissions to view the files attached to this post.
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Custom Language Switcher Module
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
and NOT
Also, the tag is missing in admin en-NZ.xml
Here is a corrected pack:
I.e. it should be
Code: Select all
abstract class en_NZLocalise {
Code: Select all
abstract class en_AULocalise {
Here is a corrected pack:
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
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 28
- Joined: Mon Jul 02, 2012 7:14 am
- Contact:
Re: Custom Language Switcher Module
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
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
my site: http://www.boorsekala.com
- infograf768
- Joomla! Master
- Posts: 19133
- Joined: Fri Aug 12, 2005 3:47 pm
- Location: **Translation Matters**
Re: Custom Language Switcher Module
@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
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
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
---------------------------------
ex-Joomla Translation Coordination Team • ex-Joomla! Production Working Group
-
- Joomla! Apprentice
- Posts: 29
- Joined: Tue Mar 15, 2011 7:30 am
Re: Custom Language Switcher Module
thank you Jean-Marie, that works perfectly,
all the best
all the best
-
- Joomla! Fledgling
- Posts: 1
- Joined: Sun Jul 26, 2015 9:41 am
Re: Custom Language Switcher Module
Thank you for the EN-NZ file.. it saved me quite a few minutes