From c645e9e59e9e0a83a25f2c782ac79c21d519939e Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 25 Jul 2011 17:34:06 +0300 Subject: STORM-1220 FIXED Localized sim product name (e.g. "Estate / Full Region") everywhere. --- indra/newview/llfloaterbuyland.cpp | 2 +- indra/newview/llfloaterland.cpp | 13 ++----------- indra/newview/llfloaterregioninfo.cpp | 9 +++------ indra/newview/llpanelplaceprofile.cpp | 2 +- indra/newview/llviewerregion.cpp | 6 ++++++ indra/newview/llviewerregion.h | 1 + 6 files changed, 14 insertions(+), 19 deletions(-) diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp index 610142b5a9..5cfdd69f7b 100644 --- a/indra/newview/llfloaterbuyland.cpp +++ b/indra/newview/llfloaterbuyland.cpp @@ -529,7 +529,7 @@ void LLFloaterBuyLandUI::updateCovenantInfo() LLTextBox* region_type = getChild("region_type_text"); if (region_type) { - region_type->setText(region->getSimProductName()); + region_type->setText(region->getLocalizedSimProductName()); } LLTextBox* resellable_clause = getChild("resellable_clause"); diff --git a/indra/newview/llfloaterland.cpp b/indra/newview/llfloaterland.cpp index 9b7593ce61..4746f93009 100644 --- a/indra/newview/llfloaterland.cpp +++ b/indra/newview/llfloaterland.cpp @@ -566,10 +566,7 @@ void LLPanelLandGeneral::refresh() if (regionp) { insert_maturity_into_textbox(mContentRating, gFloaterView->getParentFloater(this), MATURITY); - - std::string land_type; - bool is_land_type_localized = LLTrans::findString(land_type, regionp->getSimProductName()); - mLandType->setText(is_land_type_localized ? land_type : regionp->getSimProductName()); + mLandType->setText(regionp->getLocalizedSimProductName()); } // estate owner/manager cannot edit other parts of the parcel @@ -2883,13 +2880,7 @@ void LLPanelLandCovenant::refresh() } LLTextBox* region_landtype = getChild("region_landtype_text"); - if (region_landtype) - { - std::string land_type; - bool is_land_type_localized = LLTrans::findString(land_type, region->getSimProductName()); - - region_landtype->setText(is_land_type_localized ? land_type : region->getSimProductName()); - } + region_landtype->setText(region->getLocalizedSimProductName()); LLTextBox* region_maturity = getChild("region_maturity_text"); if (region_maturity) diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp index 538c5e3b88..9a99417e93 100644 --- a/indra/newview/llfloaterregioninfo.cpp +++ b/indra/newview/llfloaterregioninfo.cpp @@ -336,7 +336,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) LLViewerRegion* region = gAgent.getRegion(); BOOL allow_modify = gAgent.isGodlike() || (region && region->canManageEstate()); - // *TODO: Replace parcing msg with accessing the region info model. + // *TODO: Replace parsing msg with accessing the region info model. LLRegionInfoModel& region_info = LLRegionInfoModel::instance(); // extract message @@ -368,6 +368,7 @@ void LLFloaterRegionInfo::processRegionInfo(LLMessageSystem* msg) msg->getSize("RegionInfo2", "ProductName") > 0) { msg->getString("RegionInfo2", "ProductName", sim_type); + LLTrans::findString(sim_type, sim_type); // try localizing sim product name } // GENERAL PANEL @@ -2409,11 +2410,7 @@ bool LLPanelEstateCovenant::refreshFromRegion(LLViewerRegion* region) } LLTextBox* region_landtype = getChild("region_landtype_text"); - if (region_landtype) - { - region_landtype->setText(region->getSimProductName()); - } - + region_landtype->setText(region->getLocalizedSimProductName()); // let the parent class handle the general data collection. bool rv = LLPanelRegionInfo::refreshFromRegion(region); diff --git a/indra/newview/llpanelplaceprofile.cpp b/indra/newview/llpanelplaceprofile.cpp index 1e9ce58237..b3c2fe2552 100644 --- a/indra/newview/llpanelplaceprofile.cpp +++ b/indra/newview/llpanelplaceprofile.cpp @@ -434,7 +434,7 @@ void LLPanelPlaceProfile::displaySelectedParcelInfo(LLParcel* parcel, } mRegionNameText->setText(region->getName()); - mRegionTypeText->setText(region->getSimProductName()); + mRegionTypeText->setText(region->getLocalizedSimProductName()); // Determine parcel owner if (parcel->isPublic()) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index bb7170e0f7..c33b39b449 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -558,6 +558,12 @@ const std::string LLViewerRegion::getSimAccessString() const return accessToString(mSimAccess); } +std::string LLViewerRegion::getLocalizedSimProductName() const +{ + const std::string& spn = getSimProductName(); + std::string localized_spn; + return LLTrans::findString(localized_spn, spn) ? localized_spn : spn; +} // static std::string LLViewerRegion::regionFlagsToString(U32 flags) diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index f68b51ea65..dbc12f548b 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -193,6 +193,7 @@ public: const std::string& getSimColoName() const { return mColoName; } const std::string& getSimProductSKU() const { return mProductSKU; } const std::string& getSimProductName() const { return mProductName; } + std::string getLocalizedSimProductName() const; // Returns "Sandbox", "Expensive", etc. static std::string regionFlagsToString(U32 flags); -- cgit v1.2.3 From 7e405ef0e3efce400db53ddc16d367680da659c9 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Mon, 25 Jul 2011 23:46:28 +0300 Subject: STORM-1220 FOLLOWUP Prevent displaying unlocalized sim product name. Removed LLViewerRegion::getSimProductName() so that it doesn't mistakenly get used in UI code, thus causing localization bugs. --- indra/newview/llviewerregion.cpp | 3 +-- indra/newview/llviewerregion.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp index c33b39b449..d4e0831c33 100644 --- a/indra/newview/llviewerregion.cpp +++ b/indra/newview/llviewerregion.cpp @@ -560,9 +560,8 @@ const std::string LLViewerRegion::getSimAccessString() const std::string LLViewerRegion::getLocalizedSimProductName() const { - const std::string& spn = getSimProductName(); std::string localized_spn; - return LLTrans::findString(localized_spn, spn) ? localized_spn : spn; + return LLTrans::findString(localized_spn, mProductName) ? localized_spn : mProductName; } // static diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h index dbc12f548b..a105ff625d 100644 --- a/indra/newview/llviewerregion.h +++ b/indra/newview/llviewerregion.h @@ -192,7 +192,6 @@ public: S32 getSimCPURatio() const { return mCPURatio; } const std::string& getSimColoName() const { return mColoName; } const std::string& getSimProductSKU() const { return mProductSKU; } - const std::string& getSimProductName() const { return mProductName; } std::string getLocalizedSimProductName() const; // Returns "Sandbox", "Expensive", etc. -- cgit v1.2.3