harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dmitry Yershov" <dmitry.yers...@gmail.com>
Subject [drlvm] VM internationalization again
Date Tue, 05 Dec 2006 04:22:15 GMT
Hi All,

    A long time ago we had productive discussion about VM
Internationalization (I18N). But this theme was wrongly forgotten.

    I'll try to raise this discussion again and finish VM
internationalization support. After discussion some questions are
still unresolved. Now, we should clear theirs up for right and
successful I18N implementation.

    At present, VM logging system is based on apache log4cxx. It has a
number of defines (DIE, ASSERT, VERIFY, ECHO, WARN, INFO, LOG, TRACE).
LOG and TRACE defines are only for debug version of VM. All messages
from VM are formatted and printed by log4cxx through defines above.
This was lyrical digression.

    The main goal is to provide VM Internationalization support. I
suppose to use well known log4cxx for this purpose, but have some
question which should be resolved before implementation:

    Firstly, the worst thing is that log4cxx does localization
severely limited. Tuned log4cxx works fine with console which supports
utf8 coding. But with usual console (it supports code page) and
message with wide characters it doesn't work correctly. The main
problem is that log4cxx can't reflect correctly wide characters
(Unicode) to output code page. The good thing is that CLASSLIB
(portlib) has its own internationalization with needed us reflection
algorithms. But these algorithms are used in function which print
messages into file (err, out). We should extend existing CLASSLIB
(portlib) by transformation function which should print transformed
message into buffer (not into file). What do you think about it?

    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).

    Then, one of the following suggestions should be selected:
        1. Substitutional parameters in message pattern should be
presented by printf format specification fields. i.e.: "Message
pattern with integer parameter: %d".
        2. Substitutional parameters in message pattern should be
presented by {i} fields. i.e.: "Message pattern with one parameter:

    And finally, should we introduce new defines in VM (i.e. L7DECHO)
for internationalization purposes or should redevelop existent ones to
support internationalization?


P.s. One more question is tormented me: Should we internationalize LOG
and TRACE (they are for debug version of VM only) output?

View raw message