For example: I have table with some codes:
1, Blue, This is blue color
2, Red, This is red color - any text...
3, Green, This is green color
- Number of languages is unknown.
- Table can have more than one localized field.
- I use JPA with hibernate to access these tables.
How can I localize these codes and descriptions?
In opposition to the other answer:
I think, you should create a table that includes the locale as an extra field. This would enable you the build an index over the message id and locale to speed up searches. It would also make the administrative interface (I assume you have one, because otherwise you would use property files) easier to build, since you only have to work with one table and one object on the JPA side.
The table would look like this:
The
message_codeis not strictly neccessary, but help to reuse this table for different contexts.