Localize Debug Settings comments (PT-BR) with English fallback#5956
Localize Debug Settings comments (PT-BR) with English fallback#5956vedned wants to merge 3 commits into
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
I have read the CLA Document and I hereby sign the CLA |
There was a problem hiding this comment.
Pull request overview
Adds runtime support for localized Debug Settings help comments by loading an optional per-locale settings_comments.xml overlay after the viewer language/skin has been initialized, with English comments preserved as the fallback. Ships an initial complete Portuguese (pt) translation for the comments and completes missing PT labels in the Debug Settings floater XUI.
Changes:
- Load
skins/default/xui/{locale}/settings_comments.xmlat startup (if present) and apply comment overrides to both Global and PerAccount control groups. - Add PT localized
settings_comments.xmlproviding translated comments for Debug Settings entries. - Update PT
floater_settings_debug.xmllabels (title/search text/columns/boolean labels/hide-default checkbox).
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| indra/newview/llappviewer.h | Declares LLAppViewer::loadLocalizedSettingsComments() for localized comment overlay loading. |
| indra/newview/llappviewer.cpp | Implements localized comment loading/parsing and applies overrides after language/skin initialization. |
| indra/newview/skins/default/xui/pt/settings_comments.xml | Adds PT localized comment map for Debug Settings (LLSD XML). |
| indra/newview/skins/default/xui/pt/floater_settings_debug.xml | Completes PT UI string overrides for the Debug Settings floater. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marchcat
left a comment
There was a problem hiding this comment.
Thank you for the contribution!
The code looks good.
|
@marchcat please note that apply_localized_comments replaces descriptions in the settings, it probably saves that way to any local file. Probably not a problem as those are user only, but worth a note. |
| LLControlVariablePtr control = group.getControl(it->first); | ||
| if (control.notNull()) | ||
| { | ||
| control->setComment(it->second.asString()); |
There was a problem hiding this comment.
Perhaps make sure string is not empty? Just in case.
There was a problem hiding this comment.
would you like me to make this small change, or will you make this small adjustment yourself? or is it fine as it is?
@marchcat @akleshchev
Address review feedback on PR secondlife#5956: do not call setComment() when the localized string is empty, preserving the English fallback. Co-authored-by: Cursor <cursoragent@cursor.com>
Address review feedback on PR secondlife#5956: do not call setComment() when the localized string is empty, preserving the English fallback.
63e01c1 to
abf9392
Compare
|
Applied the empty-string guard in |
Address review feedback on PR secondlife#5956: do not call setComment() when the localized string is empty, preserving the English fallback.
abf9392 to
45fc31b
Compare
Description
The Debug Settings panel (Advanced → Show Debug Settings) shows a help comment for each setting. Until now these comments were always displayed in English, regardless of the language selected in the viewer, because they are read directly from
app_settings/settings.xmlat runtime. This made advanced configuration harder for non-English speakers.This PR introduces localized Debug Settings comments: when a translation file exists for the active language, the viewer displays the setting descriptions in that language. When it does not, the previous behavior (English) is fully preserved. It also ships a complete PT-BR translation as the first implementation.
What changes
After the session language is initialized, the viewer loads
skins/default/xui/{locale}/settings_comments.xmland overrides the comments of the existing controls at runtime, for both the Global and PerAccount settings groups.Implementation
LLAppViewer::loadLocalizedSettingsComments()and a helperapply_localized_comments()inindra/newview/llappviewer.cpp.indra/newview/llappviewer.h.LLUI::getLanguage()is already valid and the default English comments have already been loaded.gDirUtilp->findSkinnedFilename(LLDir::XUI, "settings_comments.xml", LLDir::CURRENT_SKIN), which returns the most-localized existing path, or an empty string when none exists.LLSDSerialize::fromXMLinto a simple LLSD map (SettingName -> "translated comment"), and each entry overrides the comment of the matching control viaLLControlVariable::setComment().Why it is safe
getControl()returns anLLControlVariablePtr(smart pointer); the helper checksnotNull()before writing.initConfiguration()vialoadSettingsFromDirectory("Default", set_defaults=true), before this call.set_defaults=false, which does not callsetComment(), so translated comments are not overwritten later.llsdserialize.handllviewercontrol.halready included).Fallback behavior
PT-BR content
indra/newview/skins/default/xui/pt/settings_comments.xmlcovering 1,507 settings (1,466 fromsettings.xml+ 41 fromsettings_per_account.xml), validated as well-formed XML, with consistent terminology across families of settings.indra/newview/skins/default/xui/pt/floater_settings_debug.xml.Files changed
indra/newview/llappviewer.hindra/newview/llappviewer.cppindra/newview/skins/default/xui/pt/settings_comments.xml(new)indra/newview/skins/default/xui/pt/floater_settings_debug.xmlRelated Issues
Issue Link: relates to #5955
Checklist
Additional Notes
Debug Settings Português:
2026-06-25.16-05-15.mp4
How to test
settings_comments.xmland confirm comments fall back to English.