aboutsummaryrefslogtreecommitdiff
path: root/extension/src/openvic-extension/classes
diff options
context:
space:
mode:
author hop311 <hop3114@gmail.com>2024-09-19 00:12:41 +0200
committer hop311 <hop3114@gmail.com>2024-09-20 14:21:53 +0200
commitb78093041d877ef30c2d17878cc03fd30c4b229c (patch)
treea7959840d5332abbbbeeef24a6322b215d1beaeb /extension/src/openvic-extension/classes
parentc26247464feabe0fbb9d6a8527b242d667faa066 (diff)
Add RuleSet and ModifierValue tooltip making functionsrule-modifier-tooltips
Diffstat (limited to 'extension/src/openvic-extension/classes')
-rw-r--r--extension/src/openvic-extension/classes/GUILabel.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/extension/src/openvic-extension/classes/GUILabel.cpp b/extension/src/openvic-extension/classes/GUILabel.cpp
index 7e93f01..3c7cfed 100644
--- a/extension/src/openvic-extension/classes/GUILabel.cpp
+++ b/extension/src/openvic-extension/classes/GUILabel.cpp
@@ -523,7 +523,16 @@ String GUILabel::generate_substituted_text(String const& base_text) const {
String value = substitution_dict.get(key, String {});
// Use the un-substituted key if no value is found or the value is empty
- result += value.is_empty() ? key : is_auto_translating() ? tr(value) : value;
+ if (value.is_empty()) {
+ value = key;
+ }
+
+ // Translate the value if auto-translating (even if it's the key after a failed substitution)
+ if (is_auto_translating()) {
+ value = tr(value);
+ }
+
+ result += value;
start_pos = marker_end_pos + get_substitution_marker().length();
}