In connection with the internationalisation work on acs-lang, we
are considering splitting message keys.
The table holding the message catalog looks like this:
create table lang_messages (
key varchar2(200),
locale varchar2(30)
constraint lang_messages_locale_fk
references ad_locales(locale)
constraint lang_messages_locale_nn
not null,
message clob,
registered_p char(1)
constraint lm_tranlated_p_ck check(registered_p in ('t','f'))
);
By convention the messages are keyed by package name and local
key name separated by a dot.
One option is to split the key so messages gets keyed by
(package_key, key, locale) instead of just (key, locale). The new
table would be:
create table lang_messages (
package_key varchar2(100)
references apm_package_types (package_key)
key varchar2(200),
locale varchar2(30)
constraint lang_messages_locale_fk
references ad_locales(locale)
constraint lang_messages_locale_nn
not null,
message clob,
registered_p char(1)
constraint lm_tranlated_p_ck check(registered_p in ('t','f'))
);
There are two advantages:
- The modelling is better because rather than relying on some text
coding convention the relationship between messages and packages is
actually reflected in the model and the model can become more robust
and maintainable by introducing constraints.
- Modules (acs-lang administration) that search the message
catalog by package will become faster and simplier written.
The advantages should be weighted against the cost of
implementing upgrade scripts and possible breaking existing code
that rely on the current acs-lang data model.
Any comments on this?