summaryrefslogtreecommitdiff
path: root/indra/newview/llappviewer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llappviewer.cpp')
-rw-r--r--indra/newview/llappviewer.cpp49
1 files changed, 49 insertions, 0 deletions
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 58e3aea9b7..67e8214bf2 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,53 @@ 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())
+ {
+ control->setComment(it->second.asString());
+ }
+ }
+}
+
+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