mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #110378 from timothyqiu/rtl-preview
Make text-related nodes translation domain aware
This commit is contained in:
commit
9e96c7d9b8
23 changed files with 132 additions and 101 deletions
|
|
@ -215,11 +215,8 @@ void Label3D::_notification(int p_what) {
|
|||
window->disconnect("size_changed", callable_mp(this, &Label3D::_font_changed));
|
||||
} break;
|
||||
case NOTIFICATION_TRANSLATION_CHANGED: {
|
||||
String new_text = atr(text);
|
||||
if (new_text == xl_text) {
|
||||
return; // Nothing new.
|
||||
}
|
||||
xl_text = new_text;
|
||||
// Language update might change the appearance of some characters.
|
||||
xl_text = atr(text);
|
||||
dirty_text = true;
|
||||
_queue_update();
|
||||
} break;
|
||||
|
|
@ -483,8 +480,9 @@ void Label3D::_shape() {
|
|||
TS->shaped_text_clear(text_rid);
|
||||
TS->shaped_text_set_direction(text_rid, text_direction);
|
||||
|
||||
String txt = (uppercase) ? TS->string_to_upper(xl_text, language) : xl_text;
|
||||
TS->shaped_text_add_string(text_rid, txt, font->get_rids(), font_size, font->get_opentype_features(), language);
|
||||
const String &lang = language.is_empty() ? _get_locale() : language;
|
||||
String txt = uppercase ? TS->string_to_upper(xl_text, lang) : xl_text;
|
||||
TS->shaped_text_add_string(text_rid, txt, font->get_rids(), font_size, font->get_opentype_features(), lang);
|
||||
|
||||
TypedArray<Vector3i> stt;
|
||||
if (st_parser == TextServer::STRUCTURED_TEXT_CUSTOM) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue