Skip to content

Commit

Permalink
chore(gui): add missing ref text in untranslated messages (#2319)
Browse files Browse the repository at this point in the history
fix
  • Loading branch information
skylot committed Oct 24, 2024
1 parent 233f869 commit c0815b1
Show file tree
Hide file tree
Showing 10 changed files with 208 additions and 183 deletions.
17 changes: 10 additions & 7 deletions jadx-gui/src/main/java/jadx/gui/utils/tools/NLSAddNewLines.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import org.slf4j.LoggerFactory;

/**
* Automatically add new i18n lines from reference (EN) into others languages
* Automatically add new i18n lines from reference (EN) into other languages
*/
public class NLSAddNewLines {
private static final Logger LOG = LoggerFactory.getLogger(NLSAddNewLines.class);
Expand Down Expand Up @@ -50,22 +50,25 @@ private static void process() throws Exception {
private static void applyFix(List<String> refLines, Path path) throws IOException {
List<String> lines = Files.readAllLines(path);
int linesCount = lines.size();
if (refLines.size() <= linesCount) {
LOG.info("Skip {}, already fixed", path);
return;
}
boolean updated = false;
for (int i = 0; i < linesCount; i++) {
String line = lines.get(i);
String refLine = refLines.get(i);
if (!isSameKey(refLine, line)) {
if (isSameKey(refLine, line)) {
if (line.startsWith("#") && line.endsWith("=")) {
// add ref text if missing to simplify translation
lines.set(i, '#' + refLine);
updated = true;
}
} else {
if (refLine.isEmpty()) {
lines.add(i, "");
} else {
lines.add(i, "#" + refLine);
lines.add(i, '#' + refLine);
}
updated = true;
}

}
if (updated) {
LOG.info("Updating {}", path);
Expand Down
40 changes: 20 additions & 20 deletions jadx-gui/src/main/resources/i18n/Messages_de_DE.properties
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ menu.navigation=Navigation
menu.text_search=Textsuche
menu.class_search=Klassen-Suche
menu.comment_search=Kommentar suchen
#menu.go_to_main_activity=
#menu.go_to_main_activity=Go to main Activity
#menu.go_to_application=Go to Application
#menu.go_to_android_manifest=Go to AndroidManifest.xml
menu.tools=Tools
Expand All @@ -26,7 +26,7 @@ menu.deobfuscation=Deobfuskierung
menu.log=Log-Anzeige
menu.help=Hilfe
menu.about=Über
#menu.quark=
#menu.quark=Quark Engine
menu.update_label=Neue Version %s verfügbar!

file.open_action=Datei öffnen…
Expand All @@ -39,9 +39,9 @@ file.save_project_as=Projekt speichern als…
file.reload=Dateien neu laden
file.live_reload=Live nachladen
file.live_reload_desc=Dateien bei Änderungen autom. neuladen
#file.open_mappings=
#file.save_mappings=
#file.save_mappings_as=
#file.open_mappings=Open mappings...
#file.save_mappings=Save mappings
#file.save_mappings_as=Save mappings as...
#file.close_mappings=Zuordnungen exportieren als…
file.save_all=Alles speichern
#file.save=Save
Expand Down Expand Up @@ -70,7 +70,7 @@ progress.decompile=Dekompilieren
progress.canceling=Breche ab

error_dialog.title=Fehler
#error_dialog.not_found=
#error_dialog.not_found=%s not found

search.previous=Zurück
search.next=Weiter
Expand All @@ -79,7 +79,7 @@ search.regex=Regex
search.match_case=Groß/Kleinschreibung beachten
search.whole_word=Ganzes Wort
search.find=Suchen
#search.results=
#search.results=%s%d results

tabs.copy_class_name=Klassennamen kopieren
tabs.close=Schließen
Expand Down Expand Up @@ -153,8 +153,8 @@ search_dialog.comments=Kommentare
search_dialog.resource=Ressourcen
search_dialog.keep_open=Offen halten
search_dialog.tip_searching=Suchen…
#search_dialog.limit_package=
#search_dialog.package_not_found=
#search_dialog.limit_package=Limit to package:
#search_dialog.package_not_found=No matching package found

usage_dialog.title=Verwendungssuche
usage_dialog.label=Verwendungen von:
Expand All @@ -181,8 +181,8 @@ about_dialog.title=Über JADX
preferences.title=Einstellungen
preferences.deobfuscation=Deobfuskierung
preferences.appearance=Aussehen
#preferences.shortcuts=
#preferences.select_shortcuts=
#preferences.shortcuts=Shortcuts
#preferences.select_shortcuts=Select a specific shortcuts group
preferences.decompile=Dekompilierung
preferences.plugins=Plugins
preferences.project=Projekt
Expand Down Expand Up @@ -224,7 +224,7 @@ preferences.raw_cfg=RAW CFG-Grafiken generieren
#preferences.update_channel=Jadx update channel
#preferences.integerFormat=Integer format
preferences.font=Schrift ändern
#preferences.smali_font=
#preferences.smali_font=Monospaced font (Smali/Hex)
preferences.laf_theme=Thema
preferences.theme=Thema ändern
preferences.start_jobs=Autom. Hintergrunddekompilierung starten
Expand Down Expand Up @@ -288,9 +288,9 @@ msg.open_file=Bitte Datei öffnen
msg.saving_sources=Quelltexte speichern
msg.language_changed_title=Sprache speichern
msg.language_changed=Die neue Sprache wird beim nächsten Start der Anwendung angezeigt.
#msg.warning_title=
#msg.common_mouse_shortcut=
#msg.duplicate_shortcut=
#msg.warning_title=Warning
#msg.common_mouse_shortcut=This is a commonly used key, are you sure you would like to bind it to an action?
#msg.duplicate_shortcut=The shortcut %s is already set in action "%s" from category "%s", continue ?
msg.project_error_title=Fehler
msg.project_error=Projekt konnte nicht geladen werden
msg.cmd_select_class_error=Klasse\n%s auswählen nicht möglich\nSie existiert nicht.
Expand Down Expand Up @@ -325,7 +325,7 @@ popup.search_global=Globale Suche "%s"

#script.run=Run
#script.save=Save
#script.auto_complete=
#script.auto_complete=Auto Complete
#script.check=Check
#script.format=Reformat
#script.log=Show log
Expand Down Expand Up @@ -443,7 +443,7 @@ adb_dialog.restart_while_debugging_title=Neustart während der Fehlersuche
adb_dialog.restart_while_debugging_msg=Sie debuggen eine App, sind Sie sicher, dass Sie eine Sitzung neu starten können?
adb_dialog.starting_debugger=Debugger starten…

#action.variant=
#action_category.menu_toolbar=
#action_category.code_area=
#action_category.plugin_script=
#action.variant=%s (variant)
#action_category.menu_toolbar=Menu / Toolbar
#action_category.code_area=Code Area
#action_category.plugin_script=Plugin Script
Loading

0 comments on commit c0815b1

Please sign in to comment.