Commits

Scott Lawrence committed 4087401 Merge

merge changes for storm-1220

Comments (0)

Files changed (6)

indra/newview/llfloaterbuyland.cpp

 	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");

indra/newview/llfloaterland.cpp

 		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
 	}
 
 	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)

indra/newview/llfloaterregioninfo.cpp

 	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
 		msg->getSize("RegionInfo2", "ProductName") > 0)
 	{
 		msg->getString("RegionInfo2", "ProductName", sim_type);
+		LLTrans::findString(sim_type, sim_type); // try localizing sim product name
 	}
 
 	// GENERAL PANEL
 	}
 	
 	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);

indra/newview/llpanelplaceprofile.cpp

 	}
 
 	mRegionNameText->setText(region->getName());
-	mRegionTypeText->setText(region->getSimProductName());
+	mRegionTypeText->setText(region->getLocalizedSimProductName());
 
 	// Determine parcel owner
 	if (parcel->isPublic())

indra/newview/llviewerregion.cpp

 	return accessToString(mSimAccess);
 }
 
+std::string LLViewerRegion::getLocalizedSimProductName() const
+{
+	std::string localized_spn;
+	return LLTrans::findString(localized_spn, mProductName) ? localized_spn : mProductName;
+}
 
 // static
 std::string LLViewerRegion::regionFlagsToString(U32 flags)

indra/newview/llviewerregion.h

 	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.
 	static std::string regionFlagsToString(U32 flags);