Welcome to the MetaMod and Chameleon Support Forums.

Before posting, please check out the FAQs.

helpme

 

Need extra help with your Joomla site? Consider paid Joomla support by the developer of Chameleon and MetaMod.

 

Change the language depend of the country

Change the language depend of the country

Hello,
I need help because I don't know how to create this rule:

I need when the user enter in the website if it is from Spain display the Spanish language (www.website.com/es/) and is the user is from other country display the USA(english) language (www.website.com/us/).
How is it possible?

Thanks.

luisorozoli
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Change the language depend of the country

Hello again,

I did this function but now the problem that I have is if I'm in the Spanish website (www.website.com/es/) and I click in the flag to change to the other language (www.website.com/us/), always I get the page in spanish, I can not change the language.

Please, how is possible to fix this??

Thanks.

luisorozoli
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Change the language depend of the country

Hi,

Take a look at this blog entry and see if your setup matches one of the scenarios there:

http://www.metamodpro.com/blog/automati … la-25.html

Cheers,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Re: Change the language depend of the country

Hello metamodguy,

Can you help me with that?
Because I tried all scenarios and I can not find the way to do that.

This is exactly what I want:

- If you are in Spain, you will get www.website.com/es/
- If you are in other country, you will get www.website.com/en/
- And when you get www.website.com/es/ OR www.website.com/en/ you have to be able to change (by the flags in the home page) to the other culture/language.

Thanks.

luisorozoli
Beginner Modder
ranks
useravatar
Offline
6 Posts
Administrator has disabled public posting

Re: Change the language depend of the country

Hi,

I think that the general set of rules could go like this:

Rule 1: detect session variable A. If found, finish rule processing. This is a flag to say "we already auto switched once, so don't do it again, just ignore the rest of the rules and allow people to do whatever they want on the site".

Rule 2: (if we got here, then the person has not been auto switched already)
- detect country Spain and language "Exclude these languages: ES". If we get both of those then we know:
a - they are from Spain
b - they arrived on a page other than /es
c - we haven't already redirected them
So in the Actions we do a redirect to the Spanish language. We assume that you have already set up all the menu associations between equivalent pages in the different languages, as the redirection mechanism works in the same way as the language switcher module (which works that way).
Secondly, in the action you also tell it to "set session variable A". This means that for the next page the guest views, the rules will stop at rule 1.

Rule 3: detect country "exclude these countries: ES", and language ES. (i.e. they are outside of Spain but ended up on a Spanish page)
If found, redirect to English language, and set the session variable A.

Just a note on the language detection: in the Config tab of the Chameleon rules 2 and 3 you need to set "$language handling" to "Joomla front-end language".

Hope that helps,
Stephen

Stephen Brandon
MetaMod / Chameleon developer
If you use MetaMod or Chameleon, please post a rating and a review at the Joomla! Extensions Directory: Chameleon | MetaMod

metamodguy
useravatar
Offline
3329 Posts
User info in posts
Administrator has disabled public posting

Board Info

Board Stats:
 
Total Topics:
1686
Total Polls:
6
Total Posts:
5940
Total Posts Today:
1
User Info:
 
Total Users:
5198
Newest User:
Paramountdental
Members Online:
0
Guests Online:
115

Online: 
There are no members online

Forum Legend:

 Topic
 New
 Locked
 Sticky
 Active
 New/Active
 New/Locked
 New Sticky
 Locked/Active
 Active/Sticky
 Sticky/Locked
 Sticky/Active/Locked