diff options
| author | 2020-03-05 22:17:08 +0000 | |
|---|---|---|
| committer | 2020-03-05 22:17:08 +0000 | |
| commit | 863d40a1c1f6591ef1ee8594b12ae4b0942fe810 (patch) | |
| tree | 614c0e3bc842e1ab50413dcc18b450c96224db10 /src/main/java/cuchaz/enigma/EnigmaProject.java | |
| parent | Fix drop mappings not checking localVars (diff) | |
| download | enigma-fork-863d40a1c1f6591ef1ee8594b12ae4b0942fe810.tar.gz enigma-fork-863d40a1c1f6591ef1ee8594b12ae4b0942fe810.tar.xz enigma-fork-863d40a1c1f6591ef1ee8594b12ae4b0942fe810.zip | |
Made Enigma gui translatable (#193)
* made enigma gui translatable
* key renamings
* missed strings
* string.format() & another missed string
* cached content (thanks @liach)
* added a dialog when changing language
* better sentence
* more %s
* liach's requests
* empty map
* the last (?) missed strings
* IT WORKS
* French translation
* Update fr_fr.json
Diffstat (limited to 'src/main/java/cuchaz/enigma/EnigmaProject.java')
| -rw-r--r-- | src/main/java/cuchaz/enigma/EnigmaProject.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/cuchaz/enigma/EnigmaProject.java b/src/main/java/cuchaz/enigma/EnigmaProject.java index 2a7ca98..fddaccc 100644 --- a/src/main/java/cuchaz/enigma/EnigmaProject.java +++ b/src/main/java/cuchaz/enigma/EnigmaProject.java | |||
| @@ -19,6 +19,8 @@ import cuchaz.enigma.translation.representation.entry.ClassEntry; | |||
| 19 | import cuchaz.enigma.translation.representation.entry.Entry; | 19 | import cuchaz.enigma.translation.representation.entry.Entry; |
| 20 | import cuchaz.enigma.translation.representation.entry.LocalVariableEntry; | 20 | import cuchaz.enigma.translation.representation.entry.LocalVariableEntry; |
| 21 | import cuchaz.enigma.translation.representation.entry.MethodEntry; | 21 | import cuchaz.enigma.translation.representation.entry.MethodEntry; |
| 22 | import cuchaz.enigma.utils.I18n; | ||
| 23 | |||
| 22 | import org.objectweb.asm.ClassWriter; | 24 | import org.objectweb.asm.ClassWriter; |
| 23 | import org.objectweb.asm.Opcodes; | 25 | import org.objectweb.asm.Opcodes; |
| 24 | import org.objectweb.asm.tree.ClassNode; | 26 | import org.objectweb.asm.tree.ClassNode; |
| @@ -32,12 +34,10 @@ import java.nio.file.Path; | |||
| 32 | import java.util.Collection; | 34 | import java.util.Collection; |
| 33 | import java.util.Map; | 35 | import java.util.Map; |
| 34 | import java.util.Objects; | 36 | import java.util.Objects; |
| 35 | import java.util.Optional; | ||
| 36 | import java.util.concurrent.atomic.AtomicInteger; | 37 | import java.util.concurrent.atomic.AtomicInteger; |
| 37 | import java.util.jar.JarEntry; | 38 | import java.util.jar.JarEntry; |
| 38 | import java.util.jar.JarOutputStream; | 39 | import java.util.jar.JarOutputStream; |
| 39 | import java.util.stream.Collectors; | 40 | import java.util.stream.Collectors; |
| 40 | import java.util.stream.Stream; | ||
| 41 | 41 | ||
| 42 | public class EnigmaProject { | 42 | public class EnigmaProject { |
| 43 | private final Enigma enigma; | 43 | private final Enigma enigma; |
| @@ -148,7 +148,7 @@ public class EnigmaProject { | |||
| 148 | Translator deobfuscator = nameProposalServices.length == 0 ? mapper.getDeobfuscator() : new ProposingTranslator(mapper, nameProposalServices); | 148 | Translator deobfuscator = nameProposalServices.length == 0 ? mapper.getDeobfuscator() : new ProposingTranslator(mapper, nameProposalServices); |
| 149 | 149 | ||
| 150 | AtomicInteger count = new AtomicInteger(); | 150 | AtomicInteger count = new AtomicInteger(); |
| 151 | progress.init(classEntries.size(), "Deobfuscating classes..."); | 151 | progress.init(classEntries.size(), I18n.translate("progress.classes.deobfuscating")); |
| 152 | 152 | ||
| 153 | Map<String, ClassNode> compiled = classEntries.parallelStream() | 153 | Map<String, ClassNode> compiled = classEntries.parallelStream() |
| 154 | .map(entry -> { | 154 | .map(entry -> { |
| @@ -180,7 +180,7 @@ public class EnigmaProject { | |||
| 180 | } | 180 | } |
| 181 | 181 | ||
| 182 | public void write(Path path, ProgressListener progress) throws IOException { | 182 | public void write(Path path, ProgressListener progress) throws IOException { |
| 183 | progress.init(this.compiled.size(), "Writing jar..."); | 183 | progress.init(this.compiled.size(), I18n.translate("progress.jar.writing")); |
| 184 | 184 | ||
| 185 | try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(path))) { | 185 | try (JarOutputStream out = new JarOutputStream(Files.newOutputStream(path))) { |
| 186 | AtomicInteger count = new AtomicInteger(); | 186 | AtomicInteger count = new AtomicInteger(); |
| @@ -205,7 +205,7 @@ public class EnigmaProject { | |||
| 205 | .filter(classNode -> classNode.name.indexOf('$') == -1) | 205 | .filter(classNode -> classNode.name.indexOf('$') == -1) |
| 206 | .collect(Collectors.toList()); | 206 | .collect(Collectors.toList()); |
| 207 | 207 | ||
| 208 | progress.init(classes.size(), "Decompiling classes..."); | 208 | progress.init(classes.size(), I18n.translate("progress.classes.decompiling")); |
| 209 | 209 | ||
| 210 | //create a common instance outside the loop as mappings shouldn't be changing while this is happening | 210 | //create a common instance outside the loop as mappings shouldn't be changing while this is happening |
| 211 | CompiledSourceTypeLoader typeLoader = new CompiledSourceTypeLoader(this.compiled::get); | 211 | CompiledSourceTypeLoader typeLoader = new CompiledSourceTypeLoader(this.compiled::get); |
| @@ -256,7 +256,7 @@ public class EnigmaProject { | |||
| 256 | } | 256 | } |
| 257 | 257 | ||
| 258 | public void write(Path path, ProgressListener progress) throws IOException { | 258 | public void write(Path path, ProgressListener progress) throws IOException { |
| 259 | progress.init(decompiled.size(), "Writing sources..."); | 259 | progress.init(decompiled.size(), I18n.translate("progress.sources.writing")); |
| 260 | 260 | ||
| 261 | int count = 0; | 261 | int count = 0; |
| 262 | for (ClassSource source : decompiled) { | 262 | for (ClassSource source : decompiled) { |