mirror of
https://github.com/godotengine/godot.git
synced 2025-11-01 06:01:14 +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
|
|
@ -1650,6 +1650,19 @@ bool Object::_uses_signal_mutex() const {
|
|||
return true;
|
||||
}
|
||||
|
||||
String Object::_get_locale() const {
|
||||
TranslationServer *ts = TranslationServer::get_singleton();
|
||||
const StringName domain_name = get_translation_domain();
|
||||
if (ts->has_domain(domain_name)) {
|
||||
const Ref<TranslationDomain> domain = ts->get_or_add_domain(domain_name);
|
||||
const String &overridden = domain->get_locale_override();
|
||||
if (!overridden.is_empty()) {
|
||||
return overridden;
|
||||
}
|
||||
}
|
||||
return ts->get_locale();
|
||||
}
|
||||
|
||||
void Object::_set_bind(const StringName &p_set, const Variant &p_value) {
|
||||
set(p_set, p_value);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue