Welcome Guest, Not a member yet? Register   Sign In
Full language support
#1

[eluser]adamp1[/eluser]
I know there are libraries out there which can pick a chosen language file depending on the browsers language (I wrote one for myself even). But is there a standard way to combine all language related information.

This may seem vague so I will try to explain.

Language files for CI are normally located in files with their language name 'english', 'french' etc. Browsers give their language like 'en', 'en_US' etc. So of course we will need some table to relate en => english. But what also about other things which are connected with a country, their currency etc.

What I am asking is their a standard way to link all this information? There are so many ISO standards out there which say what a country should be called. What currency they use, their default currency symbol.

Now the reason I want this, I want to implement all of this into a library so an e-commence site can offer not only the pages displayed in different languages but also with their relative currency prices and currency symbols using the given setlocale function of php.

Any ideas? Is there a current table holding lots of this data I can use or will I have to create my own?
#2

[eluser]kylehase[/eluser]
Good suggestion. Might I add that the word you're looking for is locale, not necessarily language. Within a country some locale data such as currency, date formats etc are usually standard but language is often not. Some countries have multiple official languages (Canada) and some languages span several countries (English).
#3

[eluser]Pascal Kriete[/eluser]
I would definitely suggest against using setlocale until the user specifically says he wants it. I personally hate going to a .com page and being redirected (google does this). Also keep in mind that there is more to it than changing the currncy symbol and mulitplying by the exchange rate. Most countries treat sales tax differently. In the US, for example, it's almost never included. In Germany on the other hand, it's always included in the price.

So should think about what countries you wish to support, instead of offering half-baked support for a huge list of them. And then, I'm sure we have a good representation of the world here, who can tell you what they usually see on websites.




Theme © iAndrew 2016 - Forum software by © MyBB