views:

458

answers:

6

Do you guys think internationalization should only done at the code level or should it be done in the database as well.

Are there any design patterns or accepted practices for internationalizing databases?

If you think it's a code problem then do you just use Resource files to look up a key returned from the database?

Thanks

+4  A: 

Internationalization extends to the database insofar as your columns will be able to hold the data. NText, NChar, NVarchar instead of Text, Char, Varchar.

As far as your UI goes, for non-changing labels, resources files are a good method to use.

hova
+1  A: 

It depends a lot of what you are storing in your database. Taking examples from a recent project I was on, a film title that is entered at a client site and only visible to that client is fair game to store as-is in the database. A projector error code, on the other hand, because it can be viewed by the client, as well as by network operations centers that might be in different countries, should be stored as an error code (and supporting data, like lamp hours and the title of the movie being shown) which can be translated at the gui level depending on the language setting of the viewer.

Paul Tomblin
+1  A: 

If you refer to making your app support multiple languages at the UI level, then there are more possibilities. If the labels never change, unless when you release a new version, then resource files that get embedded in the executable or assembly itself are your best bet, since they work faster. If your labels, on the other hand, need to be adjusted at runtime by the users, then storing the translations in the database is a good choice. As far as the code itself, the names of tables & fields in the database, we keep them in English as much as possible, since English is the "de facto" standard for IT people.

Sergiu Damian
A: 

@hova covers the technicalities, but something you might want to consider is support of a system showing a language you don't understand.

One way to cope with this is to have English as the default language, and a user setting that switches into a different language. That way your support users can log in and see the system in a natural way (assuming English as their first language), and your actual users can see the system in their first language. IMO, the data should always be 'natural' - in the language of the users.

Which raises another interesting point - should your system allow multiple languages for cross-border installations? In my experience, for user interface yes, but for data, no. To take a trivial example of address formatting, a letter to a French third party from a Swiss system should still have a Swiss-format address instead of a French one, as it has to go through the Swiss postal system first.

ColinYounger
Actually, you're wrong about the address formatting thing. The International Postal Union requires that the last thing in the address be the country name, and be underlined. All the Swiss postal system needs to parse is the country name.
Paul Tomblin
A: 

If your customers are Japanese and want to see their names in Kanji and Katakana (and sometimes in most formal Gaiji), you've got to store them as Unicode. No way around that.

duffymo
A: 

Even things like addresses are very different between the US and Japan. One schema won't cut it for both.

duffymo