From 7c4b05c000e575bd77da501e49c0faf15234357a Mon Sep 17 00:00:00 2001 From: Bruno JOFRET Date: Fri, 14 Feb 2014 10:29:17 +0100 Subject: [PATCH] Set language when not building localization. Disable external_objects_java Change-Id: I72f45b326a734cb278ec53b2ea86d899a69960c0 --- scilab/etc/modules.xml.in | 2 +- .../localization/src/c/InitializeLocalization.c | 21 +++++++++++++++++++- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/scilab/etc/modules.xml.in b/scilab/etc/modules.xml.in index 589167e..912fb53 100644 --- a/scilab/etc/modules.xml.in +++ b/scilab/etc/modules.xml.in @@ -90,6 +90,6 @@ - + diff --git a/scilab/modules/localization/src/c/InitializeLocalization.c b/scilab/modules/localization/src/c/InitializeLocalization.c index 9c4f707..138f44c 100644 --- a/scilab/modules/localization/src/c/InitializeLocalization.c +++ b/scilab/modules/localization/src/c/InitializeLocalization.c @@ -55,7 +55,6 @@ BOOL InitializeLocalization(void) strcpy(pathLocales, SCIpath); strcat(pathLocales, PATHLOCALIZATIONFILE); - if (bindtextdomain(NAMELOCALIZATIONDOMAIN, pathLocales) == NULL || !isdir(pathLocales)) { /* source tree and classic build */ @@ -74,6 +73,26 @@ BOOL InitializeLocalization(void) { /* 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); -- 1.7.9.5