After discussion with Nicky: Use user's locale from OS if using system default language, otherwise use locale configured in particular language_settings.xml file
parent
b03e5c716c
commit
3df26d1e24
|
|
@ -1298,9 +1298,7 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
|
|||
// std::locale() throws if the locale is unknown! (EXT-7926)
|
||||
try
|
||||
{
|
||||
// <FS:Ansariel> Use user's system locale setting for number formatting
|
||||
//strStream.imbue(std::locale(sLocale.c_str()));
|
||||
strStream.imbue(std::locale(""));
|
||||
strStream.imbue(std::locale(sLocale.c_str()));
|
||||
} catch (const std::exception &)
|
||||
{
|
||||
LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL;
|
||||
|
|
@ -1337,9 +1335,7 @@ void LLStringUtil::formatNumber(std::string& numStr, std::string decimals)
|
|||
// std::locale() throws if the locale is unknown! (EXT-7926)
|
||||
try
|
||||
{
|
||||
// <FS:Ansariel> Use user's system locale setting for number formatting
|
||||
//strStream.imbue(std::locale(sLocale.c_str()));
|
||||
strStream.imbue(std::locale(""));
|
||||
strStream.imbue(std::locale(sLocale.c_str()));
|
||||
} catch (const std::exception &)
|
||||
{
|
||||
LL_WARNS_ONCE("Locale") << "Cannot set locale to " << sLocale << LL_ENDL;
|
||||
|
|
|
|||
|
|
@ -291,16 +291,24 @@ void LLResMgr::getIntegerString( std::string& output, S32 input ) const
|
|||
}
|
||||
|
||||
#if LL_WINDOWS
|
||||
const std::string LLLocale::USER_LOCALE("English_United States.1252");// = LLStringUtil::null;
|
||||
// <FS:Ansariel> Make user locale work properly
|
||||
//const std::string LLLocale::USER_LOCALE("English_United States.1252");// = LLStringUtil::null;
|
||||
std::string LLLocale::USER_LOCALE("");// = LLStringUtil::null;
|
||||
const std::string LLLocale::SYSTEM_LOCALE("English_United States.1252");
|
||||
#elif LL_DARWIN
|
||||
const std::string LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLStringUtil::null;
|
||||
// <FS:Ansariel> Make user locale work properly
|
||||
//const std::string LLLocale::USER_LOCALE("en_US.iso8859-1");// = LLStringUtil::null;
|
||||
std::string LLLocale::USER_LOCALE("");// = LLStringUtil::null;
|
||||
const std::string LLLocale::SYSTEM_LOCALE("en_US.iso8859-1");
|
||||
#elif LL_SOLARIS
|
||||
const std::string LLLocale::USER_LOCALE("en_US.ISO8859-1");
|
||||
// <FS:Ansariel> Make user locale work properly
|
||||
//const std::string LLLocale::USER_LOCALE("en_US.ISO8859-1");
|
||||
std::string LLLocale::USER_LOCALE("");
|
||||
const std::string LLLocale::SYSTEM_LOCALE("C");
|
||||
#else // LL_LINUX likes this
|
||||
const std::string LLLocale::USER_LOCALE("en_US.utf8");
|
||||
// <FS:Ansariel> Make user locale work properly
|
||||
//const std::string LLLocale::USER_LOCALE("en_US.utf8");
|
||||
std::string LLLocale::USER_LOCALE("");
|
||||
const std::string LLLocale::SYSTEM_LOCALE("C");
|
||||
#endif
|
||||
|
||||
|
|
@ -327,3 +335,11 @@ LLLocale::~LLLocale()
|
|||
{
|
||||
setlocale( LC_ALL, mPrevLocaleString.c_str() );
|
||||
}
|
||||
|
||||
// <FS:Ansariel> Make user locale work properly
|
||||
//static
|
||||
void LLLocale::setUserLocale(const std::string& locale)
|
||||
{
|
||||
USER_LOCALE = locale;
|
||||
}
|
||||
// </FS:Ansariel>
|
||||
|
|
|
|||
|
|
@ -67,7 +67,10 @@ public:
|
|||
LLLocale(const std::string& locale_string);
|
||||
virtual ~LLLocale();
|
||||
|
||||
static const std::string USER_LOCALE;
|
||||
// <FS:Ansariel> Make user locale work properly
|
||||
//static const std::string USER_LOCALE;
|
||||
static void setUserLocale(const std::string& locale);
|
||||
static std::string USER_LOCALE;
|
||||
static const std::string SYSTEM_LOCALE;
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ void LLAvatarRenderNotifier::displayNotification(bool show_over_limit)
|
|||
// <FS:Ansariel> FIRE-19958: Add digit group separators to avatar complexity notification
|
||||
//args["AGENT_COMPLEXITY"] = LLSD::Integer(mLatestAgentComplexity);
|
||||
{
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
std::string complexity_string;
|
||||
LLResMgr::getInstance()->getIntegerString(complexity_string, mLatestAgentComplexity);
|
||||
args["AGENT_COMPLEXITY"] = complexity_string;
|
||||
|
|
|
|||
|
|
@ -344,7 +344,7 @@ void LLFloaterInspect::refresh()
|
|||
std::string creator_name;
|
||||
S32 pos = mObjectList->getScrollPos();
|
||||
// PoundLife - Improved Object Inspect
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr& res_mgr = LLResMgr::instance();
|
||||
LLSelectMgr& sel_mgr = LLSelectMgr::instance();
|
||||
S32 fcount = 0;
|
||||
|
|
|
|||
|
|
@ -3343,7 +3343,7 @@ void LLAvatarComplexityControls::setText(U32 value, LLTextBox* text_box)
|
|||
// <FS:Ansariel> Proper number formatting with delimiter
|
||||
//text_box->setText(llformat("%d", value));
|
||||
std::string output_string;
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(output_string, value);
|
||||
text_box->setText(output_string);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,10 +397,7 @@ void LLFloaterSnapshot::Impl::updateControls(LLFloaterSnapshotBase* floater)
|
|||
// *TODO: Separate maximum size for Web images from postcards
|
||||
LL_DEBUGS() << "Is snapshot up-to-date? " << got_snap << LL_ENDL;
|
||||
|
||||
// <FS:Ansariel> Use user-default locale from operating system
|
||||
//LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLLocale locale("");
|
||||
// </FS:Ansariel>
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
std::string bytes_string;
|
||||
if (got_snap)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -2496,7 +2496,7 @@ std::string LLFolderBridge::getLabelSuffix() const
|
|||
//}
|
||||
if (cat_array.size() > 0 || item_array.size() > 0)
|
||||
{
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLStringUtil::format_map_t args;
|
||||
std::string count_str;
|
||||
LLResMgr::getInstance()->getIntegerString(count_str, item_array.size());
|
||||
|
|
|
|||
|
|
@ -976,7 +976,7 @@ void LLOutfitListBase::refreshList(const LLUUID& category_id)
|
|||
// <FS:Ansariel> FIRE-12939: Add outfit count to outfits list
|
||||
{
|
||||
std::string count_string;
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(count_string, (S32)cat_array.size());
|
||||
getChild<LLTextBox>("OutfitcountText")->setTextArg("COUNT", count_string);
|
||||
}
|
||||
|
|
@ -1154,7 +1154,7 @@ void LLOutfitListBase::deselectOutfit(const LLUUID& category_id)
|
|||
void LLOutfitListBase::updateAvatarComplexity(U32 complexity)
|
||||
{
|
||||
std::string complexity_string;
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(complexity_string, complexity);
|
||||
|
||||
mAvatarComplexityLabel->setTextArg("[WEIGHT]", complexity_string);
|
||||
|
|
|
|||
|
|
@ -1055,10 +1055,7 @@ void LLPanelMainInventory::updateItemcountText()
|
|||
mItemCount = new_count;
|
||||
// </FS:Ansariel>
|
||||
mItemCountString = "";
|
||||
// <FS:Ansariel> Use user-default locale from operating system
|
||||
//LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLLocale locale("");
|
||||
// </FS:Ansariel>
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(mItemCountString, mItemCount);
|
||||
|
||||
// <FS:Ansariel> Include folders in inventory count
|
||||
|
|
|
|||
|
|
@ -1441,7 +1441,7 @@ void LLPanelOutfitEdit::saveListSelection()
|
|||
void LLPanelOutfitEdit::updateAvatarComplexity(U32 complexity)
|
||||
{
|
||||
std::string complexity_string;
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(complexity_string, complexity);
|
||||
|
||||
mAvatarComplexityLabel->setTextArg("[WEIGHT]", complexity_string);
|
||||
|
|
|
|||
|
|
@ -489,7 +489,7 @@ bool LLPanelWearing::populateAttachmentsList(bool update)
|
|||
}
|
||||
// <FS:Ansariel> Show avatar complexity in appearance floater
|
||||
std::string complexity_string;
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(complexity_string, mTempItemComplexityMap[attachment->getID()]);
|
||||
row["columns"][2]["column"] = "weight";
|
||||
row["columns"][2]["value"] = complexity_string;
|
||||
|
|
@ -664,7 +664,7 @@ void LLPanelWearing::copyToClipboard()
|
|||
void LLPanelWearing::updateAvatarComplexity(U32 complexity, const std::map<LLUUID, U32>& item_complexity, const std::map<LLUUID, U32>& temp_item_complexity, U32 body_parts_complexity)
|
||||
{
|
||||
std::string complexity_string;
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(complexity_string, complexity);
|
||||
|
||||
mAvatarComplexityLabel->setTextArg("[WEIGHT]", complexity_string);
|
||||
|
|
|
|||
|
|
@ -244,6 +244,7 @@
|
|||
#include "llnotificationmanager.h"
|
||||
#include "llpresetsmanager.h"
|
||||
#include "llprogressview.h"
|
||||
#include "llresmgr.h"
|
||||
#include "lltoolbarview.h"
|
||||
#include "NACLantispam.h"
|
||||
#include "streamtitledisplay.h"
|
||||
|
|
@ -618,7 +619,12 @@ bool idle_startup()
|
|||
system = osString.substr (begIdx, endIdx - begIdx);
|
||||
system += "Locale";
|
||||
|
||||
LLStringUtil::setLocale (LLTrans::getString(system));
|
||||
// <FS:Ansariel> Make user locale work properly
|
||||
//LLStringUtil::setLocale (LLTrans::getString(system));
|
||||
std::string user_locale = gSavedSettings.getString("Language") == "default" ? "" : LLTrans::getString(system);
|
||||
LLStringUtil::setLocale(user_locale);
|
||||
LLLocale::setUserLocale(user_locale);
|
||||
// </FS:Ansariel>
|
||||
|
||||
//note: Removing this line will cause incorrect button size in the login screen. -- bao.
|
||||
gTextureList.updateImages(0.01f) ;
|
||||
|
|
|
|||
|
|
@ -3795,7 +3795,7 @@ void LLVOAvatar::idleUpdateNameTagText(BOOL new_name)
|
|||
(!isSelf() && (!show_too_complex_only_arw_tag || isTooComplex()))))
|
||||
{
|
||||
std::string complexity_string;
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
|
||||
// always show complexity, even if the reason for a jelly baby is the texture area
|
||||
// this is technically not 100% correct but the decision logic with all of the
|
||||
|
|
|
|||
|
|
@ -477,7 +477,7 @@ void FSPanelCOFWearableOutfitListItem::updateItemWeight(U32 item_weight)
|
|||
std::string complexity_string;
|
||||
if (item_weight > 0)
|
||||
{
|
||||
LLLocale locale("");
|
||||
LLLocale locale(LLLocale::USER_LOCALE);
|
||||
LLResMgr::getInstance()->getIntegerString(complexity_string, item_weight);
|
||||
}
|
||||
mWeightCtrl->setText(complexity_string);
|
||||
|
|
|
|||
Loading…
Reference in New Issue