Omnifilter - Added translation support for Default rule set

Added new entry into strings.xml named OmnifilterDefaultName that now contains Default name for the rule set drop down 0 index value.
Added translocation lookup when index = 0 on the reloadrules() methods.
This commit is contained in:
minerjr
2026-06-24 03:30:06 -03:00
parent d4acab6670
commit 4e20a18f5c
2 changed files with 6 additions and 2 deletions
+5 -2
View File
@@ -32,6 +32,7 @@
#include "llviewercontrol.h" // Needed for gSavedSettings
#include "llnotificationsutil.h" // Needed for Notifications
#include "llfloaterreg.h" // Needed for LLFloaterReg::showInstance
#include "lltrans.h" // Needed for LLTrans::getString
#include "fsscrolllistctrl.h"
@@ -489,7 +490,8 @@ void Omnifilter::reloadRules()
const std::string needle_rule_set_name(instance->getOrderedRuleSetName(index));
LLSD value(index);
// And add to the UI element. The value is the value that is passed along with the commit callback method.
mRuleSetsCmb->add(needle_rule_set_name, value);
// If index is 0, use the translated Default text
mRuleSetsCmb->add(index == 0 ? LLTrans::getString("OmnifilterDefaultName") : needle_rule_set_name, value);
}
// Finally, select the stored rule set
mRuleSetsCmb->selectByValue(LLSD(current_rule_set_id));
@@ -851,7 +853,8 @@ void OmnifilterMenuPanel::reloadRules()
const std::string needle_rule_set_name(instance->getOrderedRuleSetName(index));
LLSD value(index);
// And add to the UI element. The value is the value that is passed along with the commit callback method.
mRuleSetsCmb->add(needle_rule_set_name, value);
// If index is 0, use the translated Default text
mRuleSetsCmb->add(index == 0 ? LLTrans::getString("OmnifilterDefaultName") : needle_rule_set_name, value);
}
// Finally, select the stored rule set
mRuleSetsCmb->selectByValue(LLSD(current_rule_set_id));
@@ -3374,6 +3374,7 @@ Your current position: [AVATAR_POS]
<string name="Maximum">Maximum</string>
<string name="OmnifilterReplacement">Omnifilter Replacement: [REPLACEMENT]</string>
<string name="OmnifilterDefaultName">Default</string>
<string name="FSAvatarAlignToggleMini">Mini</string>
<string name="FSAvatarAlignToggleFull">Full</string>
</strings>