You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Cleanup editor translation related methods
- Unify logic for loading editor/property/doc/extractable translations. - Replace legacy `TranslationServer` methods with translation domains for internal translations. - Only pre-create editor/property/doc translation domains in editor builds. - Prevent adding `null` translation. - Fixes potential loading of duplicated editor translations. - Add internal `has_translation_for_locale()` instead of calling `get_loaded_translations().has()`.
This commit is contained in:
@@ -578,7 +578,7 @@ void EditorNode::_update_translations() {
|
||||
if (main->is_enabled()) {
|
||||
// Check for the exact locale.
|
||||
// `get_potential_translations("zh_CN")` could return translations for "zh".
|
||||
if (main->get_loaded_locales().has(main->get_locale_override())) {
|
||||
if (main->has_translation_for_locale(main->get_locale_override())) {
|
||||
// The set of translation resources for the current locale changed.
|
||||
const HashSet<Ref<Translation>> translations = main->get_potential_translations(main->get_locale_override());
|
||||
if (translations != tracked_translations) {
|
||||
|
||||
Reference in New Issue
Block a user