Merge pull request #110378 from timothyqiu/rtl-preview

Make text-related nodes translation domain aware
This commit is contained in:
Thaddeus Crews 2025-10-16 12:48:05 -05:00
commit 9e96c7d9b8
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC
23 changed files with 132 additions and 101 deletions

View file

@ -88,7 +88,7 @@ void SpinBox::_update_text(bool p_only_update_if_value_changed) {
double step = get_step();
String value = String::num(get_value(), Math::range_step_decimals(step));
if (is_localizing_numeral_system()) {
value = TS->format_number(value);
value = TS->format_number(value, _get_locale());
}
if (p_only_update_if_value_changed && value == last_text_value) {
@ -137,8 +137,9 @@ void SpinBox::_text_submitted(const String &p_string) {
Ref<Expression> expr;
expr.instantiate();
const String &lang = _get_locale();
text = text.replace_char(';', ',');
text = TS->parse_number(text);
text = TS->parse_number(text, lang);
// Ignore the prefix and suffix in the expression.
text = text.trim_prefix(prefix + " ").trim_suffix(" " + suffix);
@ -147,7 +148,7 @@ void SpinBox::_text_submitted(const String &p_string) {
if (err != OK) {
// If the expression failed try without converting commas to dots - they might have been for parameter separation.
text = p_string;
text = TS->parse_number(text);
text = TS->parse_number(text, lang);
text = text.trim_prefix(prefix + " ").trim_suffix(" " + suffix);
err = expr->parse(text);