views:

226

answers:

6

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.

+1  A: 

Unicode (or wchar, or whatever its equivalent in <language of choice> is) everywhere. Don't store labels in the database. Be prepared to allow text and controls to go "the wrong way", i.e. right-to-left.

Ignacio Vazquez-Abrams
+1  A: 

For localisation, do not hardcode UI strings. Use something like gettext.

bad zeppelin
+1 for gettext.
slebetman
A: 

If you're using .Net, The Resource files (.resx) system is very flexible.

Look up usages of ResourceManager.GetString("string name", CultureInfo).

We use this system to flip between English, German, French, Spanish, Russian and Arabic quite successfully.

Also when considering usage in foreign locales, spend some time looking at Input as well as output; the Turkish problem is a good example of how different inputs can cause problems.

Russ C
+4  A: 

Make sure that there is plenty of spare room in UI controls. Text has a tendency to become a lot longer when translated from English to something like French or German.

Although it is focused somewhat on the Windows side of i18n things, pay attention to Michael Kaplan's blog. He is very well versed in this field, and has posted many blogs posts containing general stuff that's useful.

Michael Madsen
+1 for mentioning Michael Kaplan's blog - the man is an i18n goldmine.
McDowell
+6  A: 

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.

Mike Sickler
The VARCHAR thing depends on the database. For example, MySQL counts characters, rather than bytes. Also, +1 for the word order bit.
Michael Madsen
Ah- that's good to know!
Mike Sickler
Actually, both of those examples will fail as the word order is still defined by the String block, not a localised source, the arguments are irrelevant.
Russ C
@Russ, obviously the string should be externalized. I have it in there for illustrative purposes.
Mike Sickler
Can you say what is the language in your example?<value>{1}ページ中の第{0}ページ</value>Thanks.
bialix
It's Japanese .
Mike Sickler
+3  A: 

You could write a book about this subject.

At all layers, don't make assumptions about:

  • text width
  • text directionality
  • tokenization of natural language
  • currency (format, decimal precision, taxation, etc.)
  • grammar and spelling
  • alphabets
  • number systems and formatting
  • sort order
  • dates, times, time zones and calendars
  • social conventions or cultural references (icons, flags, etc.)
  • searching
  • capitalization
  • addresses
  • proper names (firstname/lastname etc.)
  • telephone numbers
  • legal/regulatory requirements
  • usage of social security numbers or other local conventions

I'm sure I'm only scratching the surface.

McDowell