mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Fix CSV translation not updating after reimport
This commit is contained in:
@@ -255,6 +255,20 @@ PackedStringArray TranslationDomain::get_loaded_locales() const {
|
||||
return locales;
|
||||
}
|
||||
|
||||
// Translation objects that could potentially be used for the given locale.
|
||||
HashSet<Ref<Translation>> TranslationDomain::get_potential_translations(const String &p_locale) const {
|
||||
HashSet<Ref<Translation>> res;
|
||||
|
||||
for (const Ref<Translation> &E : translations) {
|
||||
ERR_CONTINUE(E.is_null());
|
||||
|
||||
if (TranslationServer::get_singleton()->compare_locales(p_locale, E->get_locale()) > 0) {
|
||||
res.insert(E);
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
Ref<Translation> TranslationDomain::get_translation_object(const String &p_locale) const {
|
||||
Ref<Translation> res;
|
||||
int best_score = 0;
|
||||
|
||||
@@ -71,6 +71,7 @@ public:
|
||||
StringName get_message_from_translations(const String &p_locale, const StringName &p_message, const StringName &p_context) const;
|
||||
StringName get_message_from_translations(const String &p_locale, const StringName &p_message, const StringName &p_message_plural, int p_n, const StringName &p_context) const;
|
||||
PackedStringArray get_loaded_locales() const;
|
||||
HashSet<Ref<Translation>> get_potential_translations(const String &p_locale) const;
|
||||
|
||||
public:
|
||||
Ref<Translation> get_translation_object(const String &p_locale) const;
|
||||
|
||||
Reference in New Issue
Block a user