summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVadim ProductEngine <vsavchuk@productengine.com>2011-07-25 17:34:06 +0300
committerVadim ProductEngine <vsavchuk@productengine.com>2011-07-25 17:34:06 +0300
commitc645e9e59e9e0a83a25f2c782ac79c21d519939e (patch)
tree4d49f3ac14b5291c1482271f1e9692f2f920a26a
parent578e44d9b89012d8d4e1352dfd8a2b56b9d58163 (diff)
STORM-1220 FIXED Localized sim product name (e.g. "Estate / Full Region") everywhere.
-rw-r--r--indra/newview/llfloaterbuyland.cpp2
-rw-r--r--indra/newview/llfloaterland.cpp13
-rw-r--r--indra/newview/llfloaterregioninfo.cpp9
-rw-r--r--indra/newview/llpanelplaceprofile.cpp2
-rw-r--r--indra/newview/llviewerregion.cpp6
-rw-r--r--indra/newview/llviewerregion.h1
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<LLTextBox>("region_type_text");
if (region_type)
{
- region_type->setText(region->getSimProductName());
+ region_type->setText(region->getLocalizedSimProductName());
}
LLTextBox* resellable_clause = getChild<LLTextBox>("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<LLTextBox>("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<LLTextBox>("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<LLTextBox>("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);