The first thing to consider is why these translations are in the database at all. The translations for Hot, Medium and Cold are obviously not dynamic. Even if there is some legacy reason why these *must* be stored in a database, they could be turned into ordinary resource bundles, or turned into statically defined <valueMap> tags in a .ds.xml file, by a preprocessing step performed before deployment, and that's generally what we'd recommend.
So that leaves large, potentially runtime-modified translation sets. It's unclear if either of you actually have that scenario at all (as it's rather unusual). However, when it comes up, if we're looking at a set of record-specific translations, the database structure should store translations in a separate table, with "locale" and "message" as two of the columns. Here, you can use includeFrom to do the join, and you can inject the locale as criteria in a DMI or a custom DataSource.
You did mention a DB structure with separate columns per locale, which would obviously be very, very bad design for a large, dynamically modifiable set of translations. We're assuming that if that DB schema is real (and not just a made up example), you are in the simpler case mentioned above, where translations can be pre-processed into static resources.
So that leaves large, potentially runtime-modified translation sets. It's unclear if either of you actually have that scenario at all (as it's rather unusual). However, when it comes up, if we're looking at a set of record-specific translations, the database structure should store translations in a separate table, with "locale" and "message" as two of the columns. Here, you can use includeFrom to do the join, and you can inject the locale as criteria in a DMI or a custom DataSource.
You did mention a DB structure with separate columns per locale, which would obviously be very, very bad design for a large, dynamically modifiable set of translations. We're assuming that if that DB schema is real (and not just a made up example), you are in the simpler case mentioned above, where translations can be pre-processed into static resources.
Comment