Internationalization

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.

  1. First get the user language and locale (Using CHttpRequest::preferredLanguage)

  2. Get all definitions for currency, dates and number format (CLocale instance)

  3. 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.

  4. 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.

Exchange rates are updated daily so isn’t there a better way to retrieve that data from a external site like yahoo money or something?

Yes , I will update a table from a site, the Central European Bank. I’m not gonna get the currencies every request, just a few times a day, depending on the user requests.