From 8dba9d833013bc877cbc8f3695dcf22b87dbbdeb Mon Sep 17 00:00:00 2001 From: Michael Alexsander Date: Wed, 6 Mar 2024 16:10:23 -0300 Subject: Fix POT generation missing some strings when built-in ones are enabled --- editor/editor_translation.cpp | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) (limited to 'editor/editor_translation.cpp') diff --git a/editor/editor_translation.cpp b/editor/editor_translation.cpp index 302a81669d..194d78326d 100644 --- a/editor/editor_translation.cpp +++ b/editor/editor_translation.cpp @@ -160,20 +160,22 @@ List get_extractable_message_list() { ExtractableTranslationList *etl = _extractable_translations; List msgids; while (etl->data) { - Vector data; - data.resize(etl->uncomp_size); - int ret = Compression::decompress(data.ptrw(), etl->uncomp_size, etl->data, etl->comp_size, Compression::MODE_DEFLATE); - ERR_FAIL_COND_V_MSG(ret == -1, msgids, "Compressed file is corrupt."); + if (!strcmp(etl->lang, "source")) { + Vector data; + data.resize(etl->uncomp_size); + int ret = Compression::decompress(data.ptrw(), etl->uncomp_size, etl->data, etl->comp_size, Compression::MODE_DEFLATE); + ERR_FAIL_COND_V_MSG(ret == -1, msgids, "Compressed file is corrupt."); - Ref fa; - fa.instantiate(); - fa->open_custom(data.ptr(), data.size()); + Ref fa; + fa.instantiate(); + fa->open_custom(data.ptr(), data.size()); - Ref tr = TranslationLoaderPO::load_translation(fa); + Ref tr = TranslationLoaderPO::load_translation(fa); - if (tr.is_valid()) { - tr->get_message_list(&msgids); - break; + if (tr.is_valid()) { + tr->get_message_list(&msgids); + break; + } } etl++; -- cgit v1.2.3