Skip to content

Commit

Permalink
Merge pull request #88598 from YeldhamDev/this_wasnt_even_my_bug!
Browse files Browse the repository at this point in the history
Fix `RichTextLabel`'s tag stack being overridden on translation change
  • Loading branch information
akien-mga authored Feb 20, 2024
2 parents fb8f0da + aa258c6 commit b8f106a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scene/gui/rich_text_label.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5650,10 +5650,15 @@ void RichTextLabel::set_text(const String &p_bbcode) {
}

void RichTextLabel::_apply_translation() {
// If `text` is empty, it could mean that the tag stack is being used instead. Leave it be.
if (text.is_empty()) {
return;
}

String xl_text = atr(text);
if (use_bbcode) {
parse_bbcode(xl_text);
} else { // raw text
} else { // Raw text.
clear();
add_text(xl_text);
}
Expand Down

0 comments on commit b8f106a

Please sign in to comment.