harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Zhang" <zhanghuang...@gmail.com>
Subject Re: [drlvm] proposals for VM internationalization
Date Thu, 13 Jul 2006 13:57:13 GMT
On 7/13/06, Vladimir Gorr <vvgorr@gmail.com> wrote:
>
> On 7/13/06, Salikh Zakirov <Salikh.Zakirov@intel.com> wrote:
> >
> > Vladimir Gorr wrote:
> > > I'd like to discuss with you a design for the VM native code
> > > internationalization (attached below).
> > > ...
> > > Please let me know your opinions/objections.
> >
> > To make my point clearer, I would repeat my suggestion.
> >
> > 0) Agree on a design decision that the message key
> >   is the *unlocalized message itself*, rather some intermediary
> constant.
> >
> > 1) Start l10n with the below patch (untested)
> >
> > 2) Start marking localizable strings with _() in the DRLVM source code.
> >   The interface is very simple and does not impose any restrictions.
> >
> > 3) Implement the localization in any way we like, be it icu4c, log4cxx
> >   or gettext. Or may be even leave it configurable at compile time.
>
>
>
> There is an essential obstacle to use the *gettext* approach.
>
> It's impossible to run VM on Windows platform if not to take into account
> CYGWIN environment.
>
> I'm not clear as well how we will merge the previous .po catalogs (already
> translated) with new ones (when new strings to be added).
>
> In any case, a manual work needs for doing this. IMO the gettext is very
> convenient to generate the initial template of message catalogs.
>
> However _() should be inserted for all strings (and then deleted?) to
> achieve this. It involves too big efforts.
>
> Therefore my preference is to use more universal approach,


Agree.

namely, ICU4C or
> LOG4CXX or combination of them.


As Paulex mentioned, it depends on the requirement.

If only for i18n, icu4c is prefered.

Otherwise, if grain control of logging is required, log4cxx may be the
choice.

Thanks!


Any comments?

Thanks,
Vladimir.


--- /dev/null
> +++ b/vm/include/l10n.h
> @@ -0,0 +1,8 @@
> +#ifndef _L10N_H
> +#define _L10N_H
> +
> +#define _(message) (message)
> +
> +void init_l10n();
> +
> +#endif // _L10N_H
> diff --git a/vm/vmcore/src/init/vm_main.cpp
> b/vm/vmcore/src/init/vm_main.cpp
> index 9db56e5..96e9a8c 100644
> --- a/vm/vmcore/src/init/vm_main.cpp
> +++ b/vm/vmcore/src/init/vm_main.cpp
> @@ -42,6 +42,7 @@ #include "dll_jit_intf.h"
> #include "dll_gc.h"
> #include "em_intf.h"
> #include "port_filepath.h"
> +#include "l10n.h"
>
> union Scalar_Arg {
>     int i;
> @@ -283,6 +284,7 @@ static int run_java_shutdown()
>
> void create_vm(Global_Env *p_env, JavaVMInitArgs* vm_arguments)
> {
> +    init_l10n();
> #ifdef PLATFORM_POSIX
>     init_linux_thread_system();
> #elif defined(PLATFORM_NT)
> diff --git a/vm/vmcore/src/l10n.cpp b/vm/vmcore/src/l10n.cpp
> new file mode 100644
> index 0000000..d9d380a
> --- /dev/null
> +++ b/vm/vmcore/src/l10n.cpp
> @@ -0,0 +1,4 @@
> +#include "l10n.h"
> +
> +void init_l10n() {
> +}
>
> ---------------------------------------------------------------------
> Terms of use : http://incubator.apache.org/harmony/mailing.html
> To unsubscribe, e-mail: harmony-dev-unsubscribe@incubator.apache.org
> For additional commands, e-mail: harmony-dev-help@incubator.apache.org
>
>





-- 
Andrew Zhang
China Software Development Lab, IBM

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message