Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions indra/newview/llappviewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions indra/newview/llappviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 9 additions & 3 deletions indra/newview/skins/default/xui/pt/floater_settings_debug.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<floater name="settings_debug" title="DEBUG SETTINGS">
<floater name="settings_debug" title="CONFIGURAÇÕES DE DEPURAÇÃO">
<filter_editor label="Digite o texto de busca" name="filter_input"/>
<scroll_list name="setting_list">
<scroll_list.columns label="Configuração" name="setting"/>
</scroll_list>
<text name="setting_name_txt">Nome da configuração de depuração</text>
<radio_group name="boolean_combo">
<radio_item label="TRUE" name="TRUE" />
<radio_item label="FALSE" name="FALSE" />
<radio_item label="VERDADEIRO" name="TRUE"/>
<radio_item label="FALSO" name="FALSE"/>
</radio_group>
<color_swatch label="Cor" name="val_color_swatch"/>
<spinner label="x" name="val_spinner_1"/>
<spinner label="x" name="val_spinner_2"/>
<spinner label="x" name="val_spinner_3"/>
<spinner label="x" name="val_spinner_4"/>
<button label="Restaurar padrão" name="default_btn"/>
<check_box label="Mostrar apenas configurações alteradas" name="hide_default"/>
</floater>
Loading
Loading