From c74f87015118a6da7036623d026fc512f46af9d5 Mon Sep 17 00:00:00 2001 From: Sergei Litovchuk Date: Thu, 18 Mar 2010 19:42:38 +0200 Subject: (EXT-5982) [FRAGMENTATION] L$ kaufen window (Buy L$) - Moved hardcoded strings in LLFloaterBuyCurrency::buyCurrency() calls to strings.xml Reviewed by Vadim Savchuk https://codereview.productengine.com/secondlife/r/56/ --HG-- branch : product-engine --- indra/newview/llassetuploadresponders.cpp | 5 ++++- indra/newview/llfloaterbuycurrency.cpp | 3 +-- indra/newview/llpanelobjectinventory.cpp | 4 +++- indra/newview/llpanelplaceprofile.cpp | 8 ++++++-- indra/newview/llviewermenu.cpp | 8 ++++++-- indra/newview/llviewermenufile.cpp | 12 +++++++----- indra/newview/llviewermessage.cpp | 4 +++- indra/newview/skins/default/xui/en/floater_buy_currency.xml | 2 +- indra/newview/skins/default/xui/en/strings.xml | 13 +++++++------ 9 files changed, 38 insertions(+), 21 deletions(-) diff --git a/indra/newview/llassetuploadresponders.cpp b/indra/newview/llassetuploadresponders.cpp index 80cf8f1d61..8441796219 100644 --- a/indra/newview/llassetuploadresponders.cpp +++ b/indra/newview/llassetuploadresponders.cpp @@ -182,7 +182,10 @@ void LLAssetUploadResponder::uploadFailure(const LLSD& content) // deal with L$ errors if (reason == "insufficient funds") { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs"), LLGlobalEconomy::Singleton::getInstance()->getPriceUpload()); + S32 price = LLGlobalEconomy::Singleton::getInstance()->getPriceUpload(); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs", args), price); } else { diff --git a/indra/newview/llfloaterbuycurrency.cpp b/indra/newview/llfloaterbuycurrency.cpp index 1642e6725e..7fddd1fc5f 100644 --- a/indra/newview/llfloaterbuycurrency.cpp +++ b/indra/newview/llfloaterbuycurrency.cpp @@ -234,8 +234,7 @@ void LLFloaterBuyCurrencyUI::updateUI() if (mHasTarget) { childSetVisible("buy_action", true); - childSetTextArg("buy_action", "[NAME]", mTargetName); - childSetTextArg("buy_action", "[PRICE]", llformat("%d",mTargetPrice)); + childSetTextArg("buy_action", "[ACTION]", mTargetName); } } diff --git a/indra/newview/llpanelobjectinventory.cpp b/indra/newview/llpanelobjectinventory.cpp index 69b8571bfb..c43cbf5819 100644 --- a/indra/newview/llpanelobjectinventory.cpp +++ b/indra/newview/llpanelobjectinventory.cpp @@ -609,7 +609,9 @@ void LLTaskInvFVBridge::performAction(LLFolderView* folder, LLInventoryModel* mo { if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_costs"), price); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_costs", args), price); } else { diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index cdd79b1559..1a1650c38b 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -567,9 +567,13 @@ void LLPanelPlaceProfile::onForSaleBannerClick() if(parcel->getLocalID() == mSelectedParcelID && mLastSelectedRegionID ==selected_region->getRegionID()) { - if(parcel->getSalePrice() - gStatusBar->getBalance() > 0) + S32 price = parcel->getSalePrice(); + + if(price - gStatusBar->getBalance() > 0) { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("buying_selected_land"), parcel->getSalePrice()); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("buying_selected_land", args), price); } else { diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index 5c40d02f8d..dc8185c770 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -3274,7 +3274,9 @@ void handle_buy_object(LLSaleInfo sale_info) if (price > 0 && price > gStatusBar->getBalance()) { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_object_costs"), price); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", price); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("this_object_costs", args), price); return; } @@ -4404,8 +4406,10 @@ void handle_buy_or_take() } else { + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", total_price); LLFloaterBuyCurrency::buyCurrency( - "Buying this costs", total_price); + LLTrans::getString("BuyingCosts", args), total_price); } } else diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp index 00762894cd..dfde9a9d1d 100644 --- a/indra/newview/llviewermenufile.cpp +++ b/indra/newview/llviewermenufile.cpp @@ -811,10 +811,10 @@ void upload_done_callback(const LLUUID& uuid, void* user_data, S32 result, LLExt if(!(can_afford_transaction(expected_upload_cost))) { - LLFloaterBuyCurrency::buyCurrency( - llformat(LLTrans::getString("UploadingCosts").c_str(), - data->mAssetInfo.getName().c_str()), - expected_upload_cost); + LLStringUtil::format_map_t args; + args["NAME"] = data->mAssetInfo.getName(); + args["AMOUNT"] = llformat("%d", expected_upload_cost); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("UploadingCosts", args), expected_upload_cost); is_balance_sufficient = FALSE; } else if(region) @@ -1001,7 +1001,9 @@ void upload_new_resource(const LLTransactionID &tid, LLAssetType::EType asset_ty if (balance < expected_upload_cost) { // insufficient funds, bail on this upload - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs"), expected_upload_cost); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", expected_upload_cost); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("uploading_costs", args), expected_upload_cost); return; } } diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index bd0012057c..210557f68f 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -272,7 +272,9 @@ void give_money(const LLUUID& uuid, LLViewerRegion* region, S32 amount, BOOL is_ } else { - LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("giving"), amount); + LLStringUtil::format_map_t args; + args["AMOUNT"] = llformat("%d", amount); + LLFloaterBuyCurrency::buyCurrency(LLTrans::getString("giving", args), amount); } } diff --git a/indra/newview/skins/default/xui/en/floater_buy_currency.xml b/indra/newview/skins/default/xui/en/floater_buy_currency.xml index 961bd6b5e4..e02d32596a 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_currency.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_currency.xml @@ -182,7 +182,7 @@ width="180" layout="topleft" name="buy_action"> - [NAME] L$ [PRICE] + [ACTION] Acquired Items Cancel - Uploading %s costs + Uploading [NAME] costs L$ [AMOUNT] + Buying this costs L$ [AMOUNT] Unknown file extension .%s Expected .wav, .tga, .bmp, .jpg, .jpeg, or .bvh @@ -3060,11 +3061,11 @@ If you continue to receive this message, contact the [SUPPORT_SITE]. to join a group to upload - Giving - Uploading costs - This costs - Buying selected land - This object costs" + Giving L$ [AMOUNT] + Uploading costs L$ [AMOUNT] + This costs L$ [AMOUNT] + Buying selected land L$ [AMOUNT] + This object costs L$ [AMOUNT] Everyone Officers -- cgit v1.2.3