diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-15 08:44:18 +0100 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-07-15 08:44:18 +0100 |
commit | 08647d14c256cd6959a9853dc194614771a19501 (patch) | |
tree | cee1dbf7c126b0bc8e20ae36c5adc3055f2ba145 /indra/newview/llagentlanguage.cpp | |
parent | 7a3a192f790992bbb83461c0d24036580bfc3cdc (diff) | |
parent | 6f640f86ca09e16df5db5316f3e953d8c633249a (diff) |
slightly hairy merge from PE's viewer-release
Diffstat (limited to 'indra/newview/llagentlanguage.cpp')
-rw-r--r-- | indra/newview/llagentlanguage.cpp | 26 |
1 files changed, 20 insertions, 6 deletions
diff --git a/indra/newview/llagentlanguage.cpp b/indra/newview/llagentlanguage.cpp index e97f136489..3d4e34a549 100644 --- a/indra/newview/llagentlanguage.cpp +++ b/indra/newview/llagentlanguage.cpp @@ -39,21 +39,35 @@ // library includes #include "llui.h" // getLanguage() -LLAgentLanguage::LLAgentLanguage() +// static +void LLAgentLanguage::init() { - gSavedSettings.getControl("Language")->getSignal()->connect(boost::bind(&update)); - gSavedSettings.getControl("InstallLanguage")->getSignal()->connect(boost::bind(&update)); - gSavedSettings.getControl("SystemLanguage")->getSignal()->connect(boost::bind(&update)); - gSavedSettings.getControl("LanguageIsPublic")->getSignal()->connect(boost::bind(&update)); + gSavedSettings.getControl("Language")->getSignal()->connect(boost::bind(&onChange)); + gSavedSettings.getControl("InstallLanguage")->getSignal()->connect(boost::bind(&onChange)); + gSavedSettings.getControl("SystemLanguage")->getSignal()->connect(boost::bind(&onChange)); + gSavedSettings.getControl("LanguageIsPublic")->getSignal()->connect(boost::bind(&onChange)); } +// static +void LLAgentLanguage::onChange() +{ + // Clear inventory cache so that default names of inventory items + // appear retranslated (EXT-8308). + gSavedSettings.setBOOL("PurgeCacheOnNextStartup", TRUE); +} // send language settings to the sim // static bool LLAgentLanguage::update() { LLSD body; - std::string url = gAgent.getRegion()->getCapability("UpdateAgentLanguage"); + std::string url; + + if (gAgent.getRegion()) + { + url = gAgent.getRegion()->getCapability("UpdateAgentLanguage"); + } + if (!url.empty()) { std::string language = LLUI::getLanguage(); |