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.

--- /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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to