Commit ba6dd081 authored by Ahmed Ashour's avatar Ahmed Ashour Committed by skylot

fix(gui): add missing translations keys, and ensure all files match (PR #525)

parent 7cdb0318
......@@ -756,7 +756,7 @@ public class MainWindow extends JFrame {
}
private class JPackagePopUp extends JPopupMenu {
JMenuItem excludeItem = new JCheckBoxMenuItem("Exclude");
JMenuItem excludeItem = new JCheckBoxMenuItem(NLS.str("popup.exclude"));
public JPackagePopUp(JPackage pkg) {
excludeItem.setSelected(!pkg.isEnabled());
......
......@@ -124,8 +124,9 @@ popup.copy=Copy
popup.paste=Paste
popup.delete=Delete
popup.select_all=Select All
popup.find_usage=Find Usage
popup.exclude=Exclude
certificate.title=Certificate
certificate.cert_type=Type
certificate.serialSigVer=Version
......@@ -147,7 +148,7 @@ certificate.serialPubKeyY=Y
apkSignature.signer=Signer
apkSignature.verificationSuccess=Signature verification succeeded
apkSignature.verificationFailed=Signature verification succeeded
apkSignature.verificationFailed=Signature verification failed
apkSignature.signatureSuccess=Valid APK signature v%d found
apkSignature.signatureFailed=Invalid APK signature v%d found
apkSignature.errors=Errors
......
......@@ -7,6 +7,7 @@ menu.no_recent_files=No hay archivos recientes
menu.preferences=Preferencias
menu.sync=Sincronizar con el editor
menu.flatten=Mostrar paquetes en vista plana
#menu.heapUsageBar=
menu.navigation=Navegación
menu.text_search=Buscar texto
menu.class_search=Buscar clase
......@@ -46,6 +47,10 @@ tabs.closeAll=Cerrar todo
nav.back=Atrás
nav.forward=Adelante
#message.indexingClassesSkipped=
#heapUsage.text=
search_dialog.open=Abrir
search_dialog.cancel=Cancelar
search_dialog.open_by_name=Buscar texto:
......@@ -81,8 +86,14 @@ preferences.fallback=Modo fallback (simple dump)
preferences.showInconsistentCode=Mostrar código inconsistente
preferences.escapeUnicode=Escape unicode
preferences.replaceConsts=Reemplazar constantes
#preferences.respectBytecodeAccessModifiers=
#preferences.useImports=
preferences.skipResourcesDecode=No descodificar recursos
preferences.threads=Número de hilos a procesar
#preferences.excludedPackages=
#preferences.excludedPackages.tooltip=
#preferences.excludedPackages.button=
#preferences.excludedPackages.editDialog=
preferences.cfg=Generar methods CFG graphs (in 'dot' format)
preferences.raw_cfg=Generate RAW CFG graphs
preferences.font=Fuente del editor
......@@ -113,6 +124,8 @@ popup.copy=Copiar
popup.paste=Pegar
popup.delete=Borrar
popup.select_all=Seleccionar todo
#popup.find_usage=
#popup.exclude=
certificate.title=Certificado
certificate.cert_type=Tipo
......@@ -125,9 +138,20 @@ certificate.serialValidUntil=Válido hasta
certificate.serialPubKeyType=Tipo de clave pública
certificate.serialPubKeyExponent=Exponente
certificate.serialPubKeyModulus=Módulo
#certificate.serialPubKeyModulusSize=
certificate.serialSigType=Tipo de firma
certificate.serialSigOID=Firma OID
certificate.serialMD5=Huella MD5
certificate.serialSHA1=Huella SHA-1
certificate.serialSHA256=Huella SHA-256
certificate.serialPubKeyY=Y
#apkSignature.signer=
#apkSignature.verificationSuccess=
#apkSignature.verificationFailed=
#apkSignature.signatureSuccess=
#apkSignature.signatureFailed=
#apkSignature.errors=
#apkSignature.warnings=
#apkSignature.exception=
#apkSignature.unprotectedEntry=
......@@ -124,8 +124,9 @@ popup.copy=复制
popup.paste=粘贴
popup.delete=删除
popup.select_all=全选
popup.find_usage=查找用例
#popup.exclude=
certificate.title=证书
certificate.cert_type=类型
certificate.serialSigVer=版本
......@@ -147,7 +148,7 @@ certificate.serialPubKeyY=Y
apkSignature.signer=签名人
apkSignature.verificationSuccess=签名验证成功
apkSignature.verificationFailed=签名验证成功
#apkSignature.verificationFailed=
apkSignature.signatureSuccess=找到有效的 APK 签名 v%d
apkSignature.signatureFailed=找到无效的 APK 签名 v%d
apkSignature.errors=错误
......
package jadx.gui;
import static org.junit.jupiter.api.Assertions.assertTrue;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.List;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
public class TestI18n {
private List<String> reference;
private String referenceName;
@Test
public void filesExactlyMatch() throws IOException {
Path path = Paths.get("./src/main/resources/i18n");
assertTrue(Files.exists(path));
Files.list(path).forEach(p -> {
List<String> lines;
try {
lines = Files.readAllLines(p);
if (reference == null) {
reference = lines;
referenceName = p.getFileName().toString();
}
else {
compareToReference(p);
}
} catch (IOException e) {
Assertions.fail("Error " + e.getMessage());
}
});
}
private void compareToReference(Path path) throws IOException {
List<String> lines = Files.readAllLines(path);
for (int i = 0; i < reference.size(); i++) {
String line = trimComment(reference.get(i));
int p0 = line.indexOf('=');
if (p0 != -1) {
String prefix = line.substring(0, p0 + 1);
if (i >= lines.size() || !trimComment(lines.get(i)).startsWith(prefix)) {
fail(path, i + 1);
}
}
}
if (lines.size() != reference.size()) {
fail(path, reference.size());
}
}
private static String trimComment(String string) {
return string.startsWith("#") ? string.substring(1) : string;
}
private void fail(Path path, int line) {
Assertions.fail("I18n files " + path.getFileName() + " and " + referenceName + " differ in line " + line);
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment