From b7d0bb9e1ed7aab7eb6d4bb0eb129778892f503a Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Fri, 26 Mar 2010 19:09:11 +0200 Subject: Fixed bug EXT-6399 (System locale is the same for all languages). Problem: * English locale was set for all languages. * Specifying a correct locale didn't affect anything, including date/time formatting. My investigation has shown that LLStringUtil was instantiated twice: in the main binary and in libllcommon.so. Because LLStringUtil::setLocale() was called from newview and getLocale() was called from llcommon, they effectively used *different* instances of LLStringUtil::sLocale. Hence getLocale() always returned empty string. This seems to be caused by get/setLocale() methods not being dllexported. The fix instantiates get/setLocale() and sLocale in llcommon and exposes them to use from newview (i.e. prevents multiple instantiation). Besides, I specified correct locale names for all languages and platforms. Reviewed by Leyla: https://codereview.productengine.com/secondlife/r/104/ --HG-- branch : product-engine --- indra/llcommon/llstring.cpp | 14 ++++++++++++++ indra/llcommon/llstring.h | 4 ++-- indra/newview/skins/default/xui/da/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/de/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/es/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/fr/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/it/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/ja/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/nl/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/pl/language_settings.xml | 6 +++--- indra/newview/skins/default/xui/pt/language_settings.xml | 6 +++--- 11 files changed, 43 insertions(+), 29 deletions(-) diff --git a/indra/llcommon/llstring.cpp b/indra/llcommon/llstring.cpp index 5f3d9d6582..b5a73ec1d1 100644 --- a/indra/llcommon/llstring.cpp +++ b/indra/llcommon/llstring.cpp @@ -911,6 +911,20 @@ bool LLStringUtil::simpleReplacement(std::string &replacement, std::string token return false; } +//static +template<> +void LLStringUtil::setLocale(std::string inLocale) +{ + sLocale = inLocale; +}; + +//static +template<> +std::string LLStringUtil::getLocale(void) +{ + return sLocale; +}; + // static template<> void LLStringUtil::formatNumber(std::string& numStr, std::string decimals) diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index 62cedcde4e..96588b29b9 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -241,8 +241,8 @@ public: LL_COMMON_API static S32 format(std::basic_string& s, const LLSD& substitutions); LL_COMMON_API static bool simpleReplacement(std::basic_string& replacement, std::basic_string token, const format_map_t& substitutions); LL_COMMON_API static bool simpleReplacement(std::basic_string& replacement, std::basic_string token, const LLSD& substitutions); - static void setLocale (std::string inLocale) {sLocale = inLocale;}; - static std::string getLocale (void) {return sLocale;}; + LL_COMMON_API static void setLocale (std::string inLocale); + LL_COMMON_API static std::string getLocale (void); static bool isValidIndex(const std::basic_string& string, size_type i) { diff --git a/indra/newview/skins/default/xui/da/language_settings.xml b/indra/newview/skins/default/xui/da/language_settings.xml index 71418d446a..fa8a788605 100644 --- a/indra/newview/skins/default/xui/da/language_settings.xml +++ b/indra/newview/skins/default/xui/da/language_settings.xml @@ -3,9 +3,9 @@ - english - C - C + danish + da_DK.UTF-8 + da_DK.UTF-8 - english - C - C + german + de_DE.UTF-8 + de_DE.UTF-8 - english - C - C + spanish + es_ES.UTF-8 + es_ES.UTF-8 - english - C - C + french + fr_FR.UTF-8 + fr_FR.UTF-8 - english - C - C + italian + it_IT.UTF-8 + it_IT.UTF-8 - english - C - C + japanese + ja_JP.UTF-8 + ja_JP.UTF-8 - english - C - C + dutch + nl_NL.UTF-8 + nl_NL.UTF-8 - english - C - C + polish + pl_PL.UTF-8 + pl_PL.UTF-8 - english - C - C + portuguese + pt_PT.UTF-8 + pt_PT.UTF-8