Salikh Zakirov wrote: > Dmitry Yershov wrote: >> Then, one of the following approaches should be chosen: >> 1. Unique localized message is presented by 2 numbers in >> resource bundle (CLASSLIB schema). >> 2. Unique localized message is presented by string in resource >> bundle (see ResourceBoundle class from log4cxx). > > If I were you, I would definitely go (2) path of meaningful string keys > in resource bundle.
... because it allows the system to degrade gracefully when the proper translation string cannot be found, and the default string (being the message key) is printed instead. The path (1) will result in cryptic messages like "K009E72" or something like that (I've already seen them printed by the classlib). Other advantages of taking path (2) are * better maintainability: the message producing site still has the message in English, and doesn't require looking up message bundle to know what the message is, when someone reads the source code * decoupling jobs of translators and developers, as developers can add new or change existing messages freely without even touching translation message bundles. And the translators can catch up by changing the message bundles only.
