diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 58e3aea9b7..b0c13d9818 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -855,6 +855,8 @@ bool LLAppViewer::init() // that use findSkinnedFilenames(), will include the localized files. gDirUtilp->setSkinFolder(gDirUtilp->getSkinFolder(), LLUI::getLanguage()); + loadLocalizedSettingsComments(); + // Setup LLTrans after LLUI::initClass has been called. initStrings(); @@ -3135,6 +3137,57 @@ bool LLAppViewer::initConfiguration() return true; // Config was successful. } +static void apply_localized_comments(LLControlGroup& group, const LLSD& comments) +{ + for (LLSD::map_const_iterator it = comments.beginMap(); it != comments.endMap(); ++it) + { + LLControlVariablePtr control = group.getControl(it->first); + if (control.notNull()) + { + const std::string comment = it->second.asString(); + if (!comment.empty()) + { + control->setComment(comment); + } + } + } +} + +void LLAppViewer::loadLocalizedSettingsComments() +{ + std::string lang = LLUI::getLanguage(); + if (lang.empty() || lang == "en") + { + return; + } + + std::string path = gDirUtilp->findSkinnedFilename( + LLDir::XUI, "settings_comments.xml", LLDir::CURRENT_SKIN); + if (path.empty()) + { + return; + } + + llifstream infile; + infile.open(path.c_str()); + if (!infile.is_open()) + { + return; + } + + LLSD comments; + if (LLSDParser::PARSE_FAILURE == LLSDSerialize::fromXML(comments, infile)) + { + infile.close(); + LL_WARNS("Settings") << "Failed to parse localized settings comments file: " << path << LL_ENDL; + return; + } + infile.close(); + + apply_localized_comments(gSavedSettings, comments); + apply_localized_comments(gSavedPerAccountSettings, comments); +} + // The following logic is replicated in initConfiguration() (to be able to get // some initial strings before we've finished initializing enough to know the // current language) and also in init() (to initialize for real). Somehow it diff --git a/indra/newview/llappviewer.h b/indra/newview/llappviewer.h index 1b1a89d756..837b598ae5 100644 --- a/indra/newview/llappviewer.h +++ b/indra/newview/llappviewer.h @@ -321,6 +321,7 @@ class LLAppViewer : public LLApp bool initThreads(); // Initialize viewer threads, return false on failure. bool initConfiguration(); // Initialize settings from the command line/config file. void initStrings(); // Initialize LLTrans machinery + void loadLocalizedSettingsComments(); // Override Debug Settings comments for current locale bool initCache(); // Initialize local client cache. // We have switched locations of both Mac and Windows cache, make sure diff --git a/indra/newview/skins/default/xui/pt/floater_settings_debug.xml b/indra/newview/skins/default/xui/pt/floater_settings_debug.xml index 83f7b24572..eefd407a3c 100644 --- a/indra/newview/skins/default/xui/pt/floater_settings_debug.xml +++ b/indra/newview/skins/default/xui/pt/floater_settings_debug.xml @@ -1,8 +1,13 @@ - + + + + + + Nome da configuração de depuração - - + + @@ -10,4 +15,5 @@