Add CURRECY_TEXT definition and handling for internationalization

This commit is contained in:
Melanie
2013-04-27 02:37:52 +02:00
parent 9cd9fcdfbe
commit 77fdb895e6
3 changed files with 18 additions and 0 deletions

View File

@@ -58,6 +58,7 @@ HippoGridInfo::HippoGridInfo(const std::string& gridName) :
mAutoUpdate(false),
mMaxAgentGroups(-1),
mCurrencySymbol("OS$"),
mCurrencyText("OS Dollars"),
mRealCurrencySymbol("US$"),
mDirectoryFee(30),
mUPCSupported(false)
@@ -172,6 +173,11 @@ const std::string& HippoGridInfo::getCurrencySymbol() const
return mCurrencySymbol;
}
const std::string& HippoGridInfo::getCurrencyText() const
{
return mCurrencyText;
}
const std::string& HippoGridInfo::getRealCurrencySymbol() const
{
return mRealCurrencySymbol;
@@ -188,6 +194,7 @@ void HippoGridInfo::setPlatform(Platform platform)
if (mPlatform == PLATFORM_SECONDLIFE)
{
mCurrencySymbol = "L$";
mCurrencyText = "Linden Dollars";
}
}
@@ -319,6 +326,11 @@ void HippoGridInfo::setCurrencySymbol(const std::string& sym)
mCurrencySymbol = sym.substr(0, 3);
}
void HippoGridInfo::setCurrencyText(const std::string& text)
{
mCurrencyText = text;
}
void HippoGridInfo::setRealCurrencySymbol(const std::string& sym)
{
mRealCurrencySymbol = sym.substr(0, 3);

View File

@@ -61,6 +61,7 @@ public:
int getMaxAgentGroups() const { return mMaxAgentGroups; }
const std::string& getCurrencySymbol() const;
const std::string& getCurrencyText() const;
const std::string& getRealCurrencySymbol() const;
std::string getUploadFee() const;
std::string getGroupCreationFee() const;
@@ -87,6 +88,7 @@ public:
bool getUPCSupported();
void setCurrencySymbol(const std::string& sym);
void setCurrencyText(const std::string& text);
void setRealCurrencySymbol(const std::string& sym);
void setDirectoryFee(int fee);
bool supportsInvLinks();
@@ -124,6 +126,7 @@ private:
int mMaxAgentGroups;
std::string mCurrencySymbol;
std::string mCurrencyText;
std::string mRealCurrencySymbol;
int mDirectoryFee;
std::string mGridMessage;

View File

@@ -1002,6 +1002,7 @@ bool idle_startup()
if(!gHippoGridManager->getConnectedGrid()->isSecondLife())
{
LLTrans::setDefaultArg("[CURRENCY]",gHippoGridManager->getConnectedGrid()->getCurrencySymbol()); //replace [CURRENCY] with OS$, not L$ for instance.
LLTrans::setDefaultArg("[CURRENCY_TEXT]",gHippoGridManager->getConnectedGrid()->getCurrencyText()); //replace [CURRENCYTEXT] with OS DOllars, not Linden Dollars for instance.
LLTrans::setDefaultArg("[SECOND_LIFE]", gHippoGridManager->getConnectedGrid()->getGridName());
LLTrans::setDefaultArg("[SECOND_LIFE_GRID]", gHippoGridManager->getConnectedGrid()->getGridName() + " Grid");
LLTrans::setDefaultArg("[GRID_OWNER]", gHippoGridManager->getConnectedGrid()->getGridOwner());
@@ -4378,6 +4379,8 @@ bool process_login_success_response(std::string& password)
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setSearchUrl(tmp);
tmp = response["currency"].asString();
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencySymbol(tmp);
tmp = response["currency_text"].asString();
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setCurrencyText(tmp);
tmp = response["real_currency"].asString();
if (!tmp.empty()) gHippoGridManager->getConnectedGrid()->setRealCurrencySymbol(tmp);
tmp = response["directory_fee"].asString();