diff options
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(); |