From 81dfac6d834bfd4aa74418e8c6ecfcd38adea469 Mon Sep 17 00:00:00 2001 From: Hd <49312623+HdShare@users.noreply.github.com> Date: Tue, 17 Mar 2026 03:42:24 +0800 Subject: [PATCH] fix(gui): localize code cache mode labels (PR #2825) * fix(gui): localize code cache mode labels * chore: fix spotless apply --- .../jadx/gui/cache/code/CodeCacheMode.java | 25 ++++++++++++------- .../resources/i18n/Messages_de_DE.properties | 6 +++++ .../resources/i18n/Messages_en_US.properties | 6 +++++ .../resources/i18n/Messages_es_ES.properties | 6 +++++ .../resources/i18n/Messages_id_ID.properties | 6 +++++ .../resources/i18n/Messages_ko_KR.properties | 6 +++++ .../resources/i18n/Messages_pt_BR.properties | 6 +++++ .../resources/i18n/Messages_ru_RU.properties | 6 +++++ .../resources/i18n/Messages_zh_CN.properties | 6 +++++ .../resources/i18n/Messages_zh_TW.properties | 6 +++++ 10 files changed, 70 insertions(+), 9 deletions(-) diff --git a/jadx-gui/src/main/java/jadx/gui/cache/code/CodeCacheMode.java b/jadx-gui/src/main/java/jadx/gui/cache/code/CodeCacheMode.java index ad55290a7..6a52b5dba 100644 --- a/jadx-gui/src/main/java/jadx/gui/cache/code/CodeCacheMode.java +++ b/jadx-gui/src/main/java/jadx/gui/cache/code/CodeCacheMode.java @@ -3,25 +3,32 @@ package jadx.gui.cache.code; import java.util.stream.Collectors; import java.util.stream.Stream; -// TODO: use localized strings +import jadx.gui.utils.NLS; + public enum CodeCacheMode { - MEMORY("Everything in memory: fast search, slow reopen, high memory usage"), - DISK_WITH_CACHE("Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage"), - DISK("Everything on disk: slow search, fast reopen, low memory usage"); + MEMORY("preferences.codeCacheMode.memory", "preferences.codeCacheMode.memory.desc"), + DISK_WITH_CACHE("preferences.codeCacheMode.diskWithCache", "preferences.codeCacheMode.diskWithCache.desc"), + DISK("preferences.codeCacheMode.disk", "preferences.codeCacheMode.disk.desc"); - private final String desc; + private final String labelKey; + private final String descKey; - CodeCacheMode(String desc) { - this.desc = desc; + CodeCacheMode(String labelKey, String descKey) { + this.labelKey = labelKey; + this.descKey = descKey; + } + + public String getLocalizedName() { + return NLS.str(labelKey); } public String getDesc() { - return desc; + return NLS.str(descKey); } public static String buildToolTip() { return Stream.of(values()) - .map(v -> v.name() + " - " + v.getDesc()) + .map(v -> v.getLocalizedName() + " - " + v.getDesc()) .collect(Collectors.joining("\n")); } } diff --git a/jadx-gui/src/main/resources/i18n/Messages_de_DE.properties b/jadx-gui/src/main/resources/i18n/Messages_de_DE.properties index 83b067cb1..7dc548283 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_de_DE.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_de_DE.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=Beim Starten nach Updates suchen preferences.useDx=dx/d8 zur Konvertierung von Java-Bytecode verwenden preferences.decompilationMode=Dekompilierungsmodus preferences.codeCacheMode=Cache-Code-Modus +#preferences.codeCacheMode.memory=Memory +#preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +#preferences.codeCacheMode.diskWithCache=Disk with cache +#preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +#preferences.codeCacheMode.disk=Disk +#preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage preferences.usageCacheMode=Nutzungsdaten-Cache-Modus preferences.showInconsistentCode=Inkonsistenten Code anzeigen preferences.escapeUnicode=Unicode maskieren diff --git a/jadx-gui/src/main/resources/i18n/Messages_en_US.properties b/jadx-gui/src/main/resources/i18n/Messages_en_US.properties index b3269b7ef..af19d3a57 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_en_US.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_en_US.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=Check for updates on startup preferences.useDx=Use dx/d8 to convert java bytecode preferences.decompilationMode=Decompilation mode preferences.codeCacheMode=Code cache mode +preferences.codeCacheMode.memory=Memory +preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +preferences.codeCacheMode.diskWithCache=Disk with cache +preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +preferences.codeCacheMode.disk=Disk +preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage preferences.usageCacheMode=Usage data cache mode preferences.showInconsistentCode=Show inconsistent code preferences.escapeUnicode=Escape unicode diff --git a/jadx-gui/src/main/resources/i18n/Messages_es_ES.properties b/jadx-gui/src/main/resources/i18n/Messages_es_ES.properties index 595e43960..5bb651e68 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_es_ES.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_es_ES.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=Buscar actualizaciones al iniciar #preferences.useDx=Use dx/d8 to convert java bytecode #preferences.decompilationMode=Decompilation mode #preferences.codeCacheMode=Code cache mode +#preferences.codeCacheMode.memory=Memory +#preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +#preferences.codeCacheMode.diskWithCache=Disk with cache +#preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +#preferences.codeCacheMode.disk=Disk +#preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage #preferences.usageCacheMode=Usage data cache mode preferences.showInconsistentCode=Mostrar código inconsistente preferences.escapeUnicode=Escape unicode diff --git a/jadx-gui/src/main/resources/i18n/Messages_id_ID.properties b/jadx-gui/src/main/resources/i18n/Messages_id_ID.properties index 1eec36482..ca3e2c3a4 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_id_ID.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_id_ID.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=Periksa pembaruan saat memulai preferences.useDx=Gunakan dx/d8 untuk mengonversi bytecode Java preferences.decompilationMode=Mode deskompilasi preferences.codeCacheMode=Mode cache kode +#preferences.codeCacheMode.memory=Memory +#preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +#preferences.codeCacheMode.diskWithCache=Disk with cache +#preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +#preferences.codeCacheMode.disk=Disk +#preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage preferences.usageCacheMode=Mode cache data penggunaan preferences.showInconsistentCode=Tampilkan kode yang tidak konsisten preferences.escapeUnicode=Escape unicode diff --git a/jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties b/jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties index 3902209dd..7ed10bb55 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_ko_KR.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=시작시 업데이트 확인 preferences.useDx=dx/d8을 사용하여 Java 바이트 코드 변환 preferences.decompilationMode=디컴파일 모드 preferences.codeCacheMode=코드 캐시 모드 +#preferences.codeCacheMode.memory=Memory +#preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +#preferences.codeCacheMode.diskWithCache=Disk with cache +#preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +#preferences.codeCacheMode.disk=Disk +#preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage #preferences.usageCacheMode=Usage data cache mode preferences.showInconsistentCode=디컴파일 안된 코드 표시 preferences.escapeUnicode=유니코드 이스케이프 diff --git a/jadx-gui/src/main/resources/i18n/Messages_pt_BR.properties b/jadx-gui/src/main/resources/i18n/Messages_pt_BR.properties index be24ec955..c660c62ec 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_pt_BR.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_pt_BR.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=Verificar por atualizações ao inicializar preferences.useDx=Usar dx/d8 para converter bytecode Java preferences.decompilationMode=Modo de descompilação preferences.codeCacheMode=Modo de cachê do código +#preferences.codeCacheMode.memory=Memory +#preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +#preferences.codeCacheMode.diskWithCache=Disk with cache +#preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +#preferences.codeCacheMode.disk=Disk +#preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage #preferences.usageCacheMode=Usage data cache mode preferences.showInconsistentCode=Mostrar código inconsistent preferences.escapeUnicode=Escapar unicode diff --git a/jadx-gui/src/main/resources/i18n/Messages_ru_RU.properties b/jadx-gui/src/main/resources/i18n/Messages_ru_RU.properties index ceeaf8258..d2094227b 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_ru_RU.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_ru_RU.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=Проверять наличие новых ве preferences.useDx=DX/D8 для конвертации java байткода preferences.decompilationMode=Режим декомпиляции preferences.codeCacheMode=Кеширование кода +#preferences.codeCacheMode.memory=Memory +#preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +#preferences.codeCacheMode.diskWithCache=Disk with cache +#preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +#preferences.codeCacheMode.disk=Disk +#preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage preferences.usageCacheMode=Использование кэша preferences.showInconsistentCode=Показывать некорректный код preferences.escapeUnicode=Кодирование unicode diff --git a/jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties b/jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties index 31b6baf4f..3aea75d7e 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_zh_CN.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=启动时检查更新 preferences.useDx=使用 dx/d8 来转换java字节码 preferences.decompilationMode=反编译模式 preferences.codeCacheMode=代码缓存模式 +preferences.codeCacheMode.memory=内存 +preferences.codeCacheMode.memory.desc=全部保存在内存中:搜索快,重新打开慢,内存占用高 +preferences.codeCacheMode.diskWithCache=磁盘加缓存 +preferences.codeCacheMode.diskWithCache.desc=代码保存在磁盘中并带有内存缓存:搜索速度中等,重新打开快,内存占用中等 +preferences.codeCacheMode.disk=磁盘 +preferences.codeCacheMode.disk.desc=全部保存在磁盘中:搜索慢,重新打开快,内存占用低 preferences.usageCacheMode=数据缓存模式 preferences.showInconsistentCode=显示不一致的代码 preferences.escapeUnicode=Unicode 字符转义 diff --git a/jadx-gui/src/main/resources/i18n/Messages_zh_TW.properties b/jadx-gui/src/main/resources/i18n/Messages_zh_TW.properties index 87e547a17..bf11b1787 100644 --- a/jadx-gui/src/main/resources/i18n/Messages_zh_TW.properties +++ b/jadx-gui/src/main/resources/i18n/Messages_zh_TW.properties @@ -240,6 +240,12 @@ preferences.check_for_updates=啟動時檢查更新 preferences.useDx=使用 dx/d8 來轉換 Java 位元組碼 preferences.decompilationMode=反編譯模式 preferences.codeCacheMode=程式碼快取模式 +#preferences.codeCacheMode.memory=Memory +#preferences.codeCacheMode.memory.desc=Everything in memory: fast search, slow reopen, high memory usage +#preferences.codeCacheMode.diskWithCache=Disk with cache +#preferences.codeCacheMode.diskWithCache.desc=Code saved on disk with in memory cache: medium search, fast reopen, medium memory usage +#preferences.codeCacheMode.disk=Disk +#preferences.codeCacheMode.disk.desc=Everything on disk: slow search, fast reopen, low memory usage preferences.usageCacheMode=使用資料快取模式 preferences.showInconsistentCode=顯示不一致的程式碼 preferences.escapeUnicode=Unicode 逸出