I\'m currently working on a project that the client wants to deliver to differen
ID: 651984 • Letter: I
Question
I'm currently working on a project that the client wants to deliver to different countries.
The application is a website.
We started out using resource files to change the text the user sees when visiting pages based on their locations. But this isn't enough.
In the English version of the site we have a page that states "page x of y". In the Chinese version of the site, it's not enough to do " x y"
The syntax for the language doesn't match the placeholders that were created for the English language.
The only other option I can think of is to have a completely separate site, serving different content.
Are there any other options to solve this issue?
Explanation / Answer
For i18n, you've got several solutions of increasing complexity.
First, store a language specific template in a properties file. E.g. messages.en may store the property. This works for short and simple text.
pagination.text = [X] of [Y]
But messages.zh may store
pagination.text = [X of Y]
Second, at least in the Java world, changing a property file change means a new deployment. String attributes can also be internationalized in the database.
Suppose you had an Products mapped directly to a product table. Let's say we have the following API to support internationalizing the name of a product.
class Product
def id: Long
def name(language: Language): String
class Language
// e.g. 'en' for English, 'zh' for Chinese
def isocode: String
def name: String
// ordered list of isodcode s.t. if the internationalized attribute
// does not exist for this language, it tries each language in this list in order.
def fallbackLanguage: List[String]
// default language for entire system. Use this language if all else fails
def isDefault: Boolean
The name attribute on product table would need a one-to-many table joined with the language table.
It usually helps to provide an admin interface so that business users can make changes to these core entities on their own.
Next, you may need to add currency, country and region (e.g. California, Wuhan Province), as first class object just as much as language, so that your system can localize to the particular business rules that apply to a specific region. To continue with my product example, the prices in China won't be the same as in the US, simply because the currency differs. Chinese customers may be expected to pay only in renminbi. And US customers pay only in US dollars.
Lastly, a reason that the same overarching functionality may need to be a separate system is that the business rules in different countries differ. Taxes in the US are not the same as taxes in China. The product catalog can differ because of differing marketing emphases. So It may make sense for your client's China team to have ownership over their own site, as opposed to your client's English-speaking team in an English-speaking country.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.