PO loader: Fix unclosed files and error messages

Fixes #40324.

(cherry picked from commit 47cc202972)

Also removes empty `p_path` as done in 4857648a16.
This commit is contained in:
Rémi Verschelde
2020-07-14 13:16:49 +02:00
parent 4677502d7c
commit a06ee5e763
3 changed files with 16 additions and 15 deletions

View File

@@ -997,7 +997,7 @@ void EditorSettings::setup_language() {
FileAccessMemory *fa = memnew(FileAccessMemory);
fa->open_custom(data.ptr(), data.size());
Ref<Translation> tr = TranslationLoaderPO::load_translation(fa, NULL, "translation_" + String(etl->lang));
Ref<Translation> tr = TranslationLoaderPO::load_translation(fa, NULL);
if (tr.is_valid()) {
tr->set_locale(etl->lang);