Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Internationalization in the database

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

like image 554
Ryu Avatar asked Jan 02 '09 19:01

Ryu


2 Answers

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.

like image 180
hova Avatar answered Oct 02 '22 14:10

hova


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.

like image 32
Sergiu Damian Avatar answered Oct 02 '22 13:10

Sergiu Damian