Hi everyone!
I want some guidance in building a site with internationalization, i’ve done a couple of sites, but never had to deal with it. Also I will be dealing with currencies and that for the moment is my first objective.
I will be using Yii so I will explain it using if possible, where I want to use it. I’m a beginner at Yii and PHP, but I will give it a try.
Can someone tell me it the way I want to deal with it is right.
-
First get the user language and locale (Using CHttpRequest::preferredLanguage)
-
Get all definitions for currency, dates and number format (CLocale instance)
-
Show the prices for products on the currency of the visitors country if available. As I think, I cannot get the currency that each country uses, from the I18N files, I will have a database table with columns for country, language code, and currency code, so when I get the language I can get the currency code, if not available, it will use a default currency.
-
Then I have another table with the exchange rates and will show the prices with the calculations made.
Anyone have any thoughts on this??? Do you think this is a good approach?
Thanks for the help.