11

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.

x450riderx
  • 111
  • 2
  • In order to answer your question you should read few books and even so it will not be enough. There are simple too many things to count. I would advise you to pay somebody with i18n working knowledge to evaluate your software for you. – sorin Feb 02 '10 at 09:00

6 Answers6

9

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
  • 33,662
  • 21
  • 64
  • 90
  • 2
    The VARCHAR thing depends on the database. For example, MySQL counts characters, rather than bytes. Also, +1 for the word order bit. – Michael Madsen Jan 15 '10 at 16:18
  • 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 Clarke Jan 15 '10 at 16:28
  • 1
    @Russ, obviously the string should be externalized. I have it in there for illustrative purposes. – Mike Sickler Jan 15 '10 at 16:36
  • Can you say what is the language in your example? {1}ページ中の第{0}ページ Thanks. – bialix Jan 16 '10 at 09:58
5

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
  • 54,231
  • 8
  • 72
  • 83
4

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
  • 107,573
  • 31
  • 204
  • 267
2

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
  • 776,304
  • 153
  • 1,341
  • 1,358
2

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

rgngl
  • 5,353
  • 3
  • 30
  • 34
0

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 Clarke
  • 17,511
  • 4
  • 41
  • 45