Skip to content

Commit

Permalink
Load plugin translation files
Browse files Browse the repository at this point in the history
  • Loading branch information
realdirt committed Mar 15, 2022
1 parent 68096ac commit 253be13
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/me/coley/recaf/plugin/PluginFolderSource.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import me.coley.recaf.Recaf;
import me.coley.recaf.plugin.api.BasePlugin;
import me.coley.recaf.util.IOUtil;
import me.coley.recaf.util.LangUtil;
import me.coley.recaf.util.VMUtil;
import org.objectweb.asm.ClassReader;
import org.plugface.core.PluginSource;
Expand Down Expand Up @@ -75,6 +76,10 @@ else if(entry.getName().endsWith("icon.png")) {
BufferedImage image = ImageIO.read(jar.getInputStream(entry));
pluginIcons.put(pluginPath, image);
}
// Check for translation files
else if(entry.getName().endsWith(LangUtil.DEFAULT_LANGUAGE + ".json")){
LangUtil.load(jar.getInputStream(entry));
}
}
} catch(IOException ex) {
throw new PluginLoadException(path, ex, "Failed to load jar file");
Expand Down

0 comments on commit 253be13

Please # to comment.