FIRE-16709: Bypass FSEnabledLanguages for llGetAgentLanguage

master
Ansariel 2015-08-20 21:05:17 +02:00
parent d693d7247c
commit d051a4afeb
3 changed files with 17 additions and 3 deletions

View File

@ -293,7 +293,10 @@ void LLUI::getMousePositionLocal(const LLView* viewp, S32 *x, S32 *y)
// language follows the OS language. In all cases the user can override
// the language manually in preferences. JC
// static
std::string LLUI::getLanguage()
// <FS:Ansariel> FIRE-16709: Bypass FSEnabledLanguages for llGetAgentLanguage
//std::string LLUI::getLanguage()
std::string LLUI::getLanguage(bool ignore_enabled_languages /*= false*/)
// </FS:Ansariel>
{
std::string language = "en";
if (sSettingGroups["config"])
@ -313,6 +316,11 @@ std::string LLUI::getLanguage()
}
// <FS:Ansariel> Limit available languages
if (ignore_enabled_languages)
{
return language;
}
bool language_enabled = false;
LLSD enabled_languages = sSettingGroups["config"]->getLLSD("FSEnabledLanguages");
for (LLSD::array_const_iterator it = enabled_languages.beginArray(); it != enabled_languages.endArray(); ++it)

View File

@ -262,7 +262,10 @@ public:
// Return the ISO639 language name ("en", "ko", etc.) for the viewer UI.
// http://www.loc.gov/standards/iso639-2/php/code_list.php
static std::string getLanguage();
// <FS:Ansariel> FIRE-16709: Bypass FSEnabledLanguages for llGetAgentLanguage
//static std::string getLanguage();
static std::string getLanguage(bool ignore_enabled_languages = false);
// </FS:Ansariel>
//helper functions (should probably move free standing rendering helper functions here)
static LLView* getRootView() { return sRootView; }

View File

@ -66,7 +66,10 @@ bool LLAgentLanguage::update()
if (!url.empty())
{
std::string language = LLUI::getLanguage();
// <FS:Ansariel> FIRE-16709: Bypass FSEnabledLanguages for llGetAgentLanguage
//std::string language = LLUI::getLanguage();
std::string language = LLUI::getLanguage(true);
// </FS:Ansariel>
body["language"] = language;
body["language_is_public"] = gSavedSettings.getBOOL("LanguageIsPublic");