mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +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:
parent
149a4b4ca1
commit
172c80df67
23 changed files with 132 additions and 101 deletions
|
|
@ -214,11 +214,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;
|
||||
|
|
@ -482,8 +479,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