You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
Make text-related nodes translation domain aware
- Makes `is_layout_rtl()` translation domain aware - Makes various text-drawing controls translation domain aware - Makes translation preview use the project's fallback locale when disabled
This commit is contained in:
@@ -3407,21 +3407,20 @@ TextServer::StructuredTextParser RichTextLabel::_find_stt(Item *p_item) {
|
||||
}
|
||||
|
||||
String RichTextLabel::_find_language(Item *p_item) {
|
||||
Item *item = p_item;
|
||||
|
||||
while (item) {
|
||||
String lang = language;
|
||||
for (Item *item = p_item; item; item = item->parent) {
|
||||
if (item->type == ITEM_LANGUAGE) {
|
||||
ItemLanguage *p = static_cast<ItemLanguage *>(item);
|
||||
return p->language;
|
||||
} else if (item->type == ITEM_PARAGRAPH) {
|
||||
ItemParagraph *p = static_cast<ItemParagraph *>(item);
|
||||
return p->language;
|
||||
lang = p->language;
|
||||
break;
|
||||
}
|
||||
if (item->type == ITEM_PARAGRAPH) {
|
||||
ItemParagraph *p = static_cast<ItemParagraph *>(item);
|
||||
lang = p->language;
|
||||
break;
|
||||
}
|
||||
|
||||
item = item->parent;
|
||||
}
|
||||
|
||||
return language;
|
||||
return lang.is_empty() ? _get_locale() : lang;
|
||||
}
|
||||
|
||||
Color RichTextLabel::_find_color(Item *p_item, const Color &p_default_color) {
|
||||
|
||||
Reference in New Issue
Block a user