开发者

I18N, L10N and database, how to?

I'm going to update/rewrite an existing hard coded websites.

I need to localize it, but the application will serve different contents depending on the country/language.

What would be the best way to work with this?

I though to add a column in my database for each localized created content such "locale = en_GB" or use a different database for each application.

Any feedbacks?


Edit

Let's say an application. Ok.

I want this application to have the same features but in different countries.

The content is provided by a community, so there is no way to translate it, and is not application wide, only available for the application configured to work with the country C.

Country = One Domain Name = Specific Content = Same Features as the others.

I know I could configure each application to use a different database, but I imagine if I need to add a column to add features, I'll have to do it on each countries.

If I add a column to localize content, I'll be able to fetch the localized content whatever the application is by specifying the currently used locale.

I'm going to use Zend_Locale & Zend_Translate/gettext, so I know how to do it in php.

Both 开发者_JAVA技巧solution have their pros & cons but I've not enough experiences in such application to choose the right way.


The locale is rarely part of the database.

The locale is part of the presentation of data in the database.

So each user provides their locale.

Your application uses ordinary localization to translate numbers and dates.

Your application uses ordinary i18n libraries to translate the database text and application messages into localized text.


I'd go with the first approach: mark each different language with a specific column. Easier to manage and more flexible than managing different databases/tables.

On the layouts: you can use PHP's gettext() functions or you can create different templates for each language if you want.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜