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
|
|
@ -1688,6 +1688,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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -801,6 +801,9 @@ protected:
|
|||
|
||||
virtual bool _uses_signal_mutex() const;
|
||||
|
||||
// Internal helper to get the current locale, taking into account the translation domain.
|
||||
String _get_locale() const;
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
struct VirtualMethodTracker {
|
||||
void **method;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue