summaryrefslogtreecommitdiffstats
path: root/editor/editor_translation.cpp
diff options
context:
space:
mode:
authorMichael Alexsander <michaelalexsander@protonmail.com>2024-03-06 16:10:23 -0300
committerMichael Alexsander <michaelalexsander@protonmail.com>2024-03-12 11:21:17 -0300
commit8dba9d833013bc877cbc8f3695dcf22b87dbbdeb (patch)
tree65a30b2df50a023970e3d573ed5d23933f91ac69 /editor/editor_translation.cpp
parentb18942d429c23112c3e01aa1649c1704eaf86d0d (diff)
downloadredot-engine-8dba9d833013bc877cbc8f3695dcf22b87dbbdeb.tar.gz
Fix POT generation missing some strings when built-in ones are enabled
Diffstat (limited to 'editor/editor_translation.cpp')
-rw-r--r--editor/editor_translation.cpp24
1 files changed, 13 insertions, 11 deletions
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<StringName> get_extractable_message_list() {
ExtractableTranslationList *etl = _extractable_translations;
List<StringName> msgids;
while (etl->data) {
- Vector<uint8_t> 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<uint8_t> 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<FileAccessMemory> fa;
- fa.instantiate();
- fa->open_custom(data.ptr(), data.size());
+ Ref<FileAccessMemory> fa;
+ fa.instantiate();
+ fa->open_custom(data.ptr(), data.size());
- Ref<Translation> tr = TranslationLoaderPO::load_translation(fa);
+ Ref<Translation> 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++;