Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best Practices for writing software to be consumed internationally (i18n)

I am looking for opinions from experts that have written software consumed internationally. I would like to understand the best practices people have employeed at each logical softare layer (Data (rdbms), Business (middleware), User Interface).

Thanks for any help you can give.

like image 432
x450riderx Avatar asked Jan 15 '10 15:01

x450riderx


1 Answers

Data

  • When you go to UTF-8, be prepared for characters to take up to 3 bytes each (in the case of Chinese), which means that VARCHAR(20) now needs to be a VARCHAR(60).
  • Unless you really have a good reason to do it, for the love of god, don't store your UI translations in the DB.

Business

  • Spend a lot of time on requirements. As a starting point, take a screenshot of every single screen in your app, put it in a document, and start drawing boxes around things that need i18n support. Then map each of those boxes to an area of code that needs to change.

UI

Don’t

string foo = "Page " + currentPage + " of " + totalPages;

Do

string foo = string.Format("Page {0} of {1}", currentPage, totalPages);

Why? Word Order Matters.

<value>Page {0} of {1}</value>
 <value>{1}ページ中の第{0}ページ</value>

Nothing is sacred in the UI Even something as fundamental as showing green for positive numbers and red for negative numbers is fair game.

like image 67
Mike Sickler Avatar answered Oct 15 '22 01:10

Mike Sickler