|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Getting the iso-639-1 Language code from a CountryHi.
I need to change the Locale in my application according to the current user Country (user is logged in and country_id available through the active session). Looking inside globalize's code and after same research I still can't figure out a way to get the iso-639-1 language code from one country. Making an association between Languages and Countries could work, but it's hard and I don't think it's the better solution. Any help will be appreciated. Thanks. -- Daniel Dias |
|
|
RE: Getting the iso-639-1 Language code from a CountryDaniel,
This subject was quite topical last year when I submitted
some patches to Globalize. There is, of course, a big problem in that the
mapping of Country->Language is not 1:1. Think Canada, Switzerland,
China, etc. So there will be no perfect solution. Instead, I believe
that we considered a default language per country that could optionally be
setup in the database.
AFAIK, nothing became of those
discussions.
-Chris
Chris Hapgood
Phone: +1 434 989 8584
Skype: chris.hapgood
Email: cch1@...
From: Daniel Dias [mailto:lupeke@...] Sent: Monday, March 03, 2008 13:59 To: users@... Subject: Getting the iso-639-1 Language code from a Country I need to change the Locale in my application according to the current user Country (user is logged in and country_id available through the active session). Looking inside globalize's code and after same research I still can't figure out a way to get the iso-639-1 language code from one country. Making an association between Languages and Countries could work, but it's hard and I don't think it's the better solution. Any help will be appreciated. Thanks. -- Daniel Dias No virus found in this incoming message. No virus found in this outgoing message. |
|
|
Re: Getting the iso-639-1 Language code from a CountryThanks for the quick reply Chris.
I thought it was possible to dynamically "guess" the user's language but it's not so simple. Having a default_lang per country like you suggest won't work in my case since I do have to handle more than one lang by country. Anyway, I solved the problem adding an extra attribute "native_language" to the User model witch will be filled by the user itself. -- Daniel Dias On Mon, Mar 3, 2008 at 4:55 PM, Chris Hapgood <cch1@...> wrote:
|
| Free embeddable forum powered by Nabble | Forum Help |