summaryrefslogtreecommitdiff
path: root/modules/localization/src
diff options
context:
space:
mode:
Diffstat (limited to 'modules/localization/src')
-rwxr-xr-xmodules/localization/src/c/.deps/.dirstamp0
-rwxr-xr-xmodules/localization/src/c/.deps/libscilocalization_algo_la-InitializeLocalization.Plo173
-rwxr-xr-xmodules/localization/src/c/.deps/libscilocalization_algo_la-charEncoding.Plo150
-rwxr-xr-xmodules/localization/src/c/.deps/libscilocalization_algo_la-getLcidString.Plo151
-rwxr-xr-xmodules/localization/src/c/.deps/libscilocalization_algo_la-getLocaleInfo_Apple.Plo1
-rwxr-xr-xmodules/localization/src/c/.deps/libscilocalization_algo_la-setdefaultlanguage.Plo4
-rwxr-xr-xmodules/localization/src/c/.deps/libscilocalization_algo_la-setgetlanguage.Plo154
-rwxr-xr-xmodules/localization/src/c/.dirstamp0
-rwxr-xr-xmodules/localization/src/c/.libs/libscilocalization_algo_la-InitializeLocalization.obin0 -> 15864 bytes
-rwxr-xr-xmodules/localization/src/c/.libs/libscilocalization_algo_la-charEncoding.obin0 -> 16880 bytes
-rwxr-xr-xmodules/localization/src/c/.libs/libscilocalization_algo_la-getLcidString.obin0 -> 7312 bytes
-rwxr-xr-xmodules/localization/src/c/.libs/libscilocalization_algo_la-setdefaultlanguage.obin0 -> 3344 bytes
-rwxr-xr-xmodules/localization/src/c/.libs/libscilocalization_algo_la-setgetlanguage.obin0 -> 54096 bytes
-rwxr-xr-xmodules/localization/src/c/DllmainLocalization.c33
-rwxr-xr-xmodules/localization/src/c/InitializeLocalization.c178
-rwxr-xr-xmodules/localization/src/c/LanguagePreferences_Windows.c246
-rwxr-xr-xmodules/localization/src/c/LanguagePreferences_Windows.h47
-rwxr-xr-xmodules/localization/src/c/LocaleNameToLCID_Windows.c38
-rwxr-xr-xmodules/localization/src/c/LocaleNameToLCID_Windows.h30
-rwxr-xr-xmodules/localization/src/c/charEncoding.c266
-rwxr-xr-xmodules/localization/src/c/defaultlanguage.h24
-rwxr-xr-xmodules/localization/src/c/getLcidString.c90
-rwxr-xr-xmodules/localization/src/c/getLcidString.h26
-rwxr-xr-xmodules/localization/src/c/getLocaleInfo_Apple.c33
-rwxr-xr-xmodules/localization/src/c/getLocaleInfo_Apple.h22
-rwxr-xr-xmodules/localization/src/c/getLocaleInfo_Windows.c105
-rwxr-xr-xmodules/localization/src/c/getLocaleInfo_Windows.h32
-rwxr-xr-xmodules/localization/src/c/getentrieshashtable.c125
-rwxr-xr-xmodules/localization/src/c/getentrieshashtable.h25
-rwxr-xr-xmodules/localization/src/c/hashtable_localization.h50
-rwxr-xr-xmodules/localization/src/c/libscilocalization_algo_la-InitializeLocalization.lo12
-rwxr-xr-xmodules/localization/src/c/libscilocalization_algo_la-charEncoding.lo12
-rwxr-xr-xmodules/localization/src/c/libscilocalization_algo_la-getLcidString.lo12
-rwxr-xr-xmodules/localization/src/c/libscilocalization_algo_la-setdefaultlanguage.lo12
-rwxr-xr-xmodules/localization/src/c/libscilocalization_algo_la-setgetlanguage.lo12
-rwxr-xr-xmodules/localization/src/c/loadhashtableslocalization.h21
-rwxr-xr-xmodules/localization/src/c/setdefaultlanguage.c46
-rwxr-xr-xmodules/localization/src/c/setgetlanguage.c413
-rwxr-xr-xmodules/localization/src/c/tableslanguages.h324
-rwxr-xr-xmodules/localization/src/core_Import.def22
-rwxr-xr-xmodules/localization/src/io_Import.def10
-rwxr-xr-xmodules/localization/src/java/org/scilab/modules/localization/LocaleToLCID.java28
-rwxr-xr-xmodules/localization/src/java/org/scilab/modules/localization/LocaleToLCIDJNI.java42
-rwxr-xr-xmodules/localization/src/java/org/scilab/modules/localization/Messages.java32
-rwxr-xr-xmodules/localization/src/java/org/scilab/modules/localization/MessagesJNI.java49
-rwxr-xr-xmodules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguage.java42
-rwxr-xr-xmodules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguageJNI.java43
-rwxr-xr-xmodules/localization/src/jni/.deps/.dirstamp0
-rwxr-xr-xmodules/localization/src/jni/.deps/libscilocalization_algo_la-LocaleToLCID_wrap.Plo128
-rwxr-xr-xmodules/localization/src/jni/.deps/libscilocalization_algo_la-Messages_wrap.Plo147
-rwxr-xr-xmodules/localization/src/jni/.deps/libscilocalization_algo_la-setdefaultlanguage_wrap.Plo131
-rwxr-xr-xmodules/localization/src/jni/.dirstamp0
-rwxr-xr-xmodules/localization/src/jni/.libs/libscilocalization_algo_la-LocaleToLCID_wrap.obin0 -> 31448 bytes
-rwxr-xr-xmodules/localization/src/jni/.libs/libscilocalization_algo_la-Messages_wrap.obin0 -> 33536 bytes
-rwxr-xr-xmodules/localization/src/jni/.libs/libscilocalization_algo_la-setdefaultlanguage_wrap.obin0 -> 32248 bytes
-rwxr-xr-xmodules/localization/src/jni/LocaleToLCID.i87
-rwxr-xr-xmodules/localization/src/jni/LocaleToLCID_wrap.c219
-rwxr-xr-xmodules/localization/src/jni/Messages.i99
-rwxr-xr-xmodules/localization/src/jni/Messages_wrap.c246
-rwxr-xr-xmodules/localization/src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo12
-rwxr-xr-xmodules/localization/src/jni/libscilocalization_algo_la-Messages_wrap.lo12
-rwxr-xr-xmodules/localization/src/jni/libscilocalization_algo_la-setdefaultlanguage_wrap.lo12
-rwxr-xr-xmodules/localization/src/jni/setdefaultlanguage.i95
-rwxr-xr-xmodules/localization/src/jni/setdefaultlanguage_wrap.c227
-rwxr-xr-xmodules/localization/src/localization.rc96
-rwxr-xr-xmodules/localization/src/localization.vcxproj304
-rwxr-xr-xmodules/localization/src/localization.vcxproj.filters165
-rwxr-xr-xmodules/localization/src/localization_export.def23
-rwxr-xr-xmodules/localization/src/perl/check_po_files.pl328
69 files changed, 5466 insertions, 0 deletions
diff --git a/modules/localization/src/c/.deps/.dirstamp b/modules/localization/src/c/.deps/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/localization/src/c/.deps/.dirstamp
diff --git a/modules/localization/src/c/.deps/libscilocalization_algo_la-InitializeLocalization.Plo b/modules/localization/src/c/.deps/libscilocalization_algo_la-InitializeLocalization.Plo
new file mode 100755
index 000000000..11ab00f40
--- /dev/null
+++ b/modules/localization/src/c/.deps/libscilocalization_algo_la-InitializeLocalization.Plo
@@ -0,0 +1,173 @@
+src/c/libscilocalization_algo_la-InitializeLocalization.lo: \
+ src/c/InitializeLocalization.c /usr/include/stdc-predef.h \
+ /usr/include/stdio.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \
+ /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h /usr/include/string.h \
+ /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/stdlib.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h \
+ ../../modules/core/includes/machine.h /usr/include/libintl.h \
+ /usr/include/locale.h /usr/include/x86_64-linux-gnu/bits/locale.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h \
+ includes/InitializeLocalization.h includes/dynlib_localization.h \
+ ../../modules/core/includes/BOOL.h includes/localization.h \
+ ../../modules/core/includes/setgetSCIpath.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar2.h \
+ ../../modules/core/includes/inisci-c.h \
+ ../../modules/core/includes/machine.h \
+ ../../modules/core/includes/scilabDefaults.h includes/setgetlanguage.h \
+ ../../modules/fileio/includes/isdir.h \
+ ../../modules/fileio/includes/dynlib_fileio.h
+
+/usr/include/stdc-predef.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+/usr/include/string.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+../../modules/core/includes/machine.h:
+
+/usr/include/libintl.h:
+
+/usr/include/locale.h:
+
+/usr/include/x86_64-linux-gnu/bits/locale.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+includes/InitializeLocalization.h:
+
+includes/dynlib_localization.h:
+
+../../modules/core/includes/BOOL.h:
+
+includes/localization.h:
+
+../../modules/core/includes/setgetSCIpath.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar2.h:
+
+../../modules/core/includes/inisci-c.h:
+
+../../modules/core/includes/machine.h:
+
+../../modules/core/includes/scilabDefaults.h:
+
+includes/setgetlanguage.h:
+
+../../modules/fileio/includes/isdir.h:
+
+../../modules/fileio/includes/dynlib_fileio.h:
diff --git a/modules/localization/src/c/.deps/libscilocalization_algo_la-charEncoding.Plo b/modules/localization/src/c/.deps/libscilocalization_algo_la-charEncoding.Plo
new file mode 100755
index 000000000..abdf2b2d2
--- /dev/null
+++ b/modules/localization/src/c/.deps/libscilocalization_algo_la-charEncoding.Plo
@@ -0,0 +1,150 @@
+src/c/libscilocalization_algo_la-charEncoding.lo: src/c/charEncoding.c \
+ /usr/include/stdc-predef.h /usr/include/wctype.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/xlocale.h \
+ /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/stdio.h \
+ /usr/include/libio.h /usr/include/_G_config.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h /usr/include/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/locale.h \
+ /usr/include/x86_64-linux-gnu/bits/locale.h includes/charEncoding.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar2.h \
+ /usr/include/x86_64-linux-gnu/sys/stat.h \
+ /usr/include/x86_64-linux-gnu/bits/stat.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h \
+ ../../modules/core/includes/BOOL.h
+
+/usr/include/stdc-predef.h:
+
+/usr/include/wctype.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+/usr/include/stdio.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+/usr/include/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+/usr/include/locale.h:
+
+/usr/include/x86_64-linux-gnu/bits/locale.h:
+
+includes/charEncoding.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar2.h:
+
+/usr/include/x86_64-linux-gnu/sys/stat.h:
+
+/usr/include/x86_64-linux-gnu/bits/stat.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+../../modules/core/includes/BOOL.h:
diff --git a/modules/localization/src/c/.deps/libscilocalization_algo_la-getLcidString.Plo b/modules/localization/src/c/.deps/libscilocalization_algo_la-getLcidString.Plo
new file mode 100755
index 000000000..2830f79d6
--- /dev/null
+++ b/modules/localization/src/c/.deps/libscilocalization_algo_la-getLcidString.Plo
@@ -0,0 +1,151 @@
+src/c/libscilocalization_algo_la-getLcidString.lo: src/c/getLcidString.c \
+ /usr/include/stdc-predef.h /usr/include/string.h /usr/include/features.h \
+ /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h /usr/include/xlocale.h \
+ /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/stdlib.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h /usr/include/stdio.h \
+ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h src/c/getLcidString.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h includes/charEncoding.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar.h \
+ /usr/include/x86_64-linux-gnu/bits/wchar2.h \
+ /usr/include/x86_64-linux-gnu/sys/stat.h \
+ /usr/include/x86_64-linux-gnu/bits/stat.h \
+ ../../modules/core/includes/BOOL.h \
+ ../../modules/core/includes/stack-def.h \
+ ../../modules/core/includes/machine.h
+
+/usr/include/stdc-predef.h:
+
+/usr/include/string.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+/usr/include/stdio.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+src/c/getLcidString.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+includes/charEncoding.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar.h:
+
+/usr/include/x86_64-linux-gnu/bits/wchar2.h:
+
+/usr/include/x86_64-linux-gnu/sys/stat.h:
+
+/usr/include/x86_64-linux-gnu/bits/stat.h:
+
+../../modules/core/includes/BOOL.h:
+
+../../modules/core/includes/stack-def.h:
+
+../../modules/core/includes/machine.h:
diff --git a/modules/localization/src/c/.deps/libscilocalization_algo_la-getLocaleInfo_Apple.Plo b/modules/localization/src/c/.deps/libscilocalization_algo_la-getLocaleInfo_Apple.Plo
new file mode 100755
index 000000000..9ce06a81e
--- /dev/null
+++ b/modules/localization/src/c/.deps/libscilocalization_algo_la-getLocaleInfo_Apple.Plo
@@ -0,0 +1 @@
+# dummy
diff --git a/modules/localization/src/c/.deps/libscilocalization_algo_la-setdefaultlanguage.Plo b/modules/localization/src/c/.deps/libscilocalization_algo_la-setdefaultlanguage.Plo
new file mode 100755
index 000000000..1bb0171e7
--- /dev/null
+++ b/modules/localization/src/c/.deps/libscilocalization_algo_la-setdefaultlanguage.Plo
@@ -0,0 +1,4 @@
+src/c/libscilocalization_algo_la-setdefaultlanguage.lo: \
+ src/c/setdefaultlanguage.c /usr/include/stdc-predef.h
+
+/usr/include/stdc-predef.h:
diff --git a/modules/localization/src/c/.deps/libscilocalization_algo_la-setgetlanguage.Plo b/modules/localization/src/c/.deps/libscilocalization_algo_la-setgetlanguage.Plo
new file mode 100755
index 000000000..38283a679
--- /dev/null
+++ b/modules/localization/src/c/.deps/libscilocalization_algo_la-setgetlanguage.Plo
@@ -0,0 +1,154 @@
+src/c/libscilocalization_algo_la-setgetlanguage.lo: \
+ src/c/setgetlanguage.c /usr/include/stdc-predef.h /usr/include/string.h \
+ /usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h /usr/include/xlocale.h \
+ /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h /usr/include/stdlib.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h \
+ /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/stdio.h \
+ /usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h \
+ ../../modules/core/includes/machine.h /usr/include/libintl.h \
+ /usr/include/locale.h /usr/include/x86_64-linux-gnu/bits/locale.h \
+ includes/setgetlanguage.h ../../modules/core/includes/BOOL.h \
+ ../../modules/core/includes/MALLOC.h \
+ ../../modules/core/includes/sci_mem_alloc.h src/c/tableslanguages.h \
+ src/c/defaultlanguage.h ../../modules/core/includes/scilabDefaults.h \
+ src/c/../../../io/includes/setenvc.h \
+ src/c/../../../io/includes/dynlib_io.h
+
+/usr/include/stdc-predef.h:
+
+/usr/include/string.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+/usr/include/stdio.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+../../modules/core/includes/machine.h:
+
+/usr/include/libintl.h:
+
+/usr/include/locale.h:
+
+/usr/include/x86_64-linux-gnu/bits/locale.h:
+
+includes/setgetlanguage.h:
+
+../../modules/core/includes/BOOL.h:
+
+../../modules/core/includes/MALLOC.h:
+
+../../modules/core/includes/sci_mem_alloc.h:
+
+src/c/tableslanguages.h:
+
+src/c/defaultlanguage.h:
+
+../../modules/core/includes/scilabDefaults.h:
+
+src/c/../../../io/includes/setenvc.h:
+
+src/c/../../../io/includes/dynlib_io.h:
diff --git a/modules/localization/src/c/.dirstamp b/modules/localization/src/c/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/localization/src/c/.dirstamp
diff --git a/modules/localization/src/c/.libs/libscilocalization_algo_la-InitializeLocalization.o b/modules/localization/src/c/.libs/libscilocalization_algo_la-InitializeLocalization.o
new file mode 100755
index 000000000..7bebc06a5
--- /dev/null
+++ b/modules/localization/src/c/.libs/libscilocalization_algo_la-InitializeLocalization.o
Binary files differ
diff --git a/modules/localization/src/c/.libs/libscilocalization_algo_la-charEncoding.o b/modules/localization/src/c/.libs/libscilocalization_algo_la-charEncoding.o
new file mode 100755
index 000000000..2fa0c8c37
--- /dev/null
+++ b/modules/localization/src/c/.libs/libscilocalization_algo_la-charEncoding.o
Binary files differ
diff --git a/modules/localization/src/c/.libs/libscilocalization_algo_la-getLcidString.o b/modules/localization/src/c/.libs/libscilocalization_algo_la-getLcidString.o
new file mode 100755
index 000000000..ac0b3db2b
--- /dev/null
+++ b/modules/localization/src/c/.libs/libscilocalization_algo_la-getLcidString.o
Binary files differ
diff --git a/modules/localization/src/c/.libs/libscilocalization_algo_la-setdefaultlanguage.o b/modules/localization/src/c/.libs/libscilocalization_algo_la-setdefaultlanguage.o
new file mode 100755
index 000000000..194987bf4
--- /dev/null
+++ b/modules/localization/src/c/.libs/libscilocalization_algo_la-setdefaultlanguage.o
Binary files differ
diff --git a/modules/localization/src/c/.libs/libscilocalization_algo_la-setgetlanguage.o b/modules/localization/src/c/.libs/libscilocalization_algo_la-setgetlanguage.o
new file mode 100755
index 000000000..31d5ffdaf
--- /dev/null
+++ b/modules/localization/src/c/.libs/libscilocalization_algo_la-setgetlanguage.o
Binary files differ
diff --git a/modules/localization/src/c/DllmainLocalization.c b/modules/localization/src/c/DllmainLocalization.c
new file mode 100755
index 000000000..3a3febef3
--- /dev/null
+++ b/modules/localization/src/c/DllmainLocalization.c
@@ -0,0 +1,33 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include <windows.h>
+/*--------------------------------------------------------------------------*/
+#pragma comment(lib,"../../../bin/libintl.lib")
+/*--------------------------------------------------------------------------*/
+int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)
+{
+ switch (reason)
+ {
+ case DLL_PROCESS_ATTACH:
+ break;
+ case DLL_PROCESS_DETACH:
+ break;
+ case DLL_THREAD_ATTACH:
+ break;
+ case DLL_THREAD_DETACH:
+ break;
+ }
+ return 1;
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/modules/localization/src/c/InitializeLocalization.c b/modules/localization/src/c/InitializeLocalization.c
new file mode 100755
index 000000000..138f44c90
--- /dev/null
+++ b/modules/localization/src/c/InitializeLocalization.c
@@ -0,0 +1,178 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include "machine.h"
+#ifndef _MSC_VER
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#else
+#error "Cannot find locale.h despite that libintl.h is available"
+#endif
+#endif
+#else
+#include <libintl.h>
+#include <locale.h>
+#endif
+
+#include "MALLOC.h"
+#include "InitializeLocalization.h"
+#include "localization.h"
+#include "setgetSCIpath.h"
+#include "inisci-c.h"
+#include "scilabDefaults.h"
+#include "setgetlanguage.h"
+#include "isdir.h"
+#ifdef _MSC_VER
+#include "strdup_windows.h"
+#include "LanguagePreferences_Windows.h"
+#endif
+
+/*--------------------------------------------------------------------------*/
+
+BOOL InitializeLocalization(void)
+{
+#ifdef HAVE_LIBINTL_H
+
+ char *SCIpath = getSCIpath();
+ char *pathLocales = NULL, *previousPathLocales = NULL;
+ char *ret = NULL;
+
+ /* set directory containing message catalogs */
+ pathLocales = (char *)MALLOC(sizeof(char) * (strlen(SCIpath) + strlen(PATHLOCALIZATIONFILE) + 1));
+
+ strcpy(pathLocales, SCIpath);
+ strcat(pathLocales, PATHLOCALIZATIONFILE);
+ if (bindtextdomain(NAMELOCALIZATIONDOMAIN, pathLocales) == NULL || !isdir(pathLocales))
+ {
+ /* source tree and classic build */
+ previousPathLocales = strdup(pathLocales);
+ if (pathLocales)
+ {
+ FREE(pathLocales);
+ pathLocales = NULL;
+ }
+
+ pathLocales = (char *)MALLOC(sizeof(char) * (strlen(SCIpath) + strlen("/..") + strlen(PATHLOCALIZATIONFILE) + 1));
+ strcpy(pathLocales, SCIpath);
+ strcat(pathLocales, "/..");
+ strcat(pathLocales, PATHLOCALIZATIONFILE);
+ if (bindtextdomain(NAMELOCALIZATIONDOMAIN, pathLocales) == NULL || !isdir(pathLocales))
+ {
+ /* when it is installed on the system for example /usr/share/locale/ */
+ fprintf(stderr, "Warning: Localization issue: Error while binding the domain from %s or %s: Switch to the default language (English).\n", pathLocales, previousPathLocales);
+
+ // Set default behaviour
+ textdomain(NAMELOCALIZATIONDOMAIN);
+ bind_textdomain_codeset (NAMELOCALIZATIONDOMAIN, "UTF-8");
+#ifndef _MSC_VER
+ setlanguage("");
+#else
+ /* We look if registry value LANGUAGE exists */
+ /* If not exists the "" means that we will try to use the language of the system.*/
+ {
+ char *loadLanguage = getLanguagePreferences();
+ setlanguage(loadLanguage);
+ if (loadLanguage)
+ {
+ FREE(loadLanguage);
+ loadLanguage = NULL;
+ }
+ }
+#endif
+
+ if (previousPathLocales)
+ {
+ FREE(previousPathLocales);
+ previousPathLocales = NULL;
+ }
+ if (pathLocales)
+ {
+ FREE(pathLocales);
+ pathLocales = NULL;
+ }
+ if (SCIpath)
+ {
+ FREE(SCIpath);
+ SCIpath = NULL;
+ }
+ return FALSE;
+ }
+ if (previousPathLocales)
+ {
+ FREE(previousPathLocales);
+ previousPathLocales = NULL;
+ }
+ if (pathLocales)
+ {
+ FREE(pathLocales);
+ pathLocales = NULL;
+ }
+ if (SCIpath)
+ {
+ FREE(SCIpath);
+ SCIpath = NULL;
+ }
+
+ }
+
+ /* set domain for future gettext() calls */
+ ret = textdomain(NAMELOCALIZATIONDOMAIN);
+ if (ret == NULL)
+ {
+ fprintf(stderr, "Localization: Error while declaring the text domain %s\n", NAMELOCALIZATIONDOMAIN);
+ FREE(pathLocales);
+ return FALSE;
+ }
+ bind_textdomain_codeset (NAMELOCALIZATIONDOMAIN, "UTF-8"); /*such that gettext and dgettext return UTF8 string*/
+#ifndef _MSC_VER
+ /* Here, the "" means that we will try to use the language of the system
+ * first. If it doesn't work, we switch back to default (English) */
+ setlanguage("");
+#else
+ /* We look if registry value LANGUAGE exists */
+ /* If not exists the "" means that we will try to use the language of the system.*/
+ {
+ char *loadLanguage = getLanguagePreferences();
+ setlanguage(loadLanguage);
+ if (loadLanguage)
+ {
+ FREE(loadLanguage);
+ loadLanguage = NULL;
+ }
+ }
+#endif
+
+ if (previousPathLocales)
+ {
+ FREE(previousPathLocales);
+ }
+ if (pathLocales)
+ {
+ FREE(pathLocales);
+ }
+ if (SCIpath)
+ {
+ FREE(SCIpath);
+ }
+
+ return TRUE;
+#else
+ fprintf(stderr, "Localization: setlocale didn't exist on the computer used to compile Scilab ! This is abnormal ! No localization will be working for this distribution of Scilab.\n");
+ return FALSE;
+#endif
+}
+/*--------------------------------------------------------------------------*/
+
diff --git a/modules/localization/src/c/LanguagePreferences_Windows.c b/modules/localization/src/c/LanguagePreferences_Windows.c
new file mode 100755
index 000000000..672245391
--- /dev/null
+++ b/modules/localization/src/c/LanguagePreferences_Windows.c
@@ -0,0 +1,246 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2008-2010 - DIGITEO - Allan CORNET
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution. The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+*
+*/
+
+/*--------------------------------------------------------------------------*/
+#include <stdio.h>
+#include <Windows.h>
+#include "LanguagePreferences_Windows.h"
+#include "strdup_windows.h"
+#include "setgetlanguage.h"
+#include "version.h"
+#include "MALLOC.h"
+#include "GetWindowsVersion.h"
+/*--------------------------------------------------------------------------*/
+#define HKCU_LANGUAGE_FORMAT "SOFTWARE\\Scilab\\%s\\Settings" /* r/w registry */
+#define HKCM_LANGUAGE_FORMAT "SOFTWARE\\Scilab\\%s" /* only read registry */
+#define LANGUAGE_ENTRY "LANGUAGE"
+#define DEFAULT_LANGUAGE_VALUE "en_US"
+/*--------------------------------------------------------------------------*/
+static char *languageFromCommandLine = NULL;
+/*--------------------------------------------------------------------------*/
+static char *getLanguagePreferencesCurrentUser(void);
+static char *getLanguagePreferencesAllUsers(void);
+static char *readRegistryLanguage(HKEY hKeyRoot, char *keyString);
+/*--------------------------------------------------------------------------*/
+BOOL isValidLanguage(char *lang)
+{
+ if (lang)
+ {
+ if ( strcmp(lang, "") == 0)
+ {
+ return TRUE;
+ }
+ if ( strcmp(lang, "C") == 0)
+ {
+ return TRUE;
+ }
+ /* xx_XX */
+ if ( ((int) strlen(lang) == 5) && (lang[2] == '_') )
+ {
+ return TRUE;
+ }
+ else if ((strlen(lang) == 2) && (convertlanguagealias(lang)))
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+/*--------------------------------------------------------------------------*/
+BOOL setLanguageFromCommandLine(char *lang)
+{
+ if (lang)
+ {
+ if (languageFromCommandLine)
+ {
+ FREE(languageFromCommandLine);
+ languageFromCommandLine = NULL;
+ }
+
+ languageFromCommandLine = strdup(convertlanguagealias(lang));
+
+ return TRUE;
+ }
+ return FALSE;
+}
+/*--------------------------------------------------------------------------*/
+char *getLanguagePreferences(void)
+{
+ char *LanguageUser = NULL;
+
+ if (languageFromCommandLine)
+ {
+ LanguageUser = languageFromCommandLine;
+ }
+ else
+ {
+ LanguageUser = getLanguagePreferencesCurrentUser();
+ }
+
+ if (LanguageUser == NULL)
+ {
+ char *LanguageAllUsers = getLanguagePreferencesAllUsers();
+
+ if (LanguageAllUsers == NULL)
+ {
+ return strdup("");
+ }
+ else
+ {
+ if (isValidLanguage(LanguageAllUsers))
+ {
+ return LanguageAllUsers;
+ }
+ }
+ }
+ else
+ {
+ if (isValidLanguage(LanguageUser))
+ {
+ return LanguageUser;
+ }
+ }
+ return strdup("");
+}
+/*--------------------------------------------------------------------------*/
+static char *readRegistryLanguage(HKEY hKeyRoot, char *keyStringFormat)
+{
+#define LENGTH_LANGUAGE_REGISTRY 64
+ char LANGUAGE_REGISTRY[LENGTH_LANGUAGE_REGISTRY] = DEFAULT_LANGUAGE_VALUE;
+ char *keyString = NULL;
+ int lenkeyString = (int)(strlen(keyStringFormat) + strlen(SCI_VERSION_STRING)) + 1;
+
+ keyString = (char*) MALLOC(sizeof(char) * lenkeyString);
+
+ if (keyString)
+ {
+
+ DWORD OpensKeyOptions = 0;
+ HKEY hKey;
+ int length = LENGTH_LANGUAGE_REGISTRY;
+ wsprintf(keyString, keyStringFormat, SCI_VERSION_STRING);
+#ifdef _WIN64 /* Scilab x64 on x64 windows */
+ OpensKeyOptions = KEY_READ | KEY_WOW64_64KEY;
+#else
+ if (IsWow64()) /* Scilab 32 bits on x64 windows */
+ {
+ OpensKeyOptions = KEY_READ | KEY_WOW64_32KEY;
+ }
+ else /* Scilab 32 bits on windows 32 bits */
+ {
+ OpensKeyOptions = KEY_READ;
+ }
+#endif
+ if ( RegOpenKeyEx(hKeyRoot, keyString, 0, OpensKeyOptions, &hKey) != ERROR_SUCCESS )
+ {
+ RegCloseKey(hKey);
+ if (keyString)
+ {
+ FREE(keyString);
+ keyString = NULL;
+ }
+ return NULL;
+ }
+
+ if ( RegQueryValueEx(hKey, LANGUAGE_ENTRY, 0, NULL , (LPBYTE)LANGUAGE_REGISTRY, &length) != ERROR_SUCCESS )
+ {
+ RegCloseKey(hKey);
+ if (keyString)
+ {
+ FREE(keyString);
+ keyString = NULL;
+ }
+ return NULL;
+ }
+
+ RegCloseKey(hKey);
+ if (keyString)
+ {
+ FREE(keyString);
+ keyString = NULL;
+ }
+ }
+ return strdup(LANGUAGE_REGISTRY);
+}
+/*--------------------------------------------------------------------------*/
+static char *getLanguagePreferencesCurrentUser(void)
+{
+ return readRegistryLanguage(HKEY_CURRENT_USER, HKCU_LANGUAGE_FORMAT);
+}
+/*--------------------------------------------------------------------------*/
+static char *getLanguagePreferencesAllUsers(void)
+{
+ return readRegistryLanguage(HKEY_LOCAL_MACHINE, HKCM_LANGUAGE_FORMAT);
+}
+/*--------------------------------------------------------------------------*/
+BOOL setLanguagePreferences(void)
+{
+ char *LANGUAGE = getlanguage();
+
+ if (LANGUAGE)
+ {
+ char *keyString = NULL;
+ int lenkeyString = (int)(strlen(HKCU_LANGUAGE_FORMAT) + strlen(SCI_VERSION_STRING)) + 1;
+ keyString = (char*) MALLOC(sizeof(char) * lenkeyString);
+ if (keyString)
+ {
+ DWORD OpensKeyOptions = 0;
+ HKEY hKey;
+ DWORD result = 0;
+ wsprintf(keyString, HKCU_LANGUAGE_FORMAT, SCI_VERSION_STRING);
+
+#ifdef _WIN64 /* Scilab x64 on x64 windows */
+ OpensKeyOptions = KEY_ALL_ACCESS | KEY_WOW64_64KEY;
+#else
+ if ( IsWow64() ) /* Scilab 32 bits on x64 windows */
+ {
+ OpensKeyOptions = KEY_ALL_ACCESS | KEY_WOW64_32KEY;
+ }
+ else /* Scilab 32 bits on windows 32 bits */
+ {
+ OpensKeyOptions = KEY_ALL_ACCESS;
+ }
+#endif
+ if ( RegCreateKeyEx(HKEY_CURRENT_USER, keyString, 0, NULL, REG_OPTION_NON_VOLATILE, OpensKeyOptions, NULL, &hKey, &result) != ERROR_SUCCESS)
+ {
+ RegCloseKey(hKey);
+ if (keyString)
+ {
+ FREE(keyString);
+ keyString = NULL;
+ }
+ return FALSE;
+ }
+
+ if ( RegSetValueEx(hKey, LANGUAGE_ENTRY, 0, REG_SZ, (LPBYTE)LANGUAGE, (DWORD)(strlen(LANGUAGE) + 1)) != ERROR_SUCCESS)
+ {
+ RegCloseKey(hKey);
+ if (keyString)
+ {
+ FREE(keyString);
+ keyString = NULL;
+ }
+ return FALSE;
+ }
+
+ RegCloseKey(hKey);
+ if (keyString)
+ {
+ FREE(keyString);
+ keyString = NULL;
+ }
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/LanguagePreferences_Windows.h b/modules/localization/src/c/LanguagePreferences_Windows.h
new file mode 100755
index 000000000..d51f4eba0
--- /dev/null
+++ b/modules/localization/src/c/LanguagePreferences_Windows.h
@@ -0,0 +1,47 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2008-2010 - DIGITEO - Allan CORNET
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution. The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+*
+*/
+
+/*--------------------------------------------------------------------------*/
+#ifndef __LANGUAGEPREFERENCES_WINDOWS_H__
+#define __LANGUAGEPREFERENCES_WINDOWS_H__
+
+#include "BOOL.h"
+
+/**
+* Get default language saved in registry
+* @return language
+*/
+char *getLanguagePreferences(void);
+
+/**
+* Set default language saved in registry
+* @return TRUE or FALSE
+*/
+BOOL setLanguagePreferences(void);
+
+/**
+* Set language from Command line (wscilex.exe -l lang)
+* @param[in] language string
+* @return TRUE or FALSE
+*/
+BOOL setLanguageFromCommandLine(char *lang);
+
+/**
+* check if it is valid language format
+* xx_XX
+* @param[in] language string
+* @return TRUE or FALSE
+*/
+BOOL isValidLanguage(char *lang);
+
+#endif /* __LANGUAGEPREFERENCES_WINDOWS_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/LocaleNameToLCID_Windows.c b/modules/localization/src/c/LocaleNameToLCID_Windows.c
new file mode 100755
index 000000000..fd0e97014
--- /dev/null
+++ b/modules/localization/src/c/LocaleNameToLCID_Windows.c
@@ -0,0 +1,38 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#include "LocaleNameToLCID_Windows.h"
+/*--------------------------------------------------------------------------*/
+/* ONLY for Windows */
+/* Some old XP without SP2 or more do not have this function ... */
+/*--------------------------------------------------------------------------*/
+static HINSTANCE KernelDll = NULL;
+/*--------------------------------------------------------------------------*/
+typedef LCID (WINAPI * LocaleNameToLCIDPROC)(LPCWSTR lpName, DWORD dwFlags);
+/*--------------------------------------------------------------------------*/
+LCID dllLocaleNameToLCID(LPCWSTR lpName, DWORD dwFlags)
+{
+ if (KernelDll == NULL)
+ {
+ KernelDll = LoadLibrary ("kernel32.dll");
+ }
+ if (KernelDll)
+ {
+ LocaleNameToLCIDPROC ptrFunctionLocaleNameToLCID = (LocaleNameToLCIDPROC)GetProcAddress(KernelDll, "LocaleNameToLCID");
+ if (ptrFunctionLocaleNameToLCID)
+ {
+ return (LCID)(ptrFunctionLocaleNameToLCID)(lpName, dwFlags);
+ }
+ }
+ return 0;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/LocaleNameToLCID_Windows.h b/modules/localization/src/c/LocaleNameToLCID_Windows.h
new file mode 100755
index 000000000..57eb79219
--- /dev/null
+++ b/modules/localization/src/c/LocaleNameToLCID_Windows.h
@@ -0,0 +1,30 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#ifndef __LOCALENAMETOLCID_WINDOWS_H__
+#define __LOCALENAMETOLCID_WINDOWS_H__
+
+#ifdef _MSC_VER
+
+#include <Windows.h>
+
+/* loaded from system LocaleNameToLCID function */
+/* Some Windows does not have this function */
+/* Windows must support multilanguage */
+/* by default LCID returns 0*/
+
+LCID dllLocaleNameToLCID(LPCWSTR lpName, DWORD dwFlags);
+
+#endif
+
+#endif /* __LOCALENAMETOLCID_WINDOWS_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/charEncoding.c b/modules/localization/src/c/charEncoding.c
new file mode 100755
index 000000000..c53a6cebf
--- /dev/null
+++ b/modules/localization/src/c/charEncoding.c
@@ -0,0 +1,266 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2008 - Yung-Jang Lee
+* Copyright (C) 2009 - DIGITEO - Antoine ELIAS , Allan CORNET
+*
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution. The terms
+* are also available at
+* http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+*
+*/
+/*--------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+#include <windows.h>
+#endif
+#include <wctype.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+#include <locale.h>
+#include "charEncoding.h"
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+#ifndef _MSC_VER
+int wcsicmp_others(const wchar_t* s1, const wchar_t* s2)
+{
+ while (towlower(*s1) == towlower(*s2))
+ {
+ if (*s1 == 0)
+ {
+ return 0;
+ }
+ s1++;
+ s2++;
+ }
+ return towlower(*s1) - towlower(*s2);
+}
+#endif
+/*--------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+char *wide_string_to_UTF8(const wchar_t *_wide)
+{
+ char *buf = NULL;
+ DWORD size = 0;
+ DWORD dwFlags = 0;
+
+ if ((wchar_t *)NULL == _wide)
+ {
+ return (char *)NULL;
+ }
+ size = WideCharToMultiByte(CP_UTF8, dwFlags, _wide, -1, NULL, 0, NULL, 0);
+ if (size == 0)
+ {
+ return (char *)NULL;
+ }
+ size += 1;
+ buf = (char*)MALLOC(sizeof(char) * size);
+ if (buf)
+ {
+ WideCharToMultiByte(CP_UTF8, dwFlags, _wide, -1, buf, size, NULL, 0);
+ if (size <= 0)
+ {
+ FREE(buf);
+ return (char *)NULL;
+ }
+ }
+ return buf;
+}
+/*--------------------------------------------------------------------------*/
+wchar_t *to_wide_string(const char *_UTFStr)
+{
+ int nwide = 0;
+ wchar_t *_buf = NULL;
+
+ /* About MultiByteToWideChar :
+ Starting with Windows Vista,
+ the function does not drop illegal code points
+ if the application does not set this flag.
+
+ Windows XP: To prevent the security problem of the non-shortest-form
+ versions of UTF-8 characters, MultiByteToWideChar deletes these characters.
+ */
+
+ DWORD dwFlags = 0;
+
+ if (_UTFStr == NULL)
+ {
+ return NULL;
+ }
+ nwide = MultiByteToWideChar(CP_UTF8, dwFlags, _UTFStr, -1, NULL, 0);
+ if (nwide == 0)
+ {
+ return NULL;
+ }
+ _buf = (wchar_t *)MALLOC(nwide * sizeof(wchar_t));
+ if (_buf == NULL)
+ {
+ return NULL;
+ }
+ if (MultiByteToWideChar(CP_UTF8, dwFlags, _UTFStr, -1, _buf, nwide) == 0)
+ {
+ FREE(_buf);
+ _buf = NULL;
+ }
+ return _buf;
+}
+/*--------------------------------------------------------------------------*/
+int wcstat(char* filename, struct _stat *st)
+{
+ int stat_result = 0;
+ wchar_t *wfilename = to_wide_string(filename);
+ stat_result = _wstat(wfilename, st);
+ FREE(wfilename);
+ return stat_result;
+}
+/*--------------------------------------------------------------------------*/
+#else //Linux check for MAC OS X
+char *wide_string_to_UTF8(const wchar_t *_wide)
+{
+ size_t iCharLen = 0;
+ wchar_t *pwstr = _wide;
+ char* pchar = NULL;
+ /* The value of MB_CUR_MAX is the maximum number of bytes
+ in a multibyte character for the current locale. */
+ int iMaxLen = 0;
+
+ if (_wide == NULL)
+ {
+ return NULL;
+ }
+
+ iMaxLen = (int)wcslen(_wide) * MB_CUR_MAX ;
+
+ pchar = (char*) MALLOC(( iMaxLen + 1) * sizeof(char));
+ if (pchar == NULL)
+ {
+ return NULL;
+ }
+ iCharLen = wcstombs (pchar, pwstr, iMaxLen);
+ if ( iCharLen == (size_t)(-1) )
+ {
+ if (pchar)
+ {
+ FREE(pchar);
+ pchar = NULL;
+ }
+ return NULL;
+ }
+ pchar[iCharLen] = '\0';
+ return pchar;
+}
+/*--------------------------------------------------------------------------*/
+wchar_t *to_wide_string(const char *_UTFStr)
+{
+ wchar_t *_buf = NULL;
+ size_t pszLen = 0;
+ char *psz = _UTFStr;
+ mbstate_t ps;
+
+ if (_UTFStr == NULL)
+ {
+ return NULL;
+ }
+
+ memset (&ps, 0x00, sizeof(ps));
+ pszLen = mbsrtowcs(NULL, (const char**)&psz, 0, &ps);
+
+ if ( pszLen == (size_t)(-1) )
+ {
+ return NULL;
+ }
+
+ _buf = (wchar_t*)MALLOC((pszLen + 1) * sizeof(wchar_t));
+ if (_buf == NULL)
+ {
+ return NULL;
+ }
+
+ pszLen = mbsrtowcs(_buf, (const char**)&psz, (int)strlen(psz), &ps);
+
+ if ( pszLen == (size_t)(-1) )
+ {
+ FREE(_buf);
+ return NULL;
+ }
+ else
+ {
+ _buf[pszLen] = L'\0';
+ }
+ return _buf;
+}
+/*--------------------------------------------------------------------------*/
+int wcstat(char* filename, struct stat *st)
+{
+ return stat(filename, st);
+}
+#endif
+/*--------------------------------------------------------------------------*/
+static int ReadUTF8Character(const char* str, int *nBytes)
+{
+ const unsigned char* s = (const unsigned char*)(str);
+ unsigned char c = s[0];
+
+ if (c < 0x80)
+ {
+ *nBytes = 1;
+ return c;
+ }
+ else if (c < 0xC2)
+ {
+ return -1;
+ }
+ else if (c < 0xE0)
+ {
+ if (s[1] == 0 || (s[1] ^ 0x80) >= 0x40)
+ {
+ return -1;
+ }
+ *nBytes = 2;
+ return ((s[0] & 0x1F) << 6) + (s[1] ^ 0x80);
+ }
+ else if (c < 0xF0)
+ {
+ if (s[1] == 0 || s[2] == 0 || (s[1] ^ 0x80) >= 0x40
+ || (s[2] ^ 0x80) >= 0x40 || (c == 0xE0 && s[1] < 0xA0))
+ {
+ return -1;
+ }
+ *nBytes = 3;
+ return ((s[0] & 0xF) << 12) + ((s[1] ^ 0x80) << 6) + (s[2] ^ 0x80);
+ }
+ else if (c < 0xF5)
+ {
+ if (s[1] == 0 || s[2] == 0 || s[3] == 0 || (s[1] ^ 0x80) >= 0x40
+ || (s[2] ^ 0x80) >= 0x40 || (s[3] ^ 0x80) >= 0x40
+ || (c == 0xF0 && s[1] < 0x90) || (c == 0xF4 && s[1] > 0x8F))
+ {
+ return -1;
+ }
+ *nBytes = 4;
+ return ((s[0] & 0x07) << 18) + ((s[1] ^ 0x80) << 12) + ((s[2] ^ 0x80) << 6)
+ + (s[3] ^ 0x80);
+ }
+ else
+ {
+ return -1;
+ }
+}
+/*--------------------------------------------------------------------------*/
+BOOL IsValidUTF8(const char* pStText)
+{
+ const char* s = pStText;
+ while (*s != 0)
+ {
+ int nBytes = 0;
+ if (ReadUTF8Character(s, &nBytes) < 0)
+ {
+ return FALSE;
+ }
+ s += nBytes;
+ }
+
+ return TRUE;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/defaultlanguage.h b/modules/localization/src/c/defaultlanguage.h
new file mode 100755
index 000000000..cd2e288e5
--- /dev/null
+++ b/modules/localization/src/c/defaultlanguage.h
@@ -0,0 +1,24 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __DEFAULTLANGUAGE_H__
+#define __DEFAULTLANGUAGE_H__
+
+/*
+** @TODO : Hard reference to a static array defined in
+** tableslanguages.h seems not to be a very clever idea...
+*/
+
+#define SCILABDEFAULTLANGUAGE "en_US"
+#define SCILABDEFAULTLANGUAGECODE 83
+
+#endif /* !__DEFAULTLANGUAGE_H__ */
diff --git a/modules/localization/src/c/getLcidString.c b/modules/localization/src/c/getLcidString.c
new file mode 100755
index 000000000..29f20ccdf
--- /dev/null
+++ b/modules/localization/src/c/getLcidString.c
@@ -0,0 +1,90 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#include <string.h>
+#include <stdio.h>
+#ifdef _MSC_VER
+#include <Windows.h>
+#include "LocaleNameToLCID_Windows.h"
+#include "strdup_windows.h"
+#endif
+#include "getLcidString.h"
+#include "MALLOC.h"
+#include "charEncoding.h"
+#include "stack-def.h"
+/*--------------------------------------------------------------------------*/
+#define DEFAULT_EN_LCID "0x0409"
+/*--------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+/* replaces '_' by '-' windows local format and convert to wide string */
+static wchar_t *getWindowsLocaleFormat(const char *pStrLocale);
+#endif
+/*--------------------------------------------------------------------------*/
+char *getLcidString(const char *pStrLocale)
+{
+ char *pStrLCID = NULL;
+
+ if (pStrLocale == NULL)
+ {
+ return strdup(DEFAULT_EN_LCID);
+ }
+#ifdef _MSC_VER
+ if ((strcmp(pStrLocale, "") == 0) || (strcmp(pStrLocale, "C") == 0))
+ {
+ return strdup(DEFAULT_EN_LCID);
+ }
+ else
+ {
+ wchar_t *wLocale = getWindowsLocaleFormat(pStrLocale);
+ LCID lcid = dllLocaleNameToLCID(wLocale, 0);
+
+ if (lcid == 0)
+ {
+ pStrLCID = strdup(DEFAULT_EN_LCID);
+ }
+ else
+ {
+ pStrLCID = (char *)MALLOC(sizeof(char) * bsiz);
+ if (pStrLCID)
+ {
+ sprintf(pStrLCID, "0x0%x", lcid);
+ }
+ }
+ }
+#else
+ /* this routines not used on others platforms */
+ pStrLCID = strdup(DEFAULT_EN_LCID);
+#endif
+ return pStrLCID;
+}
+/*--------------------------------------------------------------------------*/
+#ifdef _MSC_VER
+static wchar_t *getWindowsLocaleFormat(const char *pStrLocale)
+{
+ wchar_t *Locale = NULL;
+ if (pStrLocale)
+ {
+ wchar_t *pwStrLocale = to_wide_string(pStrLocale);
+ if (pwStrLocale)
+ {
+ wchar_t *pos = wcschr(pwStrLocale, L'_');
+ if (pos)
+ {
+ *pos = L'-';
+ }
+ Locale = pwStrLocale;
+ }
+ }
+ return Locale;
+}
+#endif
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/getLcidString.h b/modules/localization/src/c/getLcidString.h
new file mode 100755
index 000000000..5f7b8e09d
--- /dev/null
+++ b/modules/localization/src/c/getLcidString.h
@@ -0,0 +1,26 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+/*--------------------------------------------------------------------------*/
+#ifndef __GETLCIDSTRING_H__
+#define __GETLCIDSTRING_H__
+
+/**
+* convert Locale name to LCID string
+* used by CHM
+* http://msdn.microsoft.com/en-us/library/0h88fahh(VS.85).aspx
+* @param[in] locale name ex: en_US
+* @return LCID string ex: 0x0409
+*/
+char *getLcidString(const char *pStrLocale);
+
+#endif /* __GETLCIDSTRING_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/getLocaleInfo_Apple.c b/modules/localization/src/c/getLocaleInfo_Apple.c
new file mode 100755
index 000000000..3caa2d523
--- /dev/null
+++ b/modules/localization/src/c/getLocaleInfo_Apple.c
@@ -0,0 +1,33 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include <CoreFoundation/CoreFoundation.h>
+#include "getLocaleInfo_Apple.h"
+
+char *getLocaleUserInfo(void)
+{
+ char *cUserLanguage = NULL;
+ CFLocaleRef userLocaleRef = CFLocaleCopyCurrent();
+ CFStringRef userLanguage = CFLocaleGetIdentifier(userLocaleRef);
+
+ if (getenv( "LANG" ))
+ {
+ /* Mac OS X does not respect the LANG variable. We do it ourself. */
+ return getenv("LANG");
+ }
+ else
+ {
+ cUserLanguage = (char *) malloc(((int) CFStringGetLength(userLanguage) + 1) * sizeof(char));
+ CFStringGetCString(userLanguage, cUserLanguage, ((int) CFStringGetLength(userLanguage)) + 1, kCFStringEncodingUTF8);
+ }
+ return cUserLanguage;
+}
diff --git a/modules/localization/src/c/getLocaleInfo_Apple.h b/modules/localization/src/c/getLocaleInfo_Apple.h
new file mode 100755
index 000000000..ac9c34d48
--- /dev/null
+++ b/modules/localization/src/c/getLocaleInfo_Apple.h
@@ -0,0 +1,22 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2009-2009 - DIGITEO - Bruno JOFRET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __GETLOCALEINFO_APPLE_H__
+#define __GETLOCALEINFO_APPLE_H__
+
+/**
+* returns user locale string
+* @return Locale user example fr_FR or en_US
+*/
+char *getLocaleUserInfo(void);
+
+#endif __GETLOCALEINFO_APPLE_H__
diff --git a/modules/localization/src/c/getLocaleInfo_Windows.c b/modules/localization/src/c/getLocaleInfo_Windows.c
new file mode 100755
index 000000000..468765337
--- /dev/null
+++ b/modules/localization/src/c/getLocaleInfo_Windows.c
@@ -0,0 +1,105 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Allan CORNET
+ * Copyright (C) 2008 - Yung-Jang Lee
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+#include <windows.h>
+#include <stdio.h>
+#include "getLocaleInfo_Windows.h"
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+char* getLocaleSystemInfo(void)
+{
+#define LENGTH_BUFFER 1024
+ char buffer_LOCALE_SISO639LANGNAME[LENGTH_BUFFER];
+ char buffer_LOCALE_SISO3166CTRYNAME[LENGTH_BUFFER];
+ char *localeStr = NULL;
+ int ret = 0;
+ ret = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,
+ LOCALE_SISO639LANGNAME,
+ &buffer_LOCALE_SISO639LANGNAME[0],
+ LENGTH_BUFFER);
+ if (ret > 0)
+ {
+ ret = GetLocaleInfo(LOCALE_SYSTEM_DEFAULT,
+ LOCALE_SISO3166CTRYNAME,
+ &buffer_LOCALE_SISO3166CTRYNAME[0],
+ LENGTH_BUFFER);
+ if (ret > 0)
+ {
+ int length_localeStr = (int)(strlen(buffer_LOCALE_SISO639LANGNAME) +
+ strlen(buffer_LOCALE_SISO3166CTRYNAME) +
+ strlen("_"));
+ localeStr = (char*)MALLOC(sizeof(char) * (length_localeStr) + 1);
+ if (localeStr)
+ {
+#ifdef FORMAT_LOCALE
+#undef FORMAT_LOCALE
+#endif
+#define FORMAT_LOCALE "%s_%s"
+ sprintf(localeStr, FORMAT_LOCALE, buffer_LOCALE_SISO639LANGNAME, buffer_LOCALE_SISO3166CTRYNAME);
+ }
+ }
+ }
+ return localeStr;
+}
+/*--------------------------------------------------------------------------*/
+char* getLocaleUserInfo(void)
+{
+#define LENGTH_BUFFER 1024
+ char buffer_LOCALE_SISO639LANGNAME[LENGTH_BUFFER];
+ char buffer_LOCALE_SISO3166CTRYNAME[LENGTH_BUFFER];
+ char buffer_LOCALE_IDEFAULTANSICODEPAGE[LENGTH_BUFFER];
+ char *localeStr = NULL;
+ int ret = 0;
+ ret = GetLocaleInfo(LOCALE_USER_DEFAULT,
+ LOCALE_SISO639LANGNAME,
+ &buffer_LOCALE_SISO639LANGNAME[0],
+ LENGTH_BUFFER);
+ if (ret > 0)
+ {
+
+ ret = GetLocaleInfo(LOCALE_USER_DEFAULT,
+ LOCALE_SISO3166CTRYNAME,
+ &buffer_LOCALE_SISO3166CTRYNAME[0],
+ LENGTH_BUFFER);
+ if (ret > 0)
+ {
+ // BY YJLee get Windows CODE Page Information
+ int ret = GetLocaleInfo(LOCALE_USER_DEFAULT,
+ LOCALE_IDEFAULTANSICODEPAGE,
+ &buffer_LOCALE_IDEFAULTANSICODEPAGE[0],
+ LENGTH_BUFFER);
+
+ int length_localeStr = (int)(strlen(buffer_LOCALE_SISO639LANGNAME) +
+ strlen(buffer_LOCALE_SISO3166CTRYNAME) +
+ strlen(buffer_LOCALE_IDEFAULTANSICODEPAGE) +
+ strlen("_.CP") );
+ localeStr = (char*)MALLOC(sizeof(char) * (length_localeStr) + 1);
+ if (localeStr)
+ {
+#ifdef FORMAT_LOCALE
+#undef FORMAT_LOCALE
+#endif
+#define FORMAT_LOCALE "%s_%s.CP%s"
+ // in lang_contry.CPxxx format
+ sprintf(localeStr, FORMAT_LOCALE,
+ buffer_LOCALE_SISO639LANGNAME,
+ buffer_LOCALE_SISO3166CTRYNAME,
+ buffer_LOCALE_IDEFAULTANSICODEPAGE
+ );
+ }
+ }
+ }
+ return localeStr;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/getLocaleInfo_Windows.h b/modules/localization/src/c/getLocaleInfo_Windows.h
new file mode 100755
index 000000000..be54fa994
--- /dev/null
+++ b/modules/localization/src/c/getLocaleInfo_Windows.h
@@ -0,0 +1,32 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+
+#ifndef __GETLOCALINFO_WINDOWS_H__
+#define __GETLOCALINFO_WINDOWS_H__
+
+/**
+* returns user locale string
+* @return Locale user example fr_FR or en_US
+*/
+char* getLocaleUserInfo(void);
+
+/**
+* returns system locale string
+* @return Locale system example fr_FR or en_US
+*/
+char* getLocaleSystemInfo(void);
+
+#endif /* __GETLOCALINFO_WINDOWS_H__ */
+
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/getentrieshashtable.c b/modules/localization/src/c/getentrieshashtable.c
new file mode 100755
index 000000000..9c05aa7c5
--- /dev/null
+++ b/modules/localization/src/c/getentrieshashtable.c
@@ -0,0 +1,125 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include "getentrieshashtable.h"
+#include "hashtable_private.h"
+#include "MALLOC.h"
+#include "hashtable_localization.h"
+/*--------------------------------------------------------------------------*/
+char **getTAGSinhashtable(struct hashtable *tableIN, int *numbersEntries)
+{
+ char **return_entries = NULL;
+ unsigned int i = 0;
+ unsigned int j = 0;
+ struct entry *e = NULL;
+ struct entry **table = tableIN->table;
+
+ *numbersEntries = tableIN->entrycount;
+ if (*numbersEntries > 0)
+ {
+ return_entries = (char **)MALLOC(sizeof(char *) * tableIN->entrycount);
+ if (return_entries)
+ {
+ j = 0;
+ for (i = 0; i < tableIN->tablelength; i++)
+ {
+ e = table[i];
+ while (NULL != e)
+ {
+ struct key_string *Key = NULL;
+ Key = e->k;
+ return_entries[j] = (char *)MALLOC(sizeof(char) * (strlen(Key->Key_String) + 1));
+ if (return_entries[j])
+ {
+ strcpy(return_entries[j], Key->Key_String);
+ }
+ e = e->next;
+ j++;
+ }
+ }
+ }
+ }
+ return return_entries;
+}
+/*--------------------------------------------------------------------------*/
+char **getSTRINGSinhashtable(struct hashtable *tableIN, int *numbersEntries)
+{
+ char **return_entries = NULL;
+ unsigned int i = 0;
+ unsigned int j = 0;
+ struct entry *e = NULL;
+ struct entry **table = tableIN->table;
+
+ *numbersEntries = tableIN->entrycount;
+ if (*numbersEntries > 0)
+ {
+ return_entries = (char **)MALLOC(sizeof(char *) * tableIN->entrycount);
+ if (return_entries)
+ {
+ j = 0;
+ for (i = 0; i < tableIN->tablelength; i++)
+ {
+ e = table[i];
+ while (NULL != e)
+ {
+ struct value_string *Key = NULL;
+ Key = e->v;
+ return_entries[j] = (char *)MALLOC(sizeof(char) * (strlen(Key->Value_String) + 1));
+ if (return_entries[j])
+ {
+ strcpy(return_entries[j], Key->Value_String);
+ }
+ e = e->next;
+ j++;
+ }
+ }
+ }
+ }
+ return return_entries;
+}
+/*--------------------------------------------------------------------------*/
+char **getPATHSinhashtable(struct hashtable *tableIN, int *numbersEntries)
+{
+ char **return_entries = NULL;
+ unsigned int i = 0;
+ unsigned int j = 0;
+ struct entry *e = NULL;
+ struct entry **table = tableIN->table;
+
+ *numbersEntries = tableIN->entrycount;
+ if (*numbersEntries > 0)
+ {
+ return_entries = (char **)MALLOC(sizeof(char *) * tableIN->entrycount);
+ if (return_entries)
+ {
+ j = 0;
+ for (i = 0; i < tableIN->tablelength; i++)
+ {
+ e = table[i];
+ while (NULL != e)
+ {
+ struct value_string *Key = NULL;
+ Key = e->v;
+ return_entries[j] = (char *)MALLOC(sizeof(char) * (strlen(Key->Path_String) + 1));
+ if (return_entries[j])
+ {
+ strcpy(return_entries[j], Key->Path_String);
+ }
+ e = e->next;
+ j++;
+ }
+ }
+ }
+ }
+ return return_entries;
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/getentrieshashtable.h b/modules/localization/src/c/getentrieshashtable.h
new file mode 100755
index 000000000..4fa6c0de6
--- /dev/null
+++ b/modules/localization/src/c/getentrieshashtable.h
@@ -0,0 +1,25 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __GETENTRIESHASHTABLE_H__
+#define __GETENTRIESHASHTABLE_H__
+
+#include <string.h>
+#include "hashtable.h"
+
+/* get an array of strings from hastable tableIN */
+char **getTAGSinhashtable(struct hashtable *tableIN, int *numbersEntries);
+char **getSTRINGSinhashtable(struct hashtable *tableIN, int *numbersEntries);
+char **getPATHSinhashtable(struct hashtable *tableIN, int *numbersEntries);
+
+#endif
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/hashtable_localization.h b/modules/localization/src/c/hashtable_localization.h
new file mode 100755
index 000000000..add1ccac3
--- /dev/null
+++ b/modules/localization/src/c/hashtable_localization.h
@@ -0,0 +1,50 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2006 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __HASHTABLE_LOCALIZATION_H__
+#define __HASHTABLE_LOCALIZATION_H__
+/*--------------------------------------------------------------------------*/
+#include <stdlib.h>
+#include "hashtable.h"
+#include "BOOL.h" /* BOOL */
+#include "MALLOC.h"
+/*--------------------------------------------------------------------------*/
+struct key_string
+{
+ char *Key_String;
+};
+/*--------------------------------------------------------------------------*/
+struct value_string
+{
+ char *Value_String;
+ char *Path_String;
+};
+/*--------------------------------------------------------------------------*/
+/**
+ * create a hashtable and return it
+ */
+struct hashtable *CreateHashtable_string(void);
+
+/* destroy the hashtable and clean the resources used */
+void DestroyHashtable_string(struct hashtable *hash_table);
+
+/* search a key in a hashtable. if succeed, return the value needed. if failed, return NULL */
+char *SearchHashtable_string(struct hashtable *hash_table, const char* key);
+
+/* Insert a element in Hashtable */
+int InsertHashtable_string(struct hashtable *hash_table, struct key_string *k, struct value_string *v);
+
+/* Remove a element in Hastable */
+BOOL RemoveHastable_string(struct hashtable *hash_table, const char* key);
+/*--------------------------------------------------------------------------*/
+#endif /* __HASHTABLE_LOCALIZATION_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/libscilocalization_algo_la-InitializeLocalization.lo b/modules/localization/src/c/libscilocalization_algo_la-InitializeLocalization.lo
new file mode 100755
index 000000000..bb2047d6d
--- /dev/null
+++ b/modules/localization/src/c/libscilocalization_algo_la-InitializeLocalization.lo
@@ -0,0 +1,12 @@
+# src/c/libscilocalization_algo_la-InitializeLocalization.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-InitializeLocalization.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/c/libscilocalization_algo_la-charEncoding.lo b/modules/localization/src/c/libscilocalization_algo_la-charEncoding.lo
new file mode 100755
index 000000000..fa0d141bd
--- /dev/null
+++ b/modules/localization/src/c/libscilocalization_algo_la-charEncoding.lo
@@ -0,0 +1,12 @@
+# src/c/libscilocalization_algo_la-charEncoding.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-charEncoding.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/c/libscilocalization_algo_la-getLcidString.lo b/modules/localization/src/c/libscilocalization_algo_la-getLcidString.lo
new file mode 100755
index 000000000..4fd4c9f52
--- /dev/null
+++ b/modules/localization/src/c/libscilocalization_algo_la-getLcidString.lo
@@ -0,0 +1,12 @@
+# src/c/libscilocalization_algo_la-getLcidString.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-getLcidString.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/c/libscilocalization_algo_la-setdefaultlanguage.lo b/modules/localization/src/c/libscilocalization_algo_la-setdefaultlanguage.lo
new file mode 100755
index 000000000..743708b66
--- /dev/null
+++ b/modules/localization/src/c/libscilocalization_algo_la-setdefaultlanguage.lo
@@ -0,0 +1,12 @@
+# src/c/libscilocalization_algo_la-setdefaultlanguage.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-setdefaultlanguage.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/c/libscilocalization_algo_la-setgetlanguage.lo b/modules/localization/src/c/libscilocalization_algo_la-setgetlanguage.lo
new file mode 100755
index 000000000..e64a42c2d
--- /dev/null
+++ b/modules/localization/src/c/libscilocalization_algo_la-setgetlanguage.lo
@@ -0,0 +1,12 @@
+# src/c/libscilocalization_algo_la-setgetlanguage.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-setgetlanguage.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/c/loadhashtableslocalization.h b/modules/localization/src/c/loadhashtableslocalization.h
new file mode 100755
index 000000000..7a78a876f
--- /dev/null
+++ b/modules/localization/src/c/loadhashtableslocalization.h
@@ -0,0 +1,21 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+/*--------------------------------------------------------------------------*/
+/**
+* load hash tables for localization
+* @param language the name of the language
+* @return if the operation successed or not
+*/
+BOOL LoadHashTablesLocalization(char *language);
+
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/setdefaultlanguage.c b/modules/localization/src/c/setdefaultlanguage.c
new file mode 100755
index 000000000..22e287333
--- /dev/null
+++ b/modules/localization/src/c/setdefaultlanguage.c
@@ -0,0 +1,46 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifdef _MSC_VER
+#include "setgetlanguage.h"
+#include "LanguagePreferences_Windows.h"
+#include "string.h"
+#endif
+
+/*--------------------------------------------------------------------------*/
+void setdefaultlanguage(char * lang)
+{
+
+#ifdef _MSC_VER
+ char *savedLanguage = getLanguagePreferences();
+ if (strcmp(lang, savedLanguage))
+ {
+ if (setlanguage(lang))
+ {
+ setLanguagePreferences();
+ }
+ }
+#endif
+
+}
+/*--------------------------------------------------------------------------*/
+char * getdefaultlanguage(void)
+{
+
+#ifdef _MSC_VER
+ return getLanguagePreferences();
+#else
+ return "";
+#endif
+
+}
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/setgetlanguage.c b/modules/localization/src/c/setgetlanguage.c
new file mode 100755
index 000000000..1125bdc3a
--- /dev/null
+++ b/modules/localization/src/c/setgetlanguage.c
@@ -0,0 +1,413 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007-2008 - INRIA - Sylvestre LEDRU
+ * Copyright (C) 2007-2008 - INRIA - Allan CORNET
+ * Copyright (C) 2008 - Yung-Jang Lee
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#include <string.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "machine.h" /* HAVE_LIBINTL_H & HAVE_LOCALE_H */
+
+#ifndef _MSC_VER
+#ifdef __APPLE__
+#include <locale.h>
+#else
+#ifdef HAVE_LIBINTL_H
+#include <libintl.h>
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#else
+#error "Cannot find locale.h despite that libintl.h is available"
+#endif
+#endif
+#endif
+#else
+#include <locale.h>
+#include <libintl.h>
+#endif
+
+#ifdef _MSC_VER
+#include <windows.h>
+#include "getLocaleInfo_Windows.h"
+#endif
+#ifdef __APPLE__
+#include "getLocaleInfo_Apple.h"
+#endif
+
+#include "setgetlanguage.h"
+#include "MALLOC.h"
+#include "tableslanguages.h"
+#include "defaultlanguage.h"
+#include "scilabDefaults.h"
+#include "../../../io/includes/setenvc.h"
+
+/*--------------------------------------------------------------------------*/
+static char CURRENTLANGUAGESTRING[LengthAlphacode] = SCILABDEFAULTLANGUAGE;
+static int CURRENTLANGUAGECODE = SCILABDEFAULTLANGUAGECODE;
+
+/*--------------------------------------------------------------------------*/
+static int FindLanguageCode(char *lang);
+static BOOL setlanguagecode(char *lang);
+static char *FindAlias(char *lang);
+static char *GetLanguageFromAlias(char *langAlias);
+
+/*--------------------------------------------------------------------------*/
+BOOL setlanguage(char *lang)
+{
+ if (lang)
+ {
+ if (LanguageIsOK(lang))
+ {
+#ifndef _MSC_VER
+ if (needtochangelanguage(lang))
+ {
+#endif
+ /* Load the locale from the system */
+#if !defined(_MSC_VER)
+ //for mbstowcs
+ char *newlang = NULL;
+#ifdef __APPLE__
+ /* Load the user locale from the system */
+ if (lang == NULL || *lang == 0)
+ {
+ lang = getLocaleUserInfo();
+ }
+#endif
+
+ char *ret = setlocale(LC_CTYPE, lang);
+ if (ret == NULL)
+ {
+ if (lang == NULL || *lang == 0)
+ {
+ lang = getenv("LANG");
+ }
+ ret = setlocale(LC_CTYPE, lang);
+ if (ret == NULL)
+ {
+ // On some OSes we need to precise the charset (e.g. on Debian, fr_FR is not accepted but fr_FR.UTF-8 is)
+ int i = 0;
+ for (; i < NumberOfCharsets; i++)
+ {
+ newlang = (char*)MALLOC(strlen(lang) + strlen(CHARSETS[i]) + 1 + 1);
+ sprintf(newlang, "%s.%s", lang, CHARSETS[i]);
+ ret = setlocale(LC_CTYPE, newlang);
+ if (ret == NULL)
+ {
+ FREE(newlang);
+ newlang = NULL;
+ }
+ else
+ {
+ break;
+ }
+ }
+ }
+ }
+
+ if (ret == NULL)
+ {
+ fprintf(stderr,
+ "Warning: Localization issue. Failed to change the LC_CTYPE locale category. Does not support the locale '%s' %s %s.\nDid you install the system locales?\n",
+ lang, ret, setlocale(LC_CTYPE, NULL));
+ }
+
+ //for gettext
+ if (newlang)
+ {
+ ret = setlocale(LC_MESSAGES, newlang);
+ }
+ else
+ {
+ ret = setlocale(LC_MESSAGES, lang);
+ }
+#else
+ /* Load the user locale from the system */
+ char *ret = getLocaleUserInfo();
+#endif
+
+ // This stuff causes pb when locales have been compiled
+ if (ret == NULL)
+ {
+#ifndef _MSC_VER
+ fprintf(stderr, "Warning: Localization issue. Does not support the locale '%s'\nReturned: %s\nCurrent system locale: %s\nDid you install the system locales?\n", lang,
+ ret, setlocale(LC_MESSAGES, NULL));
+#else
+ fprintf(stderr, "Warning: Localization issue. Cannot detect user locale.\n");
+#endif
+ }
+
+ /* change language */
+ if (strcmp(lang, "C") == 0 || ret == NULL || strcmp(ret, "C") == 0)
+ {
+ /* The lang is the default one... ie en_US */
+ strcpy(CURRENTLANGUAGESTRING, SCILABDEFAULTLANGUAGE);
+ exportLocaleToSystem(CURRENTLANGUAGESTRING);
+ }
+ else
+ {
+ if (strcmp(lang, "") == 0)
+ {
+ /* The requested language is the one of the system ...
+ * which we don't really know which one is it
+ * but if setlocale worked, we get it from the return
+ */
+ strncpy(CURRENTLANGUAGESTRING, ret, 5); /* 5 is the number of char in fr_FR for example */
+ exportLocaleToSystem(ret);
+ }
+ else
+ {
+#if !defined(_MSC_VER)
+ if (newlang)
+ {
+ setenvc("LANG", newlang);
+ strncpy(CURRENTLANGUAGESTRING, newlang, 5);
+ exportLocaleToSystem(newlang);
+ }
+ else
+#endif
+ {
+
+ strcpy(CURRENTLANGUAGESTRING, lang);
+ exportLocaleToSystem(lang);
+ }
+ }
+ }
+#ifndef _MSC_VER
+ setlanguagecode(CURRENTLANGUAGESTRING);
+#ifndef __APPLE__
+ if (newlang)
+ {
+ FREE(newlang);
+ }
+#endif
+#endif
+
+ return TRUE;
+ }
+#ifndef _MSC_VER
+ }
+#endif
+ }
+ return FALSE;
+}
+
+/*--------------------------------------------------------------------------*/
+char *getlanguage(void)
+{
+ return CURRENTLANGUAGESTRING;
+}
+
+/*--------------------------------------------------------------------------*/
+int getcurrentlanguagecode(void)
+{
+ return CURRENTLANGUAGECODE;
+}
+
+/*--------------------------------------------------------------------------*/
+char *getlanguagefromcode(int code)
+{
+ int i = 0;
+
+ for (i = 0; i < NumberLanguages; i++)
+ {
+ if (LANGUAGE_COUNTRY_TAB[i].code == code)
+ {
+ return LANGUAGE_COUNTRY_TAB[i].alphacode;
+ }
+ }
+ return NULL;
+}
+
+/*--------------------------------------------------------------------------*/
+int getcodefromlanguage(char *language)
+{
+ return FindLanguageCode(language);
+}
+
+/*--------------------------------------------------------------------------*/
+BOOL LanguageIsOK(char *lang)
+{
+ int i = 0;
+
+ if (strlen(lang) == 0)
+ {
+ /* Empty language declaration... it is the default
+ * language from the system */
+ return TRUE;
+ }
+
+ for (i = 0; i < NumberLanguages; i++)
+ {
+ if (strcmp(lang, LANGUAGE_COUNTRY_TAB[i].alphacode) == 0)
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
+
+/*--------------------------------------------------------------------------*/
+static int FindLanguageCode(char *lang)
+{
+ int i = 0;
+
+ for (i = 0; i < NumberLanguages; i++)
+ {
+ if (strcmp(lang, LANGUAGE_COUNTRY_TAB[i].alphacode) == 0)
+ {
+ return LANGUAGE_COUNTRY_TAB[i].code;
+ }
+ }
+ return -1;
+}
+
+/*--------------------------------------------------------------------------*/
+static BOOL setlanguagecode(char *lang)
+{
+ int tmpCode = FindLanguageCode(lang);
+
+ if (tmpCode > 0)
+ {
+ CURRENTLANGUAGECODE = tmpCode;
+ return TRUE;
+ }
+ return FALSE;
+}
+
+/*--------------------------------------------------------------------------*/
+static char *FindAlias(char *lang)
+{
+ int i = 0;
+
+ for (i = 0; i < NumberLanguagesAlias; i++)
+ {
+ if (strcmp(LANGUAGE_LOCALE_ALIAS[i].alphacode, lang) == 0)
+ {
+ return LANGUAGE_LOCALE_ALIAS[i].alias;
+ }
+ }
+ return NULL;
+}
+
+/*--------------------------------------------------------------------------*/
+static char *GetLanguageFromAlias(char *langAlias)
+{
+ int i = 0;
+
+ for (i = 0; i < NumberLanguagesAlias; i++)
+ {
+ if (strcmp(LANGUAGE_LOCALE_ALIAS[i].alias, langAlias) == 0)
+ {
+ return LANGUAGE_LOCALE_ALIAS[i].alphacode;
+ }
+ }
+ return NULL;
+}
+
+/*--------------------------------------------------------------------------*/
+char *getlanguagealias(void)
+{
+ return FindAlias(CURRENTLANGUAGESTRING);
+}
+
+/*--------------------------------------------------------------------------*/
+BOOL needtochangelanguage(char *language)
+{
+ char *currentlanguage = getlanguage();
+
+ if (strcmp(language, currentlanguage))
+ {
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+/*--------------------------------------------------------------------------*/
+char *convertlanguagealias(char *strlanguage)
+{
+ char *correctlanguage = NULL;
+
+ if ((strlen(strlanguage) == 2) || (strcmp(strlanguage, "en_US") == 0)) /* If the user wants to change to en_US ... use the default locale */
+ {
+ correctlanguage = GetLanguageFromAlias(strlanguage);
+ }
+ else
+ {
+ if (strcmp(strlanguage, "eng") == 0) /* compatibility previous scilab */
+ {
+ correctlanguage = GetLanguageFromAlias("en");
+ }
+ else
+ {
+ if (strlen(strlanguage) == 5 && strlanguage[2] == '_')
+ {
+ /* already xx_XX (fr_FR) */
+ return strlanguage;
+ }
+ }
+ }
+ return correctlanguage;
+}
+
+/*--------------------------------------------------------------------------*/
+/**
+ * Export the variable LC_XXXX to the system
+ *
+ * @param locale the locale (ex : fr_FR or en_US)
+ */
+BOOL exportLocaleToSystem(char *locale)
+{
+
+ if (locale == NULL)
+ {
+#ifdef _MSC_VER
+ fprintf(stderr, "Localization: Have not been able to find a suitable locale. Remains to default %s.\n", "LC_CTYPE");
+#else
+ fprintf(stderr, "Localization: Have not been able to find a suitable locale. Remains to default %s.\n", EXPORTENVLOCALESTR);
+#endif
+ return FALSE;
+ }
+
+ /* It will put in the env something like LC_MESSAGES=fr_FR */
+ if (!setenvc(EXPORTENVLOCALESTR, locale))
+ {
+#ifdef _MSC_VER
+ fprintf(stderr, "Localization: Failed to declare the system variable %s.\n", "LC_CTYPE");
+#else
+ fprintf(stderr, "Localization: Failed to declare the system variable %d.\n", EXPORTENVLOCALE);
+#endif
+ return FALSE;
+ }
+
+#ifdef _MSC_VER
+#ifdef USE_SAFE_GETTEXT_DLL
+ {
+ /* gettext is buggy on Windows */
+ /* We need to set a external environment variable to scilab env. */
+
+ char env[MAX_PATH];
+
+ sprintf(env, "%s=%s", EXPORTENVLOCALESTR, locale);
+ gettext_putenv(env);
+ }
+#endif
+#else
+ /* Export LC_NUMERIC to the system to make sure that the rest of system
+ * is using the english notation (Java, Tcl ...) */
+ setenvc("LC_NUMERIC", LCNUMERICVALUE);
+#endif
+
+ return TRUE;
+}
+
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/c/tableslanguages.h b/modules/localization/src/c/tableslanguages.h
new file mode 100755
index 000000000..fe1782889
--- /dev/null
+++ b/modules/localization/src/c/tableslanguages.h
@@ -0,0 +1,324 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2007 - INRIA - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+
+#ifndef __TABLESLANGUAGES_H__
+#define __TABLESLANGUAGES_H__
+/*--------------------------------------------------------------------------*/
+/* See :
+ http://www.unicode.org/cldr
+ http://unicode.org/cldr/data/diff/main/index.html
+ http://inter-locale.com/ID/draft-ietf-ltru-registry-14.html
+*/
+/*--------------------------------------------------------------------------*/
+#define LengthAlphacode 32
+#define LengthAlpha2code 3
+#define LengthLanguage 64
+typedef struct languages_struct
+{
+ int code;
+ char alphacode[LengthAlphacode];
+ char languagedescription[LengthLanguage];
+
+} LanguagesTable;
+/*--------------------------------------------------------------------------*/
+typedef struct languagesalias_struct
+{
+ char alias[LengthAlphacode];
+ char alphacode[LengthAlphacode];
+
+} LanguagesTableAlias;
+/*--------------------------------------------------------------------------*/
+#define NumberLanguagesAlias 42
+static LanguagesTableAlias LANGUAGE_LOCALE_ALIAS[NumberLanguagesAlias] =
+{
+ {"bg", "bg_BG"},
+ {"ca", "ca_ES"},
+ {"cn", "zh_CN"},
+ {"cs", "cs_CZ"},
+ {"cy", "cy_GB"},
+ {"da", "da_DK"},
+ {"de", "de_DE"},
+ {"el", "el_GR"},
+ {"en", "C"}, /* When the user is requesting english ... switch back to the default */
+ {"en_US", "C"},
+ {"es", "es_ES"},
+ {"et", "et_EE"},
+ {"eu", "eu_ES"},
+ {"fa", "fa_IR"},
+ {"fi", "fi_FI"},
+ {"fo", "fo_FO"},
+ {"fr", "fr_FR"},
+ {"he", "he_IL"},
+ {"hr", "hr_HR"},
+ {"hu", "hu_HU"},
+ {"id", "id_ID"},
+ {"is", "is_IS"},
+ {"it", "it_IT"},
+ {"ja", "ja_JP"},
+ {"ko", "ko_KR"},
+ {"lt", "lt_LT"},
+ {"my", "ms_MY"},
+ {"nb", "nb_NO"},
+ {"nl", "nl_NL"},
+ {"pl", "pl_PL"},
+ {"pt", "pt_PT"},
+ {"ro", "ro_RO"},
+ {"ru", "ru_RU"},
+ {"sk", "sk_SK"},
+ {"sl", "sl_SI"},
+ {"sr", "sr_YU"},
+ {"sv", "sv_SE"},
+ {"th", "th_TH"},
+ {"tl", "tl_PH"},
+ {"tr", "tr_TR"},
+ {"tw", "zh_TW"},
+ {"uk", "uk_UA"}
+};
+/*--------------------------------------------------------------------------*/
+#define NumberLanguages 220
+static LanguagesTable LANGUAGE_COUNTRY_TAB[NumberLanguages] =
+{
+ { 1, "aa_DJ", "Afar (Djibouti)"},
+ { 2, "aa_ER", "Afar (Eritrea)"},
+ { 3, "aa_ER_SAAHO", "Afar (Eritrea, SAAHO)"},
+ { 4, "aa_ET", "Afar (Ethiopia)"},
+ { 5, "af_ZA", "Afrikaans (South Africa)"},
+ { 6, "sq_AL", "Albanian (Albania)"},
+ { 7, "am_ET", "Amharic (Ethiopia)"},
+ { 8, "ar_DZ", "Arabic (Algeria)"},
+ { 9, "ar_BH", "Arabic (Bahrain)"},
+ { 10, "ar_EG", "Arabic (Egypt)"},
+ { 11, "ar_IQ", "Arabic (Iraq)"},
+ { 12, "ar_JO", "Arabic (Jordan)"},
+ { 13, "ar_KW", "Arabic (Kuwait)"},
+ { 14, "ar_LB", "Arabic (Lebanon)"},
+ { 15, "ar_LY", "Arabic (Libya)"},
+ { 16, "ar_MA", "Arabic (Morocco)"},
+ { 17, "ar_OM", "Arabic (Oman)"},
+ { 18, "ar_QA", "Arabic (Qatar)"},
+ { 19, "ar_SA", "Arabic (Saudi Arabia)"},
+ { 20, "ar_SD", "Arabic (Sudan)"},
+ { 21, "ar_SY", "Arabic (Syria)"},
+ { 22, "ar_TN", "Arabic (Tunisia)"},
+ { 23, "ar_AE", "Arabic (United Arab Emirates)"},
+ { 24, "ar_YE", "Arabic (Yemen)"},
+ { 25, "hy_AM", "Armenian (Armenia)"},
+ { 26, "hy_AM_REVISED", "Armenian (Armenia, Revised Orthography)"},
+ { 27, "as_IN", "Assamese (India)"},
+ { 28, "az_AZ", "Azerbaijani (Azerbaijan)"},
+ { 29, "az_Cyrl_AZ", "Azerbaijani (Cyrillic, Azerbaijan)"},
+ { 30, "az_Latn_AZ", "Azerbaijani (Latin, Azerbaijan)"},
+ { 31, "az_Cyrl", "Azerbaijani (Cyrillic)"},
+ { 32, "az_Latn", "Azerbaijani (Latin)"},
+ { 33, "eu_ES", "Basque (Spain)"},
+ { 34, "be_BY", "Belarusian (Belarus)"},
+ { 35, "bn_IN", "Bengali (India)"},
+ { 36, "byn_ER", "Blin (Eritrea)"},
+ { 37, "bs_BA", "Bosnian (Bosnia and Herzegovina)"},
+ { 38, "bg_BG", "Bulgarian (Bulgaria)"},
+ { 39, "ca_ES", "Catalan (Spain)"},
+ { 40, "zh_CN", "Chinese (China)"},
+ { 41, "zh_Hans_CN", "Chinese (Simplified Han, China)"},
+ { 42, "zh_HK", "Chinese (Hong Kong S.A.R., China)"},
+ { 43, "zh_Hant_HK", "Chinese (Traditional Han, Hong Kong S.A.R., China)"},
+ { 44, "zh_Hant_MO", "Chinese (Traditional Han, Macao S.A.R., China)"},
+ { 45, "zh_MO", "Chinese (Macao S.A.R., China)"},
+ { 46, "zh_Hans_SG", "Chinese (Simplified Han, Singapore)"},
+ { 47, "zh_SG", "Chinese (Singapore)"},
+ { 48, "zh_Hant_TW", "Chinese (Traditional Han, Taiwan)"},
+ { 49, "zh_TW", "Chinese (Taiwan)"},
+ { 50, "zh_Hans", "Chinese (Simplified Han)"},
+ { 51, "zh_Hant", "Chinese (Traditional Han)"},
+ { 52, "kw_GB", "Cornish (United Kingdom)"},
+ { 53, "hr_HR", "Croatian (Croatia)"},
+ { 54, "cs_CZ", "Czech (Czech Republic)"},
+ { 55, "da_DK", "Danish (Denmark)"},
+ { 56, "dv_MV", "Divehi (Maldives)"},
+ { 57, "nl_BE", "Dutch (Belgium)"},
+ { 58, "nl_NL", "Dutch (Netherlands)"},
+ { 59, "dz_BT", "Dzongkha (Bhutan)"},
+ { 60, "en_AS", "English (American Samoa)"},
+ { 61, "en_AU", "English (Australia)"},
+ { 62, "en_BE", "English (Belgium)"},
+ { 63, "en_BZ", "English (Belize)"},
+ { 64, "en_BW", "English (Botswana)"},
+ { 65, "en_CA", "English (Canada)"},
+ { 66, "en_GU", "English (Guam)"},
+ { 67, "en_HK", "English (Hong Kong S.A.R., China)"},
+ { 68, "en_IN", "English (India)"},
+ { 69, "en_IE", "English (Ireland)"},
+ { 70, "en_JM", "English (Jamaica)"},
+ { 71, "en_MT", "English (Malta)"},
+ { 72, "en_MH", "English (Marshall Islands)"},
+ { 73, "en_NZ", "English (New Zealand)"},
+ { 74, "en_MP", "English (Northern Mariana Islands)"},
+ { 75, "en_PK", "English (Pakistan)"},
+ { 76, "en_PH", "English (Philippines)"},
+ { 77, "en_SG", "English (Singapore)"},
+ { 78, "en_ZA", "English (South Africa)"},
+ { 79, "en_TT", "English (Trinidad and Tobago)"},
+ { 80, "en_VI", "English (U.S. Virgin Islands)"},
+ { 81, "en_GB", "English (United Kingdom)"},
+ { 82, "en_UM", "English (United States Minor Outlying Islands)"},
+ { 83, "en_US", "English (United States)"},
+ { 84, "en_US_POSIX", "English (United States, Computer)"},
+ { 85, "en_ZW", "English (Zimbabwe)"},
+ { 86, "et_EE", "Estonian (Estonia)"},
+ { 87, "fo_FO", "Faroese (Faroe Islands)"},
+ { 88, "fi_FI", "Finnish (Finland)"},
+ { 89, "fr_BE", "French (Belgium)"},
+ { 90, "fr_CA", "French (Canada)"},
+ { 91, "fr_FR", "French (France)"},
+ { 92, "fr_LU", "French (Luxembourg)"},
+ { 93, "fr_MC", "French (Monaco)"},
+ { 94, "fr_CH", "French (Switzerland)"},
+ { 95, "gl_ES", "Gallegan (Spain)"},
+ { 96, "gez_ER", "Geez (Eritrea)"},
+ { 97, "gez_ET", "Geez (Ethiopia)"},
+ { 98, "ka_GE", "Georgian (Georgia)"},
+ { 99, "de_AT", "German (Austria)"},
+ { 100, "de_BE", "German (Belgium)"},
+ { 101, "de_DE", "German (Germany)"},
+ { 102, "de_LI", "German (Liechtenstein)"},
+ { 103, "de_LU", "German (Luxembourg)"},
+ { 104, "de_CH", "German (Switzerland)"},
+ { 105, "el_CY", "Greek (Cyprus)"},
+ { 106, "el_GR", "Greek (Greece)"},
+ { 107, "el_POLYTONI", "Greek (POLYTONI)"},
+ { 108, "gu_IN", "Gujarati (India)"},
+ { 109, "haw_US", "Hawaiian (United States)"},
+ { 110, "he_IL", "Hebrew (Israel)"},
+ { 111, "hi_IN", "Hindi (India)"},
+ { 112, "hu_HU", "Hungarian (Hungary)"},
+ { 113, "is_IS", "Icelandic (Iceland)"},
+ { 114, "id_ID", "Indonesian (Indonesia)"},
+ { 115, "ga_IE", "Irish (Ireland)"},
+ { 116, "it_IT", "Italian (Italy)"},
+ { 117, "it_CH", "Italian (Switzerland)"},
+ { 118, "ja_JP", "Japanese (Japan)"},
+ { 119, "kl_GL", "Kalaallisut (Greenland)"},
+ { 120, "kn_IN", "Kannada (India)"},
+ { 121, "kk_KZ", "Kazakh (Kazakhstan)"},
+ { 122, "km_KH", "Khmer (Cambodia)"},
+ { 123, "ky_KG", "Kirghiz (Kyrgyzstan)"},
+ { 124, "kok_IN", "Konkani (India)"},
+ { 125, "ko_KR", "Korean (South Korea)"},
+ { 126, "lo_LA", "Lao (Laos)"},
+ { 127, "lv_LV", "Latvian (Latvia)"},
+ { 128, "lt_LT", "Lithuanian (Lithuania)"},
+ { 129, "mk_MK", "Macedonian (Macedonia)"},
+ { 130, "ms_BN", "Malay (Brunei)"},
+ { 131, "ms_MY", "Malay (Malaysia)"},
+ { 132, "ml_IN", "Malayalam (India)"},
+ { 133, "mt_MT", "Maltese (Malta)"},
+ { 134, "gv_GB", "Manx (United Kingdom)"},
+ { 135, "mr_IN", "Marathi (India)"},
+ { 136, "mn_MN", "Mongolian (Mongolia)"},
+ { 137, "nb_NO", "Norwegian Bokmål (Norway)"},
+ { 138, "nn_NO", "Norwegian Nynorsk (Norway)"},
+ { 139, "or_IN", "Oriya (India)"},
+ { 140, "om_ET", "Oromo (Ethiopia)"},
+ { 141, "om_KE", "Oromo (Kenya)"},
+ { 142, "ps_AF", "Pashto (Pushto) (Afghanistan)"},
+ { 143, "fa_AF", "Persian (Afghanistan)"},
+ { 144, "fa_IR", "Persian (Iran)"},
+ { 145, "pl_PL", "Polish (Poland)"},
+ { 146, "pt_BR", "Portuguese (Brazil)"},
+ { 147, "pt_PT", "Portuguese (Portugal)"},
+ { 148, "pa_IN", "Punjabi (India)"},
+ { 149, "ro_RO", "Romanian (Romania)"},
+ { 150, "ru_RU", "Russian (Russia)"},
+ { 151, "ru_UA", "Russian (Ukraine)"},
+ { 152, "sa_IN", "Sanskrit (India)"},
+ { 153, "sr_BA", "Serbian (Bosnia and Herzegovina)"},
+ { 154, "sr_Cyrl_BA", "Serbian (Cyrillic, Bosnia and Herzegovina)"},
+ { 155, "sr_Latn_BA", "Serbian (Latin, Bosnia and Herzegovina)"},
+ { 156, "sr_CS", "Serbian (Serbia And Montenegro)"},
+ { 157, "sr_Cyrl_CS", "Serbian (Cyrillic, Serbia And Montenegro)"},
+ { 158, "sr_Latn_CS", "Serbian (Latin, Serbia And Montenegro)"},
+ { 159, "sr_Cyrl_YU", "Serbian (Cyrillic, YU)"},
+ { 160, "sr_Latn_YU", "Serbian (Latin, YU)"},
+ { 161, "sr_YU", "Serbian (YU)"},
+ { 162, "sr_Cyrl", "Serbian (Cyrillic)"},
+ { 163, "sr_Latn", "Serbian (Latin)"},
+ { 164, "sh_BA", "Serbo-Croatian (Bosnia and Herzegovina)"},
+ { 165, "sh_CS", "Serbo-Croatian (Serbia And Montenegro)"},
+ { 166, "sh_YU", "Serbo-Croatian (YU)"},
+ { 167, "sid_ET", "Sidamo (Ethiopia)"},
+ { 168, "sk_SK", "Slovak (Slovakia)"},
+ { 169, "sl_SI", "Slovenian (Slovenia)"},
+ { 170, "so_DJ", "Somali (Djibouti)"},
+ { 171, "so_ET", "Somali (Ethiopia)"},
+ { 172, "so_KE", "Somali (Kenya)"},
+ { 173, "so_SO", "Somali (Somalia)"},
+ { 174, "es_AR", "Spanish (Argentina)"},
+ { 175, "es_BO", "Spanish (Bolivia)"},
+ { 176, "es_CL", "Spanish (Chile)"},
+ { 177, "es_CO", "Spanish (Colombia)"},
+ { 178, "es_CR", "Spanish (Costa Rica)"},
+ { 179, "es_DO", "Spanish (Dominican Republic)"},
+ { 180, "es_EC", "Spanish (Ecuador)"},
+ { 181, "es_SV", "Spanish (El Salvador)"},
+ { 182, "es_GT", "Spanish (Guatemala)"},
+ { 183, "es_HN", "Spanish (Honduras)"},
+ { 184, "es_MX", "Spanish (Mexico)"},
+ { 185, "es_NI", "Spanish (Nicaragua)"},
+ { 186, "es_PA", "Spanish (Panama)"},
+ { 187, "es_PY", "Spanish (Paraguay)"},
+ { 188, "es_PE", "Spanish (Peru)"},
+ { 189, "es_PR", "Spanish (Puerto Rico)"},
+ { 190, "es_ES", "Spanish (Spain)"},
+ { 191, "es_US", "Spanish (United States)"},
+ { 192, "es_UY", "Spanish (Uruguay)"},
+ { 193, "es_VE", "Spanish (Venezuela)"},
+ { 194, "sw_KE", "Swahili (Kenya)"},
+ { 195, "sw_TZ", "Swahili (Tanzania)"},
+ { 196, "sv_FI", "Swedish (Finland)"},
+ { 197, "sv_SE", "Swedish (Sweden)"},
+ { 198, "syr_SY", "Syriac (Syria)"},
+ { 199, "ta_IN", "Tamil (India)"},
+ { 200, "tt_RU", "Tatar (Russia)"},
+ { 201, "te_IN", "Telugu (India)"},
+ { 202, "th_TH", "Thai (Thailand)"},
+ { 203, "tig_ER", "Tigre (Eritrea)"},
+ { 204, "ti_ER", "Tigrinya (Eritrea)"},
+ { 205, "ti_ET", "Tigrinya (Ethiopia)"},
+ { 206, "tr_TR", "Turkish (Turkey)"},
+ { 207, "uk_UA", "Ukrainian (Ukraine)"},
+ { 208, "ur_PK", "Urdu (Pakistan)"},
+ { 209, "uz_AF", "Uzbek (Afghanistan)"},
+ { 210, "uz_Arab_AF", "Uzbek (Arabic, Afghanistan)"},
+ { 211, "uz_Cyrl_UZ", "Uzbek (Cyrillic, Uzbekistan)"},
+ { 212, "uz_Latn_UZ", "Uzbek (Latin, Uzbekistan)"},
+ { 213, "uz_UZ", "Uzbek (Uzbekistan)"},
+ { 214, "uz_Arab", "Uzbek (Arabic)"},
+ { 215, "uz_Cyrl", "Uzbek (Cyrillic)"},
+ { 216, "uz_Latn", "Uzbek (Latin)"},
+ { 217, "vi_VN", "Vietnamese (Vietnam)"},
+ { 218, "wal_ET", "Walamo (Ethiopia)"},
+ { 219, "cy_GB", "Welsh (United Kingdom)"},
+ { 220, "C", "English (Default)"}
+};
+/*--------------------------------------------------------------------------*/
+// Charsets to test when they are mandatory (e.g., on Debian fr_FR is not
+// accepted but fr_FR.UTF-8 is).
+// These two charsets are currently supported by Scilab, this is why there are
+// no other ones.
+#define NumberOfCharsets 2
+static char * CHARSETS[NumberOfCharsets] =
+{
+ "UTF-8",
+ "ISO-8859-1"
+};
+/*--------------------------------------------------------------------------*/
+#endif /* __TABLESLANGUAGES_H__ */
+/*--------------------------------------------------------------------------*/
diff --git a/modules/localization/src/core_Import.def b/modules/localization/src/core_Import.def
new file mode 100755
index 000000000..32fec85c3
--- /dev/null
+++ b/modules/localization/src/core_Import.def
@@ -0,0 +1,22 @@
+LIBRARY core.dll
+
+
+EXPORTS
+
+callFunctionFromGateway
+com_
+getSCIpath
+putlhsvar_
+intersci_
+createvarfromptr_
+stack_
+getrhsvar_
+gettype_
+vstk_
+checklhs_
+checkrhs_
+createvar_
+getWarningMode
+freeArrayOfString
+MyHeapAlloc
+MyHeapFree
diff --git a/modules/localization/src/io_Import.def b/modules/localization/src/io_Import.def
new file mode 100755
index 000000000..05a9f0006
--- /dev/null
+++ b/modules/localization/src/io_Import.def
@@ -0,0 +1,10 @@
+LIBRARY io.dll
+
+
+EXPORTS
+ setenvc
+
+
+
+
+ \ No newline at end of file
diff --git a/modules/localization/src/java/org/scilab/modules/localization/LocaleToLCID.java b/modules/localization/src/java/org/scilab/modules/localization/LocaleToLCID.java
new file mode 100755
index 000000000..e2040f42c
--- /dev/null
+++ b/modules/localization/src/java/org/scilab/modules/localization/LocaleToLCID.java
@@ -0,0 +1,28 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.7
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.localization;
+
+
+/**
+ * @author Allan CORNET
+ * @copyright DIGITEO 2010
+ */
+public class LocaleToLCID {
+
+ /**
+ * Constructor
+ */
+ protected LocaleToLCID() {
+ throw new UnsupportedOperationException();
+ }
+ public static String convert(String pStrLocale) {
+ return LocaleToLCIDJNI.convert(pStrLocale);
+ }
+
+}
diff --git a/modules/localization/src/java/org/scilab/modules/localization/LocaleToLCIDJNI.java b/modules/localization/src/java/org/scilab/modules/localization/LocaleToLCIDJNI.java
new file mode 100755
index 000000000..7d9bc6304
--- /dev/null
+++ b/modules/localization/src/java/org/scilab/modules/localization/LocaleToLCIDJNI.java
@@ -0,0 +1,42 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.7
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.localization;
+
+
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+/**
+ * @author Allan CORNET
+ * @copyright DIGITEO 2010
+ */
+public class LocaleToLCIDJNI {
+
+ /**
+ * Constructor
+ */
+ protected LocaleToLCIDJNI() {
+ throw new UnsupportedOperationException();
+ }
+
+ static {
+ try {
+ System.loadLibrary("scilocalization");
+ } catch (SecurityException e) {
+ System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ } catch (UnsatisfiedLinkError e) {
+ System.err.println("The native library scilocalization does not exist or cannot be found.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ }
+ }
+
+ public final static native String convert(String jarg1);
+}
diff --git a/modules/localization/src/java/org/scilab/modules/localization/Messages.java b/modules/localization/src/java/org/scilab/modules/localization/Messages.java
new file mode 100755
index 000000000..973033835
--- /dev/null
+++ b/modules/localization/src/java/org/scilab/modules/localization/Messages.java
@@ -0,0 +1,32 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.4
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.localization;
+
+
+/**
+ * @author Sylvestre Ledru
+ * @copyright DIGITEO 2008
+ */
+public class Messages {
+
+ /**
+ * Constructor
+ */
+ protected Messages() {
+ throw new UnsupportedOperationException();
+ }
+ public static String gettext(String key) {
+ return MessagesJNI.gettext(key);
+ }
+
+ public static String dgettext(String domain, String key) {
+ return MessagesJNI.dgettext(domain, key);
+ }
+
+}
diff --git a/modules/localization/src/java/org/scilab/modules/localization/MessagesJNI.java b/modules/localization/src/java/org/scilab/modules/localization/MessagesJNI.java
new file mode 100755
index 000000000..1fc611a94
--- /dev/null
+++ b/modules/localization/src/java/org/scilab/modules/localization/MessagesJNI.java
@@ -0,0 +1,49 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.4
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.localization;
+
+
+
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+/**
+ * @author Sylvestre LEDRU
+ * @copyright DIGITEO 2009
+ */
+public class MessagesJNI {
+
+ /**
+ * Constructor
+ */
+ protected MessagesJNI() {
+ throw new UnsupportedOperationException();
+ }
+
+ static {
+ try {
+ if (System.getProperty("os.name").toLowerCase().contains("windows") != true) {
+ if (System.getProperty("testngTests") != null) {
+ System.loadLibrary("scilab");
+ }
+ }
+ System.loadLibrary("scilocalization");
+ } catch (SecurityException e) {
+ System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ } catch (UnsatisfiedLinkError e) {
+ System.err.println("The native library scilocalization does not exist or cannot be found.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ }
+ }
+
+ public final static native String gettext(String jarg1);
+ public final static native String dgettext(String jarg1, String jarg2);
+}
diff --git a/modules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguage.java b/modules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguage.java
new file mode 100755
index 000000000..a34b377f1
--- /dev/null
+++ b/modules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguage.java
@@ -0,0 +1,42 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.7
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.localization;
+
+
+/**
+ * @author Calixte DENIZET
+ * @copyright Scilab Enterprises - 2012
+ */
+public class WindowsDefaultLanguage {
+
+ /**
+ * Constructor
+ */
+ protected WindowsDefaultLanguage() {
+ throw new UnsupportedOperationException();
+ }
+
+ /**
+ * Set and save the language in the registry (Windows only)
+ * @param[in] lang the language to set and save.
+ */
+ public static void setdefaultlanguage(String lang) {
+ WindowsDefaultLanguageJNI.setdefaultlanguage(lang);
+ }
+
+
+ /**
+ * Get the language from the registry (Windows only)
+ * @return the default language.
+ */
+ public static String getdefaultlanguage() {
+ return WindowsDefaultLanguageJNI.getdefaultlanguage();
+ }
+
+}
diff --git a/modules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguageJNI.java b/modules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguageJNI.java
new file mode 100755
index 000000000..00f27925f
--- /dev/null
+++ b/modules/localization/src/java/org/scilab/modules/localization/WindowsDefaultLanguageJNI.java
@@ -0,0 +1,43 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.7
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.localization;
+
+
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+/**
+ * @author Calixte DENIZET
+ * @copyright Scilab Enterprises - 2012
+ */
+public class WindowsDefaultLanguageJNI {
+
+ /**
+ * Constructor
+ */
+ protected WindowsDefaultLanguageJNI() {
+ throw new UnsupportedOperationException();
+ }
+
+ static {
+ try {
+ System.loadLibrary("scilocalization");
+ } catch (SecurityException e) {
+ System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ } catch (UnsatisfiedLinkError e) {
+ System.err.println("The native library scilocalization does not exist or cannot be found.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ }
+ }
+
+ public final static native void setdefaultlanguage(String jarg1);
+ public final static native String getdefaultlanguage();
+}
diff --git a/modules/localization/src/jni/.deps/.dirstamp b/modules/localization/src/jni/.deps/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/localization/src/jni/.deps/.dirstamp
diff --git a/modules/localization/src/jni/.deps/libscilocalization_algo_la-LocaleToLCID_wrap.Plo b/modules/localization/src/jni/.deps/libscilocalization_algo_la-LocaleToLCID_wrap.Plo
new file mode 100755
index 000000000..eb6a99c07
--- /dev/null
+++ b/modules/localization/src/jni/.deps/libscilocalization_algo_la-LocaleToLCID_wrap.Plo
@@ -0,0 +1,128 @@
+src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo: \
+ src/jni/LocaleToLCID_wrap.c /usr/include/stdc-predef.h \
+ /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h /usr/include/stdio.h \
+ /usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \
+ /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h \
+ /usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h \
+ /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \
+ /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h src/c/getLcidString.h
+
+/usr/include/stdc-predef.h:
+
+/usr/lib/jvm/java-8-openjdk-amd64/include/jni.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+/usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+/usr/include/string.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+src/c/getLcidString.h:
diff --git a/modules/localization/src/jni/.deps/libscilocalization_algo_la-Messages_wrap.Plo b/modules/localization/src/jni/.deps/libscilocalization_algo_la-Messages_wrap.Plo
new file mode 100755
index 000000000..b27f7f527
--- /dev/null
+++ b/modules/localization/src/jni/.deps/libscilocalization_algo_la-Messages_wrap.Plo
@@ -0,0 +1,147 @@
+src/jni/libscilocalization_algo_la-Messages_wrap.lo: \
+ src/jni/Messages_wrap.c /usr/include/stdc-predef.h \
+ /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h /usr/include/stdio.h \
+ /usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \
+ /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h \
+ /usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h \
+ /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \
+ /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h \
+ ../../modules/core/includes/scilabDefaults.h includes/localizationJava.h \
+ ../../modules/core/includes/machine.h /usr/include/libintl.h \
+ /usr/include/locale.h /usr/include/x86_64-linux-gnu/bits/locale.h \
+ ../../modules/core/includes/stack-def.h \
+ ../../modules/core/includes/machine.h
+
+/usr/include/stdc-predef.h:
+
+/usr/lib/jvm/java-8-openjdk-amd64/include/jni.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+/usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+/usr/include/string.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+../../modules/core/includes/scilabDefaults.h:
+
+includes/localizationJava.h:
+
+../../modules/core/includes/machine.h:
+
+/usr/include/libintl.h:
+
+/usr/include/locale.h:
+
+/usr/include/x86_64-linux-gnu/bits/locale.h:
+
+../../modules/core/includes/stack-def.h:
+
+../../modules/core/includes/machine.h:
diff --git a/modules/localization/src/jni/.deps/libscilocalization_algo_la-setdefaultlanguage_wrap.Plo b/modules/localization/src/jni/.deps/libscilocalization_algo_la-setdefaultlanguage_wrap.Plo
new file mode 100755
index 000000000..9c2f7cc38
--- /dev/null
+++ b/modules/localization/src/jni/.deps/libscilocalization_algo_la-setdefaultlanguage_wrap.Plo
@@ -0,0 +1,131 @@
+src/jni/libscilocalization_algo_la-setdefaultlanguage_wrap.lo: \
+ src/jni/setdefaultlanguage_wrap.c /usr/include/stdc-predef.h \
+ /usr/lib/jvm/java-8-openjdk-amd64/include/jni.h /usr/include/stdio.h \
+ /usr/include/features.h /usr/include/x86_64-linux-gnu/sys/cdefs.h \
+ /usr/include/x86_64-linux-gnu/bits/wordsize.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs.h \
+ /usr/include/x86_64-linux-gnu/gnu/stubs-64.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h \
+ /usr/include/x86_64-linux-gnu/bits/types.h \
+ /usr/include/x86_64-linux-gnu/bits/typesizes.h /usr/include/libio.h \
+ /usr/include/_G_config.h /usr/include/wchar.h \
+ /usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio_lim.h \
+ /usr/include/x86_64-linux-gnu/bits/sys_errlist.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio.h \
+ /usr/include/x86_64-linux-gnu/bits/stdio2.h \
+ /usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h \
+ /usr/include/stdlib.h /usr/include/x86_64-linux-gnu/bits/waitflags.h \
+ /usr/include/x86_64-linux-gnu/bits/waitstatus.h /usr/include/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/endian.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap.h \
+ /usr/include/x86_64-linux-gnu/bits/byteswap-16.h \
+ /usr/include/x86_64-linux-gnu/sys/types.h /usr/include/time.h \
+ /usr/include/x86_64-linux-gnu/sys/select.h \
+ /usr/include/x86_64-linux-gnu/bits/select.h \
+ /usr/include/x86_64-linux-gnu/bits/sigset.h \
+ /usr/include/x86_64-linux-gnu/bits/time.h \
+ /usr/include/x86_64-linux-gnu/bits/select2.h \
+ /usr/include/x86_64-linux-gnu/sys/sysmacros.h \
+ /usr/include/x86_64-linux-gnu/bits/pthreadtypes.h /usr/include/alloca.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib-float.h \
+ /usr/include/x86_64-linux-gnu/bits/stdlib.h /usr/include/string.h \
+ /usr/include/xlocale.h /usr/include/x86_64-linux-gnu/bits/string.h \
+ /usr/include/x86_64-linux-gnu/bits/string2.h \
+ /usr/include/x86_64-linux-gnu/bits/string3.h includes/setgetlanguage.h \
+ ../../modules/core/includes/BOOL.h
+
+/usr/include/stdc-predef.h:
+
+/usr/lib/jvm/java-8-openjdk-amd64/include/jni.h:
+
+/usr/include/stdio.h:
+
+/usr/include/features.h:
+
+/usr/include/x86_64-linux-gnu/sys/cdefs.h:
+
+/usr/include/x86_64-linux-gnu/bits/wordsize.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs.h:
+
+/usr/include/x86_64-linux-gnu/gnu/stubs-64.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stddef.h:
+
+/usr/include/x86_64-linux-gnu/bits/types.h:
+
+/usr/include/x86_64-linux-gnu/bits/typesizes.h:
+
+/usr/include/libio.h:
+
+/usr/include/_G_config.h:
+
+/usr/include/wchar.h:
+
+/usr/lib/gcc/x86_64-linux-gnu/5/include/stdarg.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio_lim.h:
+
+/usr/include/x86_64-linux-gnu/bits/sys_errlist.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdio2.h:
+
+/usr/lib/jvm/java-8-openjdk-amd64/include/linux/jni_md.h:
+
+/usr/include/stdlib.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitflags.h:
+
+/usr/include/x86_64-linux-gnu/bits/waitstatus.h:
+
+/usr/include/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/endian.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap.h:
+
+/usr/include/x86_64-linux-gnu/bits/byteswap-16.h:
+
+/usr/include/x86_64-linux-gnu/sys/types.h:
+
+/usr/include/time.h:
+
+/usr/include/x86_64-linux-gnu/sys/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/select.h:
+
+/usr/include/x86_64-linux-gnu/bits/sigset.h:
+
+/usr/include/x86_64-linux-gnu/bits/time.h:
+
+/usr/include/x86_64-linux-gnu/bits/select2.h:
+
+/usr/include/x86_64-linux-gnu/sys/sysmacros.h:
+
+/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h:
+
+/usr/include/alloca.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-bsearch.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib-float.h:
+
+/usr/include/x86_64-linux-gnu/bits/stdlib.h:
+
+/usr/include/string.h:
+
+/usr/include/xlocale.h:
+
+/usr/include/x86_64-linux-gnu/bits/string.h:
+
+/usr/include/x86_64-linux-gnu/bits/string2.h:
+
+/usr/include/x86_64-linux-gnu/bits/string3.h:
+
+includes/setgetlanguage.h:
+
+../../modules/core/includes/BOOL.h:
diff --git a/modules/localization/src/jni/.dirstamp b/modules/localization/src/jni/.dirstamp
new file mode 100755
index 000000000..e69de29bb
--- /dev/null
+++ b/modules/localization/src/jni/.dirstamp
diff --git a/modules/localization/src/jni/.libs/libscilocalization_algo_la-LocaleToLCID_wrap.o b/modules/localization/src/jni/.libs/libscilocalization_algo_la-LocaleToLCID_wrap.o
new file mode 100755
index 000000000..81763e60a
--- /dev/null
+++ b/modules/localization/src/jni/.libs/libscilocalization_algo_la-LocaleToLCID_wrap.o
Binary files differ
diff --git a/modules/localization/src/jni/.libs/libscilocalization_algo_la-Messages_wrap.o b/modules/localization/src/jni/.libs/libscilocalization_algo_la-Messages_wrap.o
new file mode 100755
index 000000000..efe153cd9
--- /dev/null
+++ b/modules/localization/src/jni/.libs/libscilocalization_algo_la-Messages_wrap.o
Binary files differ
diff --git a/modules/localization/src/jni/.libs/libscilocalization_algo_la-setdefaultlanguage_wrap.o b/modules/localization/src/jni/.libs/libscilocalization_algo_la-setdefaultlanguage_wrap.o
new file mode 100755
index 000000000..f3aceab00
--- /dev/null
+++ b/modules/localization/src/jni/.libs/libscilocalization_algo_la-setdefaultlanguage_wrap.o
Binary files differ
diff --git a/modules/localization/src/jni/LocaleToLCID.i b/modules/localization/src/jni/LocaleToLCID.i
new file mode 100755
index 000000000..d473f8e35
--- /dev/null
+++ b/modules/localization/src/jni/LocaleToLCID.i
@@ -0,0 +1,87 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+/* Messages.i */
+/**
+ * Windows: swig -java -package org.scilab.modules.localization -outdir ../java/org/scilab/modules/localization/ LocaleToLCID.i
+ * Others: Use the option --enable-build-swig to the configure
+*/
+%module LocaleToLCID
+
+%{
+#include "getLcidString.h"
+%}
+
+/* JavaDoc for LocaleToLCIDJNI class */
+%pragma(java) jniclassclassmodifiers=%{
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+ /**
+ * @author Allan CORNET
+ * @copyright DIGITEO 2010
+ */
+public class%}
+
+/* Constructor for LocaleToLCIDJNI class */
+%pragma(java) jniclasscode="
+ /**
+ * Constructor
+ */
+ protected LocaleToLCIDJNI() {
+ throw new UnsupportedOperationException();
+ }";
+
+/* static load of library */
+%pragma(java) jniclasscode=%{
+ static {
+ try {
+ System.loadLibrary("scilocalization");
+ } catch (SecurityException e) {
+ System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ } catch (UnsatisfiedLinkError e) {
+ System.err.println("The native library scilocalization does not exist or cannot be found.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ }
+ }
+%}
+
+/* JavaDoc for LocaleToLCID class */
+%pragma(java) moduleclassmodifiers="
+ /**
+ * @author Allan CORNET
+ * @copyright DIGITEO 2010
+ */
+public class";
+
+/* Constructor for LocaleToLCID class */
+%pragma(java) modulecode="
+ /**
+ * Constructor
+ */
+ protected LocaleToLCID() {
+ throw new UnsupportedOperationException();
+ }";
+
+/* JavaDoc */
+%javamethodmodifiers convert(const char *locale) "
+/**
+* convert a locale string to LCID string used by CHM builder
+* @param[in] string the key of the message (usually the english msg)
+* @return LCID string
+*/
+public";
+
+
+%rename(convert) getLcidString;
+char *getLcidString(const char *pStrLocale);
diff --git a/modules/localization/src/jni/LocaleToLCID_wrap.c b/modules/localization/src/jni/LocaleToLCID_wrap.c
new file mode 100755
index 000000000..87d82d898
--- /dev/null
+++ b/modules/localization/src/jni/LocaleToLCID_wrap.c
@@ -0,0 +1,219 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.7
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGJAVA
+
+/* -----------------------------------------------------------------------------
+ * This section contains generic SWIG labels for method/variable
+ * declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+# define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+# define SWIGINLINE inline
+# else
+# define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+# elif defined(__ICC)
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+# pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+# define SWIGUNUSEDPARM(p)
+# else
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# ifndef GCC_HASCLASSVISIBILITY
+# define GCC_HASCLASSVISIBILITY
+# endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# if defined(STATIC_LINKED)
+# define SWIGEXPORT
+# else
+# define SWIGEXPORT __declspec(dllexport)
+# endif
+# else
+# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+# define SWIGEXPORT __attribute__ ((visibility("default")))
+# else
+# define SWIGEXPORT
+# endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# define SWIGSTDCALL __stdcall
+# else
+# define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Fix for jlong on some versions of gcc on Windows */
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+ typedef long long __int64;
+#endif
+
+/* Fix for jlong on 64-bit x86 Solaris */
+#if defined(__x86_64)
+# ifdef _LP64
+# undef _LP64
+# endif
+#endif
+
+#include <jni.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Support for throwing Java exceptions */
+typedef enum {
+ SWIG_JavaOutOfMemoryError = 1,
+ SWIG_JavaIOException,
+ SWIG_JavaRuntimeException,
+ SWIG_JavaIndexOutOfBoundsException,
+ SWIG_JavaArithmeticException,
+ SWIG_JavaIllegalArgumentException,
+ SWIG_JavaNullPointerException,
+ SWIG_JavaDirectorPureVirtual,
+ SWIG_JavaUnknownError
+} SWIG_JavaExceptionCodes;
+
+typedef struct {
+ SWIG_JavaExceptionCodes code;
+ const char *java_exception;
+} SWIG_JavaExceptions_t;
+
+
+static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
+ jclass excep;
+ static const SWIG_JavaExceptions_t java_exceptions[] = {
+ { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
+ { SWIG_JavaIOException, "java/io/IOException" },
+ { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
+ { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
+ { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
+ { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
+ { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
+ { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
+ { SWIG_JavaUnknownError, "java/lang/UnknownError" },
+ { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
+ };
+ const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
+
+ while (except_ptr->code != code && except_ptr->code)
+ except_ptr++;
+
+ (*jenv)->ExceptionClear(jenv);
+ excep = (*jenv)->FindClass(jenv, except_ptr->java_exception);
+ if (excep)
+ (*jenv)->ThrowNew(jenv, excep, msg);
+}
+
+
+/* Contract support */
+
+#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
+
+
+#include "getLcidString.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT jstring JNICALL Java_org_scilab_modules_localization_LocaleToLCIDJNI_convert(JNIEnv *jenv, jclass jcls, jstring jarg1) {
+ jstring jresult = 0 ;
+ char *arg1 = (char *) 0 ;
+ char *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = 0;
+ if (jarg1) {
+ arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0);
+ if (!arg1) return 0;
+ }
+ result = (char *)getLcidString((char const *)arg1);
+ if (result) jresult = (*jenv)->NewStringUTF(jenv, (const char *)result);
+ if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1);
+ return jresult;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/modules/localization/src/jni/Messages.i b/modules/localization/src/jni/Messages.i
new file mode 100755
index 000000000..366cbe026
--- /dev/null
+++ b/modules/localization/src/jni/Messages.i
@@ -0,0 +1,99 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2009 - DIGITEO - Sylvestre LEDRU
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+/* Messages.i */
+/**
+ * Windows: swig -java -package org.scilab.modules.localization -outdir ../java/org/scilab/modules/localization/ Messages.i
+ * Others: Use the option --enable-build-swig to the configure
+*/
+%module Messages
+
+%{
+#include "scilabDefaults.h"
+#include "localizationJava.h"
+%}
+
+
+/* JavaDoc for MessagesJNI class */
+%pragma(java) jniclassclassmodifiers=%{
+
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+ /**
+ * @author Sylvestre LEDRU
+ * @copyright DIGITEO 2009
+ */
+public class%}
+
+/* Constructor for MessagesJNI class */
+%pragma(java) jniclasscode="
+ /**
+ * Constructor
+ */
+ protected MessagesJNI() {
+ throw new UnsupportedOperationException();
+ }";
+
+/* static load of library */
+%pragma(java) jniclasscode=%{
+ static {
+ try {
+ if (System.getProperty("os.name").toLowerCase().contains("windows") != true) {
+ if (System.getProperty("testngTests")!=null) {
+ System.loadLibrary("scilab");
+ }
+ }
+ System.loadLibrary("scilocalization");
+ } catch (SecurityException e) {
+ System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ } catch (UnsatisfiedLinkError e) {
+ System.err.println("The native library scilocalization does not exist or cannot be found.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ }
+ }
+%}
+
+/* JavaDoc for Messages class */
+%pragma(java) moduleclassmodifiers="
+ /**
+ * @author Sylvestre Ledru
+ * @copyright DIGITEO 2008
+ */
+public class";
+
+/* Constructor for Messages class */
+%pragma(java) modulecode="
+ /**
+ * Constructor
+ */
+ protected Messages() {
+ throw new UnsupportedOperationException();
+ }";
+
+/* JavaDoc */
+%javamethodmodifiers gettext(char *key) "
+/**
+* Translate a message
+* @param[in] string the key of the message (usually the english msg)
+* @return The localized string
+*/
+public";
+
+/* Thanks to rename, gettext is the Java method and in the native code,
+we are calling the C function scigettext */
+%rename(gettext) scigettext;
+char *scigettext(char *key);
+
+%rename(dgettext) scidgettext;
+char *scidgettext(char *domain, char *key);
diff --git a/modules/localization/src/jni/Messages_wrap.c b/modules/localization/src/jni/Messages_wrap.c
new file mode 100755
index 000000000..3e322f0d3
--- /dev/null
+++ b/modules/localization/src/jni/Messages_wrap.c
@@ -0,0 +1,246 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.7
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGJAVA
+
+/* -----------------------------------------------------------------------------
+ * This section contains generic SWIG labels for method/variable
+ * declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+# define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+# define SWIGINLINE inline
+# else
+# define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+# elif defined(__ICC)
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+# pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+# define SWIGUNUSEDPARM(p)
+# else
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# ifndef GCC_HASCLASSVISIBILITY
+# define GCC_HASCLASSVISIBILITY
+# endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# if defined(STATIC_LINKED)
+# define SWIGEXPORT
+# else
+# define SWIGEXPORT __declspec(dllexport)
+# endif
+# else
+# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+# define SWIGEXPORT __attribute__ ((visibility("default")))
+# else
+# define SWIGEXPORT
+# endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# define SWIGSTDCALL __stdcall
+# else
+# define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Fix for jlong on some versions of gcc on Windows */
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+ typedef long long __int64;
+#endif
+
+/* Fix for jlong on 64-bit x86 Solaris */
+#if defined(__x86_64)
+# ifdef _LP64
+# undef _LP64
+# endif
+#endif
+
+#include <jni.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Support for throwing Java exceptions */
+typedef enum {
+ SWIG_JavaOutOfMemoryError = 1,
+ SWIG_JavaIOException,
+ SWIG_JavaRuntimeException,
+ SWIG_JavaIndexOutOfBoundsException,
+ SWIG_JavaArithmeticException,
+ SWIG_JavaIllegalArgumentException,
+ SWIG_JavaNullPointerException,
+ SWIG_JavaDirectorPureVirtual,
+ SWIG_JavaUnknownError
+} SWIG_JavaExceptionCodes;
+
+typedef struct {
+ SWIG_JavaExceptionCodes code;
+ const char *java_exception;
+} SWIG_JavaExceptions_t;
+
+
+static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
+ jclass excep;
+ static const SWIG_JavaExceptions_t java_exceptions[] = {
+ { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
+ { SWIG_JavaIOException, "java/io/IOException" },
+ { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
+ { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
+ { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
+ { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
+ { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
+ { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
+ { SWIG_JavaUnknownError, "java/lang/UnknownError" },
+ { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
+ };
+ const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
+
+ while (except_ptr->code != code && except_ptr->code)
+ except_ptr++;
+
+ (*jenv)->ExceptionClear(jenv);
+ excep = (*jenv)->FindClass(jenv, except_ptr->java_exception);
+ if (excep)
+ (*jenv)->ThrowNew(jenv, excep, msg);
+}
+
+
+/* Contract support */
+
+#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
+
+
+#include "scilabDefaults.h"
+#include "localizationJava.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT jstring JNICALL Java_org_scilab_modules_localization_MessagesJNI_gettext(JNIEnv *jenv, jclass jcls, jstring jarg1) {
+ jstring jresult = 0 ;
+ char *arg1 = (char *) 0 ;
+ char *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = 0;
+ if (jarg1) {
+ arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0);
+ if (!arg1) return 0;
+ }
+ result = (char *)scigettext(arg1);
+ if (result) jresult = (*jenv)->NewStringUTF(jenv, (const char *)result);
+ if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1);
+ return jresult;
+}
+
+
+SWIGEXPORT jstring JNICALL Java_org_scilab_modules_localization_MessagesJNI_dgettext(JNIEnv *jenv, jclass jcls, jstring jarg1, jstring jarg2) {
+ jstring jresult = 0 ;
+ char *arg1 = (char *) 0 ;
+ char *arg2 = (char *) 0 ;
+ char *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = 0;
+ if (jarg1) {
+ arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0);
+ if (!arg1) return 0;
+ }
+ arg2 = 0;
+ if (jarg2) {
+ arg2 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg2, 0);
+ if (!arg2) return 0;
+ }
+ result = (char *)scidgettext(arg1,arg2);
+ if (result) jresult = (*jenv)->NewStringUTF(jenv, (const char *)result);
+ if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1);
+ if (arg2) (*jenv)->ReleaseStringUTFChars(jenv, jarg2, (const char *)arg2);
+ return jresult;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/modules/localization/src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo b/modules/localization/src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo
new file mode 100755
index 000000000..d01a34b0a
--- /dev/null
+++ b/modules/localization/src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo
@@ -0,0 +1,12 @@
+# src/jni/libscilocalization_algo_la-LocaleToLCID_wrap.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-LocaleToLCID_wrap.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/jni/libscilocalization_algo_la-Messages_wrap.lo b/modules/localization/src/jni/libscilocalization_algo_la-Messages_wrap.lo
new file mode 100755
index 000000000..0503ce2d7
--- /dev/null
+++ b/modules/localization/src/jni/libscilocalization_algo_la-Messages_wrap.lo
@@ -0,0 +1,12 @@
+# src/jni/libscilocalization_algo_la-Messages_wrap.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-Messages_wrap.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/jni/libscilocalization_algo_la-setdefaultlanguage_wrap.lo b/modules/localization/src/jni/libscilocalization_algo_la-setdefaultlanguage_wrap.lo
new file mode 100755
index 000000000..3ff9b505f
--- /dev/null
+++ b/modules/localization/src/jni/libscilocalization_algo_la-setdefaultlanguage_wrap.lo
@@ -0,0 +1,12 @@
+# src/jni/libscilocalization_algo_la-setdefaultlanguage_wrap.lo - a libtool object file
+# Generated by libtool (GNU libtool) 2.4.2
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object='.libs/libscilocalization_algo_la-setdefaultlanguage_wrap.o'
+
+# Name of the non-PIC object
+non_pic_object=none
+
diff --git a/modules/localization/src/jni/setdefaultlanguage.i b/modules/localization/src/jni/setdefaultlanguage.i
new file mode 100755
index 000000000..ebc1618b8
--- /dev/null
+++ b/modules/localization/src/jni/setdefaultlanguage.i
@@ -0,0 +1,95 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - Scilab Enterprises - Calixte DENIZET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+ *
+ */
+/* Messages.i */
+/**
+ * Windows: swig -java -package org.scilab.modules.localization -outdir ../java/org/scilab/modules/localization/ setdefaultlanguage.i
+ * Others: Use the option --enable-build-swig to the configure
+*/
+%module WindowsDefaultLanguage
+
+%{
+#include "setgetlanguage.h"
+%}
+
+/* JavaDoc for WindowsDefaultLanguage class */
+%pragma(java) jniclassclassmodifiers=%{
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+ /**
+ * @author Calixte DENIZET
+ * @copyright Scilab Enterprises - 2012
+ */
+public class%}
+
+/* Constructor for WindowsDefaultLanguageJNI class */
+%pragma(java) jniclasscode="
+ /**
+ * Constructor
+ */
+ protected WindowsDefaultLanguageJNI() {
+ throw new UnsupportedOperationException();
+ }";
+
+/* static load of library */
+%pragma(java) jniclasscode=%{
+ static {
+ try {
+ System.loadLibrary("scilocalization");
+ } catch (SecurityException e) {
+ System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ } catch (UnsatisfiedLinkError e) {
+ System.err.println("The native library scilocalization does not exist or cannot be found.");
+ System.err.println(e.getLocalizedMessage());
+ e.printStackTrace(System.err);
+ }
+ }
+%}
+
+/* JavaDoc for WindowsDefaultLanguage class */
+%pragma(java) moduleclassmodifiers="
+ /**
+ * @author Calixte DENIZET
+ * @copyright Scilab Enterprises - 2012
+ */
+public class";
+
+/* Constructor for WindowsDefaultLanguage class */
+%pragma(java) modulecode="
+ /**
+ * Constructor
+ */
+ protected WindowsDefaultLanguage() {
+ throw new UnsupportedOperationException();
+ }";
+
+/* JavaDoc */
+%javamethodmodifiers setdefaultlanguage(const char *locale) "
+/**
+* Set and save the language in the registry (Windows only)
+* @param[in] lang the language to set and save.
+*/
+public";
+
+
+void setdefaultlanguage(const char *lang);
+
+%javamethodmodifiers getdefaultlanguage(void) "
+/**
+* Get the language from the registry (Windows only)
+* @return the default language.
+*/
+public";
+
+
+char * getdefaultlanguage(void);
diff --git a/modules/localization/src/jni/setdefaultlanguage_wrap.c b/modules/localization/src/jni/setdefaultlanguage_wrap.c
new file mode 100755
index 000000000..6077594bf
--- /dev/null
+++ b/modules/localization/src/jni/setdefaultlanguage_wrap.c
@@ -0,0 +1,227 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.7
+ *
+ * This file is not intended to be easily readable and contains a number of
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG
+ * interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGJAVA
+
+/* -----------------------------------------------------------------------------
+ * This section contains generic SWIG labels for method/variable
+ * declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+# define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+# define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+# define SWIGINLINE inline
+# else
+# define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+# elif defined(__ICC)
+# define SWIGUNUSED __attribute__ ((__unused__))
+# else
+# define SWIGUNUSED
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+# pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+# define SWIGUNUSEDPARM(p)
+# else
+# define SWIGUNUSEDPARM(p) p SWIGUNUSED
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+# ifndef GCC_HASCLASSVISIBILITY
+# define GCC_HASCLASSVISIBILITY
+# endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# if defined(STATIC_LINKED)
+# define SWIGEXPORT
+# else
+# define SWIGEXPORT __declspec(dllexport)
+# endif
+# else
+# if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+# define SWIGEXPORT __attribute__ ((visibility("default")))
+# else
+# define SWIGEXPORT
+# endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+# define SWIGSTDCALL __stdcall
+# else
+# define SWIGSTDCALL
+# endif
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Fix for jlong on some versions of gcc on Windows */
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+ typedef long long __int64;
+#endif
+
+/* Fix for jlong on 64-bit x86 Solaris */
+#if defined(__x86_64)
+# ifdef _LP64
+# undef _LP64
+# endif
+#endif
+
+#include <jni.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Support for throwing Java exceptions */
+typedef enum {
+ SWIG_JavaOutOfMemoryError = 1,
+ SWIG_JavaIOException,
+ SWIG_JavaRuntimeException,
+ SWIG_JavaIndexOutOfBoundsException,
+ SWIG_JavaArithmeticException,
+ SWIG_JavaIllegalArgumentException,
+ SWIG_JavaNullPointerException,
+ SWIG_JavaDirectorPureVirtual,
+ SWIG_JavaUnknownError
+} SWIG_JavaExceptionCodes;
+
+typedef struct {
+ SWIG_JavaExceptionCodes code;
+ const char *java_exception;
+} SWIG_JavaExceptions_t;
+
+
+static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
+ jclass excep;
+ static const SWIG_JavaExceptions_t java_exceptions[] = {
+ { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
+ { SWIG_JavaIOException, "java/io/IOException" },
+ { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
+ { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
+ { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
+ { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
+ { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
+ { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
+ { SWIG_JavaUnknownError, "java/lang/UnknownError" },
+ { (SWIG_JavaExceptionCodes)0, "java/lang/UnknownError" }
+ };
+ const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
+
+ while (except_ptr->code != code && except_ptr->code)
+ except_ptr++;
+
+ (*jenv)->ExceptionClear(jenv);
+ excep = (*jenv)->FindClass(jenv, except_ptr->java_exception);
+ if (excep)
+ (*jenv)->ThrowNew(jenv, excep, msg);
+}
+
+
+/* Contract support */
+
+#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
+
+
+#include "setgetlanguage.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT void JNICALL Java_org_scilab_modules_localization_WindowsDefaultLanguageJNI_setdefaultlanguage(JNIEnv *jenv, jclass jcls, jstring jarg1) {
+ char *arg1 = (char *) 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ arg1 = 0;
+ if (jarg1) {
+ arg1 = (char *)(*jenv)->GetStringUTFChars(jenv, jarg1, 0);
+ if (!arg1) return ;
+ }
+ setdefaultlanguage((char const *)arg1);
+ if (arg1) (*jenv)->ReleaseStringUTFChars(jenv, jarg1, (const char *)arg1);
+}
+
+
+SWIGEXPORT jstring JNICALL Java_org_scilab_modules_localization_WindowsDefaultLanguageJNI_getdefaultlanguage(JNIEnv *jenv, jclass jcls) {
+ jstring jresult = 0 ;
+ char *result = 0 ;
+
+ (void)jenv;
+ (void)jcls;
+ result = (char *)getdefaultlanguage();
+ if (result) jresult = (*jenv)->NewStringUTF(jenv, (const char *)result);
+ return jresult;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
diff --git a/modules/localization/src/localization.rc b/modules/localization/src/localization.rc
new file mode 100755
index 000000000..59fc6b249
--- /dev/null
+++ b/modules/localization/src/localization.rc
@@ -0,0 +1,96 @@
+// Microsoft Visual C++ generated resource script.
+//
+
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+//#include "afxres.h"
+#define APSTUDIO_HIDDEN_SYMBOLS
+#include "windows.h"
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// French (France) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_FRA)
+#ifdef _WIN32
+LANGUAGE LANG_FRENCH, SUBLANG_FRENCH
+#pragma code_page(1252)
+#endif //_WIN32
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Version
+//
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION 5,5,2,0
+ PRODUCTVERSION 5,5,2,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x2L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040c04b0"
+ BEGIN
+ VALUE "FileDescription", "localization module"
+ VALUE "FileVersion", "5, 5, 2, 0"
+ VALUE "InternalName", "localization module"
+ VALUE "LegalCopyright", "Copyright (C) 2017"
+ VALUE "OriginalFilename", "scilocalization.dll"
+ VALUE "ProductName", "localization module"
+ VALUE "ProductVersion", "5, 5, 2, 0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x40c, 1200
+ END
+END
+
+#endif // French (France) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/modules/localization/src/localization.vcxproj b/modules/localization/src/localization.vcxproj
new file mode 100755
index 000000000..b26ea36b2
--- /dev/null
+++ b/modules/localization/src/localization.vcxproj
@@ -0,0 +1,304 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <ProjectGuid>{ECFFEB0C-1EDA-45EE-9A10-B18143852E17}</ProjectGuid>
+ <RootNamespace>localization</RootNamespace>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <UseOfMfc>false</UseOfMfc>
+ <CharacterSet>MultiByte</CharacterSet>
+ <PlatformToolset>v110</PlatformToolset>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup>
+ <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+ <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</PreBuildEventUseInBuild>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+ <PreBuildEventUseInBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</PreBuildEventUseInBuild>
+ <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</LinkIncremental>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">$(ProjectDir)$(Configuration)\</IntDir>
+ <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)bin\</OutDir>
+ <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(ProjectDir)$(Configuration)\</IntDir>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">sci$(ProjectName)</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">sci$(ProjectName)</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">sci$(ProjectName)</TargetName>
+ <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|x64'">sci$(ProjectName)</TargetName>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../src/c;../includes;../../core/includes;../../output_stream/includes;../../windows_tools/includes;../../fileio/includes;../../string/src/c;../../string/includes;../../../libs/intl;../../../libs/libxml2;../../../libs/libxml2/libxml;../../../java/jdk/include;../../../java/jdk/include/win32;../../../libs/GetWindowsVersion;../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>FORDLL;_DLL;_DEBUG;_CRT_SECURE_NO_DEPRECATE;EXPORT_LOCALIZATION_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
+ <ObjectFileName>$(Configuration)/</ObjectFileName>
+ <WarningLevel>Level3</WarningLevel>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)io_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;io.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\sci$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>localization_export.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <ImportLibrary>$(SolutionDir)bin\sci$(ProjectName).lib</ImportLibrary>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>Disabled</Optimization>
+ <AdditionalIncludeDirectories>../src/c;../includes;../../core/includes;../../output_stream/includes;../../windows_tools/includes;../../fileio/includes;../../string/src/c;../../string/includes;../../../libs/intl;../../../libs/libxml2;../../../libs/libxml2/libxml;../../../java/jdk/include;../../../java/jdk/include/win32;../../../libs/GetWindowsVersion;../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>FORDLL;_DLL;_DEBUG;_CRT_SECURE_NO_DEPRECATE;EXPORT_LOCALIZATION_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
+ <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
+ <ObjectFileName>$(Configuration)/</ObjectFileName>
+ <WarningLevel>Level3</WarningLevel>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)io_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;io.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\sci$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>localization_export.def</ModuleDefinitionFile>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <ProgramDatabaseFile>$(TargetDir)$(TargetName).pdb</ProgramDatabaseFile>
+ <ImportLibrary>$(SolutionDir)bin\sci$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>../src/c;../includes;../../core/includes;../../output_stream/includes;../../windows_tools/includes;../../fileio/includes;../../string/src/c;../../string/includes;../../../libs/intl;../../../libs/libxml2;../../../libs/libxml2/libxml;../../../java/jdk/include;../../../java/jdk/include/win32;../../../libs/GetWindowsVersion;../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>FORDLL;EXPORT_LOCALIZATION_DLL;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
+ <ObjectFileName>$(Configuration)/</ObjectFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)io_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;io.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\sci$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>localization_export.def</ModuleDefinitionFile>
+ <SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
+ <ImportLibrary>$(SolutionDir)bin\sci$(ProjectName).lib</ImportLibrary>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <Midl>
+ <TargetEnvironment>X64</TargetEnvironment>
+ </Midl>
+ <ClCompile>
+ <Optimization>MaxSpeed</Optimization>
+ <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed>
+ <AdditionalIncludeDirectories>../src/c;../includes;../../core/includes;../../output_stream/includes;../../windows_tools/includes;../../fileio/includes;../../string/src/c;../../string/includes;../../../libs/intl;../../../libs/libxml2;../../../libs/libxml2/libxml;../../../java/jdk/include;../../../java/jdk/include/win32;../../../libs/GetWindowsVersion;../../api_scilab/includes;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>FORDLL;EXPORT_LOCALIZATION_DLL;NDEBUG;_CRT_SECURE_NO_DEPRECATE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <StringPooling>true</StringPooling>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>true</FunctionLevelLinking>
+ <AssemblerListingLocation>$(Configuration)/</AssemblerListingLocation>
+ <ObjectFileName>$(Configuration)/</ObjectFileName>
+ <WarningLevel>Level3</WarningLevel>
+ <MultiProcessorCompilation>true</MultiProcessorCompilation>
+ </ClCompile>
+ <ResourceCompile>
+ <PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <Culture>0x040c</Culture>
+ </ResourceCompile>
+ <PreLinkEvent>
+ <Command>lib /DEF:"$(ProjectDir)core_import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)core.lib" 1&gt;NUL 2&gt;NUL
+lib /DEF:"$(ProjectDir)io_Import.def" /SUBSYSTEM:WINDOWS /MACHINE:$(Platform) /OUT:"$(ProjectDir)io.lib" 1&gt;NUL 2&gt;NUL
+</Command>
+ </PreLinkEvent>
+ <Link>
+ <AdditionalDependencies>core.lib;io.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <OutputFile>$(SolutionDir)bin\sci$(ProjectName).dll</OutputFile>
+ <ModuleDefinitionFile>localization_export.def</ModuleDefinitionFile>
+ <SupportUnloadOfDelayLoadedDLL>true</SupportUnloadOfDelayLoadedDLL>
+ <ImportLibrary>$(SolutionDir)bin\sci$(ProjectName).lib</ImportLibrary>
+ <TargetMachine>MachineX64</TargetMachine>
+ <CLRUnmanagedCodeCheck>true</CLRUnmanagedCodeCheck>
+ <RandomizedBaseAddress>false</RandomizedBaseAddress>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClInclude Include="..\includes\charEncoding.h" />
+ <ClInclude Include="..\includes\dynlib_localization.h" />
+ <ClInclude Include="..\includes\TerminateLocalization.h" />
+ <ClInclude Include="c\defaultlanguage.h" />
+ <ClInclude Include="c\getentrieshashtable.h" />
+ <ClInclude Include="c\getLcidString.h" />
+ <ClInclude Include="c\getLocaleInfo_Apple.h" />
+ <ClInclude Include="c\getLocaleInfo_Windows.h" />
+ <ClInclude Include="..\includes\gw_localization.h" />
+ <ClInclude Include="..\includes\InitializeLocalization.h" />
+ <ClInclude Include="c\hashtable_localization.h" />
+ <ClInclude Include="c\LanguagePreferences_Windows.h" />
+ <ClInclude Include="c\loadhashtableslocalization.h" />
+ <ClInclude Include="c\LocaleNameToLCID_Windows.h" />
+ <ClInclude Include="..\includes\localization.h" />
+ <ClInclude Include="..\includes\localizationJava.h" />
+ <ClInclude Include="..\includes\setgetlanguage.h" />
+ <ClInclude Include="c\tableslanguages.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="..\locales\localization.pot" />
+ <None Include="io_Import.def" />
+ <None Include="core_import.def" />
+ <None Include="localization_export.def" />
+ <None Include="..\localization.iss" />
+ <None Include="..\sci_gateway\localization_gateway.xml" />
+ <None Include="..\Makefile.am" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="..\sci_gateway\c\sci_addlocalizationdomain.c" />
+ <ClCompile Include="c\charEncoding.c" />
+ <ClCompile Include="c\DllmainLocalization.c" />
+ <ClCompile Include="c\getLcidString.c" />
+ <ClCompile Include="c\getLocaleInfo_Windows.c" />
+ <ClCompile Include="..\sci_gateway\c\gw_localization.c" />
+ <ClCompile Include="c\InitializeLocalization.c" />
+ <ClCompile Include="c\LanguagePreferences_Windows.c" />
+ <ClCompile Include="c\LocaleNameToLCID_Windows.c" />
+ <ClCompile Include="c\setdefaultlanguage.c" />
+ <ClCompile Include="jni\LocaleToLCID_wrap.c" />
+ <ClCompile Include="jni\Messages_wrap.c" />
+ <ClCompile Include="..\sci_gateway\c\sci_getdefaultlanguage.c" />
+ <ClCompile Include="..\sci_gateway\c\sci_getlanguage.c" />
+ <ClCompile Include="..\sci_gateway\c\sci_gettext.c" />
+ <ClCompile Include="..\sci_gateway\c\sci_setdefaultlanguage.c" />
+ <ClCompile Include="..\sci_gateway\c\sci_setlanguage.c" />
+ <ClCompile Include="c\setgetlanguage.c" />
+ <ClCompile Include="jni\setdefaultlanguage_wrap.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="localization.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\..\libs\GetWindowsVersion\GetWindowsVersion.vcxproj">
+ <Project>{982bf37f-42c4-4d37-8d14-60521b141503}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\..\tools\Dumpexts\Dumpexts.vcxproj">
+ <Project>{3170e4c2-1173-4264-a222-7ee8ccb3ddf7}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\api_scilab\api_scilab.vcxproj">
+ <Project>{43c5bab1-1dca-4743-a183-77e0d42fe7d0}</Project>
+ </ProjectReference>
+ <ProjectReference Include="..\..\fileio\fileio.vcxproj">
+ <Project>{4fc72d4a-80ee-4b1a-8724-0201c1a35621}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\output_stream\src\c\output_stream.vcxproj">
+ <Project>{a5911cd7-f8e8-440c-a23e-4843a0636f3a}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\string\src\c\string.vcxproj">
+ <Project>{8d45767a-9b03-4905-97f6-d2f3f79141ea}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ <ProjectReference Include="..\..\windows_tools\src\c\scilab_windows\scilab_windows.vcxproj">
+ <Project>{8028f371-6a94-4a26-8804-6e7f05f1d1aa}</Project>
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/modules/localization/src/localization.vcxproj.filters b/modules/localization/src/localization.vcxproj.filters
new file mode 100755
index 000000000..a51f57850
--- /dev/null
+++ b/modules/localization/src/localization.vcxproj.filters
@@ -0,0 +1,165 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{1d690322-2fae-40c4-a31c-b41a7516809f}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="localization">
+ <UniqueIdentifier>{94f9e428-7935-491d-8284-bd32c835573b}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Libraries Dependencies">
+ <UniqueIdentifier>{a5f6aed8-c58f-469c-b078-9404d7a8c9b2}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Libraries Dependencies\Imports">
+ <UniqueIdentifier>{a17607c6-f802-4c84-a9f1-ddca76f4aa8a}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Libraries Dependencies\Export">
+ <UniqueIdentifier>{0edb7486-ea9b-43b0-bc43-5da2b2315a4c}</UniqueIdentifier>
+ </Filter>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{b6b33bea-52e4-4a55-8f6d-1053dedc7a72}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{1daa6384-ae22-4e62-ac89-c45f7f649300}</UniqueIdentifier>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="..\includes\charEncoding.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\includes\dynlib_localization.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\getLcidString.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\getLocaleInfo_Windows.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\includes\gw_localization.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\includes\InitializeLocalization.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\LanguagePreferences_Windows.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\LocaleNameToLCID_Windows.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\includes\localization.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\includes\localizationJava.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\includes\setgetlanguage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\defaultlanguage.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\getentrieshashtable.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\getLocaleInfo_Apple.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\hashtable_localization.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\loadhashtableslocalization.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="c\tableslanguages.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="..\includes\TerminateLocalization.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="io_Import.def">
+ <Filter>Libraries Dependencies\Imports</Filter>
+ </None>
+ <None Include="core_import.def">
+ <Filter>Libraries Dependencies\Imports</Filter>
+ </None>
+ <None Include="localization_export.def">
+ <Filter>Libraries Dependencies\Export</Filter>
+ </None>
+ <None Include="..\localization.iss" />
+ <None Include="..\sci_gateway\localization_gateway.xml" />
+ <None Include="..\Makefile.am" />
+ <None Include="..\locales\localization.pot">
+ <Filter>localization</Filter>
+ </None>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="c\charEncoding.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\DllmainLocalization.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\getLcidString.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\getLocaleInfo_Windows.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\sci_gateway\c\gw_localization.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\InitializeLocalization.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\LanguagePreferences_Windows.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\LocaleNameToLCID_Windows.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="jni\LocaleToLCID_wrap.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="jni\Messages_wrap.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\sci_gateway\c\sci_getdefaultlanguage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\sci_gateway\c\sci_getlanguage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\sci_gateway\c\sci_gettext.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\sci_gateway\c\sci_setdefaultlanguage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\sci_gateway\c\sci_setlanguage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\setgetlanguage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="c\setdefaultlanguage.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="jni\setdefaultlanguage_wrap.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ <ClCompile Include="..\sci_gateway\c\sci_addlocalizationdomain.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="localization.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/modules/localization/src/localization_export.def b/modules/localization/src/localization_export.def
new file mode 100755
index 000000000..d68aba787
--- /dev/null
+++ b/modules/localization/src/localization_export.def
@@ -0,0 +1,23 @@
+LIBRARY scilocalization.dll
+
+
+EXPORTS
+; ---------------------------------------
+; localization explicit export (SEP 35)
+; ---------------------------------------
+to_wide_string
+wide_string_to_UTF8
+wcstat
+setlanguage
+getlanguage
+getlanguagealias
+getcurrentlanguagecode
+getlanguagefromcode
+getcodefromlanguage
+convertlanguagealias
+LanguageIsOK
+needtochangelanguage
+exportLocaleToSystem
+IsValidUTF8
+setLanguageFromCommandLine
+getLcidString
diff --git a/modules/localization/src/perl/check_po_files.pl b/modules/localization/src/perl/check_po_files.pl
new file mode 100755
index 000000000..f0fdbbc6d
--- /dev/null
+++ b/modules/localization/src/perl/check_po_files.pl
@@ -0,0 +1,328 @@
+#!/usr/bin/perl
+
+# Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+# Copyright (C) 2009 - DIGITEO - Pierre MARECHAL <pierre.marechal@scilab.org>
+#
+# This file must be used under the terms of the CeCILL.
+# This source file is licensed as described in the file COPYING, which
+# you should have received as part of this distribution. The terms
+# are also available at
+# http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
+
+use strict;
+use Cwd;
+use File::Basename;
+use Locale::PO;
+
+# Current directory
+my $directory = getcwd();
+
+if( dirname($0) ne '.' )
+{
+ $directory .= '/'.dirname($0);
+}
+
+if( dirname($0) =~ m/^\// )
+{
+ $directory = dirname($0);
+}
+
+# modules dir path
+my $sci_modules_dir = $directory;
+$sci_modules_dir =~ s/\/localization\/src\/perl//g;
+
+# Module list
+my %modules = get_module_list();
+
+# Where is located the msg
+my %msg_module;
+
+# statistics
+my $nb_msgs = 0;
+my $nb_modules = 0;
+my $nb_po_files = 0;
+my $nb_duplicated_msgs = 0;
+my $nb_different_translation = 0;
+
+# Gestion de la langue
+my $language = 'fr_FR';
+if( $ARGV[0] ne '' )
+{
+ $language = $ARGV[0];
+ $language =~ s/^\s+//;
+ $language =~ s/\s+$//;
+}
+
+
+
+# Récupération de la liste de tous messages
+# ==============================================================================
+
+foreach my $module (sort keys %modules)
+{
+ my $po_file = get_po_file($module,$language);
+
+ if($po_file eq '')
+ {
+ next;
+ }
+
+ $nb_po_files++;
+
+ my %po_objects = load_po_file(get_po_file($module,$language));
+
+ foreach my $msgid ( keys %po_objects )
+ {
+ if( exists($msg_module{ $msgid }) )
+ {
+ $msg_module{ $msgid } .= ','.$module;
+ }
+ else
+ {
+ $msg_module{ $msgid } = $module;
+ }
+ }
+}
+
+# Détection des messages
+# ==============================================================================
+
+my $count = 0;
+
+foreach my $msgid (sort keys %msg_module)
+{
+ $count++;
+
+ my %msg_modules = get_msg_modules($msgid);
+ my $msg_modules_size = keys %msg_modules;
+
+ if($msg_modules_size > 1)
+ {
+ $nb_duplicated_msgs++;
+
+ my %translations = get_msg_translations($msgid,$language);
+ my $translations_size = keys %translations;
+
+ if($translations_size > 1)
+ {
+ $nb_different_translation++;
+
+ print "================================================================================"."\n";
+ print $msgid."\n";
+ foreach my $module (sort keys %msg_modules)
+ {
+ print ' - '.$module.' ';
+
+ for( my $i=length($module) ; $i < 30 ; $i++ )
+ {
+ print '.';
+ }
+
+ print ' '.get_msg_translation($msgid,$module,$language);
+ print "\n";
+ }
+ }
+ }
+}
+
+# Affichage des statistics
+# ==============================================================================
+$nb_msgs = keys %msg_module;
+$nb_modules = keys %modules;
+
+print "\n";
+print "\n";
+print "================================================================================"."\n";
+print 'Nombre de messages : '.$nb_msgs."\n";
+print 'Nombre de modules : '.$nb_modules."\n";
+print 'Nombre de fichier PO : '.$nb_po_files."\n";
+print 'Nombre de messages en double : '.$nb_duplicated_msgs."\n";
+print 'Nombre de messages dont'."\n";
+print ' plusieurs traductions existent : '.$nb_different_translation."\n";
+print "================================================================================"."\n";
+print "\n";
+print "\n";
+
+
+
+
+
+# ==============================================================================
+# get_module_list
+# ==============================================================================
+
+sub get_module_list
+{
+ my %list;
+
+ unless( chdir($sci_modules_dir) )
+ {
+ print 'The directory '.$sci_modules_dir.' doesn\'t exist or read access denied'."\n";
+ exit;
+ }
+
+ my @candidates = <*>;
+
+ foreach my $candidate (@candidates)
+ {
+ if( -e $sci_modules_dir.'/'.$candidate.'/Makefile.am' )
+ {
+ $list{$candidate} = 1;
+ }
+ }
+
+ return %list;
+}
+
+# ==============================================================================
+# $path = get_po_file($module,$language)
+# ==============================================================================
+
+sub get_po_file
+{
+ my $module = $_[0];
+ my $language = $_[1];
+
+ my $po_dir = get_module_path($module).'/locales/'.$language;
+ my $po_file = $po_dir.'/'.$module.'.po';
+
+ unless( -f $po_file )
+ {
+ return '';
+ }
+
+ return $po_file;
+}
+
+# ==============================================================================
+# $path = get_module_path($module,$language)
+# ==============================================================================
+
+sub get_module_path
+{
+ return $sci_modules_dir.'/'.$_[0];
+}
+
+
+# ==============================================================================
+# %str = load_po_file($po_file)
+# ==============================================================================
+
+sub load_po_file
+{
+ my $po_file = $_[0];
+
+ my $hash_ref = Locale::PO->load_file_ashash($po_file);
+ my %hash = %$hash_ref;
+
+ my %hash_out;
+
+ foreach my $key (sort keys %hash)
+ {
+ my $po_object = $hash{$key};
+
+ if(length($key) <= 2)
+ {
+ next;
+ }
+
+ # remove the " at the start and the end of string
+ my $new_key = substr($key,1,length($key)-2);
+
+ unless( $po_object->obsolete == 1 )
+ {
+ $hash_out{$new_key} = $hash{$key};
+ }
+ }
+
+ return %hash_out;
+}
+
+
+# ==============================================================================
+# %modules = get_msg_modules($msgid)
+# ==============================================================================
+
+sub get_msg_modules
+{
+ my $msgid = $_[0];
+ my %modules;
+
+ my $modules_str = $msg_module{ $msgid };
+ my @modules_array = split(/,/,$modules_str);
+
+
+ foreach my $module (sort @modules_array)
+ {
+ $modules{$module} = 1;
+ }
+
+ return %modules;
+}
+
+
+# ==============================================================================
+# $msgstr = get_msg_translation($msgid,$module,$language)
+# ==============================================================================
+
+sub get_msg_translation
+{
+ my $msgid = $_[0];
+ my $module = $_[1];
+ my $language = $_[2];
+
+ my $po_file = get_po_file($module,$language);
+
+ my $hash_ref = Locale::PO->load_file_ashash($po_file);
+ my %hash = %$hash_ref;
+
+ my $msgstr = '';
+
+ foreach my $key (sort keys %hash)
+ {
+ if( $key eq '"'.$msgid.'"' )
+ {
+ my $po_object = $hash{$key};
+ $msgstr = $po_object->msgstr;
+ $msgstr = substr($msgstr,1,length($msgstr)-2);
+ last;
+ }
+ }
+
+ return $msgstr;
+}
+
+
+# ==============================================================================
+# %msgstr = get_msg_translations($msgid,$language)
+# ==============================================================================
+
+sub get_msg_translations
+{
+ my $msgid = $_[0];
+ my $language = $_[1];
+
+ my %msgstr;
+
+ my %modules = get_msg_modules($msgid);
+
+
+ foreach my $module (sort keys %modules)
+ {
+ my $translation = get_msg_translation($msgid,$module,$language);
+
+ unless( exists($msgstr{$translation}) )
+ {
+ $msgstr{$translation} = $module;
+ }
+ }
+
+ return %msgstr;
+}
+
+
+
+
+
+
+