From 8b09f20d7dc6c476bcba83f5932f9d18b66ef507 Mon Sep 17 00:00:00 2001 From: Vadim Savchuk Date: Wed, 14 Jul 2010 15:05:28 +0300 Subject: EXT-8310 FIXED Incorrect currency format in the Buy L$ floater. Changes in the Buy L$ floater: * Set system locale before formatting currency. * Made money format configurable (via strings.xml). * Placed the "L$" label to the right of the line editor in FR locale. Details: Actually, the proper way to fix this and similar number formatting bugs would be to set the system locale at startup, but: 1. That triggers assertions when parsing locale-agnostic XML files like avatar_skeleton.xml. 2. I'm wary of making such global changes so close to the 2.1 release. Therefore I just temporarily override current locale before formatting a number and restore the previous locale afterwards. Reviewed by Tofu at https://codereview.productengine.com/secondlife/r/751/ --HG-- branch : product-engine --- indra/newview/llcurrencyuimanager.cpp | 9 ++++++++- indra/newview/skins/default/xui/en/strings.xml | 3 +++ indra/newview/skins/default/xui/fr/floater_buy_currency.xml | 4 ++-- indra/newview/skins/default/xui/fr/strings.xml | 1 + 4 files changed, 14 insertions(+), 3 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llcurrencyuimanager.cpp b/indra/newview/llcurrencyuimanager.cpp index fd3df359bd..7ebcef943e 100644 --- a/indra/newview/llcurrencyuimanager.cpp +++ b/indra/newview/llcurrencyuimanager.cpp @@ -35,6 +35,8 @@ #include "lluictrlfactory.h" #include "lltextbox.h" #include "lllineeditor.h" +#include "llresmgr.h" // for LLLocale +#include "lltrans.h" #include "llviewercontrol.h" #include "llversioninfo.h" @@ -323,7 +325,12 @@ std::string LLCurrencyUIManager::Impl::getLocalEstimate() const if (mUSDCurrencyEstimated) { // we have the old-style USD-specific value - return "US$ " + llformat("%#.2f", mUSDCurrencyEstimatedCost / 100.0); + LLStringUtil::format_map_t args; + { + LLLocale locale_override(LLStringUtil::getLocale()); + args["[AMOUNT]"] = llformat("%#.2f", mUSDCurrencyEstimatedCost / 100.0); + } + return LLTrans::getString("LocalEstimateUSD", args); } return ""; } diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index b91acbe27d..dfca765783 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -3222,4 +3222,7 @@ Abuse Report [MDAY] AM PM + + + US$ [AMOUNT] diff --git a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml index 4eaff8535e..b3acc83078 100644 --- a/indra/newview/skins/default/xui/fr/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/fr/floater_buy_currency.xml @@ -22,10 +22,10 @@ le Lindex... Je veux acheter - + L$ - + 1234 diff --git a/indra/newview/skins/default/xui/fr/strings.xml b/indra/newview/skins/default/xui/fr/strings.xml index f8da908cff..e6da5f4a3d 100644 --- a/indra/newview/skins/default/xui/fr/strings.xml +++ b/indra/newview/skins/default/xui/fr/strings.xml @@ -3817,4 +3817,5 @@ de l'infraction signalée PM + [AMOUNT] US$ -- cgit v1.2.3