mirror of
https://github.com/xfl03/MCCustomSkinLoader.git
synced 2026-11-21 19:42:15 +00:00
1.0.1 Multi-languages
This commit is contained in:
1 parent
0c9bb21145
commit
ff7fa75cfa
10 files changed
+219
-23
No files matched your search
Binary file not shown.
Binary file not shown.
@@ -20,9 +20,10 @@ import javax.swing.JTextArea;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
public class CloakFrame {
|
||||
private static LangParent lang=Lang.refresh();
|
||||
public static boolean mod=false;
|
||||
public static final String[] urls={
|
||||
"#Minecraft Offical",
|
||||
"#"+lang.minecraftOffical(),
|
||||
"http://s3.amazonaws.com/MinecraftCloaks/*.png",
|
||||
"http://skins.minecraft.net/MinecraftCloaks/*.png",
|
||||
"#MineCrack",
|
||||
@@ -35,7 +36,7 @@ public class CloakFrame {
|
||||
};
|
||||
|
||||
public static void main(String[] args) {
|
||||
final JFrame jf = new JFrame ("Cloak Load List");
|
||||
final JFrame jf = new JFrame (lang.title()+" - "+lang.cloak()+lang.loadList());
|
||||
Container con = jf.getContentPane();
|
||||
con.setLayout(null);
|
||||
//setBounds(x,y,width,height)
|
||||
@@ -44,7 +45,7 @@ public class CloakFrame {
|
||||
Font boldCourier=new Font("Courier", Font.BOLD, 30);
|
||||
|
||||
JLabel title=new JLabel();
|
||||
title.setText("Cloak Load List");
|
||||
title.setText(lang.cloak()+lang.loadList());
|
||||
title.setFont(boldCourier);
|
||||
title.setBounds(130, 5, 370, 30);
|
||||
con.add(title);
|
||||
@@ -55,7 +56,7 @@ public class CloakFrame {
|
||||
cloakList.setText(read("cloakurls.txt"));
|
||||
|
||||
JButton defaultBtn=new JButton();
|
||||
defaultBtn.setText("Use Default(Offical)");
|
||||
defaultBtn.setText(lang.useDefault());
|
||||
defaultBtn.setBounds(15, 310, 235, 30);
|
||||
con.add(defaultBtn);
|
||||
defaultBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
@@ -68,7 +69,7 @@ public class CloakFrame {
|
||||
};
|
||||
});
|
||||
JButton urlBtn=new JButton();
|
||||
urlBtn.setText("Use Recommended");
|
||||
urlBtn.setText(lang.useRecommended());
|
||||
urlBtn.setBounds(250, 310, 235, 30);
|
||||
con.add(urlBtn);
|
||||
urlBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
@@ -84,19 +85,19 @@ public class CloakFrame {
|
||||
|
||||
|
||||
JButton skinBtn=new JButton();
|
||||
skinBtn.setText("Save");
|
||||
skinBtn.setText(lang.save());
|
||||
skinBtn.setBounds(15, 350, 235, 30);
|
||||
con.add(skinBtn);
|
||||
skinBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
@Override
|
||||
public void actionPerformed (ActionEvent e){
|
||||
save(cloakList.getText());
|
||||
JOptionPane.showMessageDialog(null,"Saved!");
|
||||
JOptionPane.showMessageDialog(null,lang.saved());
|
||||
};
|
||||
});
|
||||
|
||||
JButton clokeBtn=new JButton();
|
||||
clokeBtn.setText("Close");
|
||||
clokeBtn.setText(lang.close());
|
||||
clokeBtn.setBounds(250, 350, 235, 30);
|
||||
con.add(clokeBtn);
|
||||
clokeBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
|
||||
@@ -7,8 +7,9 @@ public class CustomSkinLoaderGUI {
|
||||
|
||||
public static void main(String[] args) {
|
||||
log.info("Thanks for using CustomSkinLoader!");
|
||||
log.info("Version 1.0.0!");
|
||||
log.info("Version 1.0.1!");
|
||||
MainFrame.main(args);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
package idv.jlchntoz;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public class Lang {
|
||||
|
||||
public static LangParent refresh(){
|
||||
Locale locale = Locale.getDefault();
|
||||
String l=locale.getLanguage().toLowerCase();
|
||||
String c=locale.getCountry().toLowerCase();
|
||||
if(l.equalsIgnoreCase("zh")){
|
||||
if(c.equalsIgnoreCase("cn")){
|
||||
//zh_cn();
|
||||
return new LangChineseSimp();
|
||||
}
|
||||
//zh();
|
||||
return new LangChineseTran();
|
||||
}
|
||||
//en();
|
||||
return new LangParent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package idv.jlchntoz;
|
||||
|
||||
public class LangChineseSimp extends LangParent {
|
||||
@Override
|
||||
public String title(){
|
||||
return "自定义皮肤加载器";
|
||||
}
|
||||
@Override
|
||||
public String gui(){
|
||||
return " 图形化界面";
|
||||
}
|
||||
@Override
|
||||
public String index(){
|
||||
return " 索引";
|
||||
}
|
||||
@Override
|
||||
public String first1(){
|
||||
return "这是您第一次使用自定义皮肤加载器!";
|
||||
}
|
||||
@Override
|
||||
public String first2(){
|
||||
return "请点击下列按钮以修改设置!";
|
||||
}
|
||||
@Override
|
||||
public String skin(){
|
||||
return "皮肤";
|
||||
}
|
||||
@Override
|
||||
public String cloak(){
|
||||
return "披风";
|
||||
}
|
||||
@Override
|
||||
public String loadList(){
|
||||
return "加载列表";
|
||||
}
|
||||
@Override
|
||||
public String minecraftOffical(){
|
||||
return "Minecraft 官方[正版]";
|
||||
}
|
||||
@Override
|
||||
public String useDefault(){
|
||||
return "使用默认(官方)";
|
||||
}
|
||||
@Override
|
||||
public String useRecommended(){
|
||||
return "使用推荐";
|
||||
}
|
||||
@Override
|
||||
public String save(){
|
||||
return "保存";
|
||||
}
|
||||
@Override
|
||||
public String saved(){
|
||||
return "已保存,请重新启动游戏!";
|
||||
}
|
||||
@Override
|
||||
public String close(){
|
||||
return "关闭";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,60 @@
|
||||
package idv.jlchntoz;
|
||||
|
||||
public class LangChineseTran extends LangParent {
|
||||
@Override
|
||||
public String title(){
|
||||
return "萬用皮膚模組";
|
||||
}
|
||||
@Override
|
||||
public String gui(){
|
||||
return " 用戶界面";
|
||||
}
|
||||
@Override
|
||||
public String index(){
|
||||
return " 目錄";
|
||||
}
|
||||
@Override
|
||||
public String first1(){
|
||||
return "這是您第一次使用本模組!";
|
||||
}
|
||||
@Override
|
||||
public String first2(){
|
||||
return "請單擊下列按鈕進行配置修改!";
|
||||
}
|
||||
@Override
|
||||
public String skin(){
|
||||
return "皮膚";
|
||||
}
|
||||
@Override
|
||||
public String cloak(){
|
||||
return "披風";
|
||||
}
|
||||
@Override
|
||||
public String loadList(){
|
||||
return "加載列表";
|
||||
}
|
||||
@Override
|
||||
public String minecraftOffical(){
|
||||
return "Minecraft 官方[正版]";
|
||||
}
|
||||
@Override
|
||||
public String useDefault(){
|
||||
return "使用默認(官方)";
|
||||
}
|
||||
@Override
|
||||
public String useRecommended(){
|
||||
return "使用推薦";
|
||||
}
|
||||
@Override
|
||||
public String save(){
|
||||
return "保存";
|
||||
}
|
||||
@Override
|
||||
public String saved(){
|
||||
return "已保存,請重新開啟遊戲!";
|
||||
}
|
||||
@Override
|
||||
public String close(){
|
||||
return "關閉";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package idv.jlchntoz;
|
||||
|
||||
public class LangParent {
|
||||
public String title(){
|
||||
return "CustomSkinLoader";
|
||||
}
|
||||
public String gui(){
|
||||
return " GUI";
|
||||
}
|
||||
public String index(){
|
||||
return " Index";
|
||||
}
|
||||
public String first1(){
|
||||
return "It's your first time use CustomSkinLoader!";
|
||||
}
|
||||
public String first2(){
|
||||
return "Please click buttons below to modify config!";
|
||||
}
|
||||
public String skin(){
|
||||
return "Skin";
|
||||
}
|
||||
public String cloak(){
|
||||
return "Cloak";
|
||||
}
|
||||
public String loadList(){
|
||||
return " Load List";
|
||||
}
|
||||
public String minecraftOffical(){
|
||||
return "Minecraft Offical";
|
||||
}
|
||||
public String useDefault(){
|
||||
return "Use Default(Offical)";
|
||||
}
|
||||
public String useRecommended(){
|
||||
return "Use Recommended";
|
||||
}
|
||||
public String save(){
|
||||
return "Save";
|
||||
}
|
||||
public String saved(){
|
||||
return "Saved!Restart the game, please!";
|
||||
}
|
||||
public String close(){
|
||||
return "Close";
|
||||
}
|
||||
}
|
||||
@@ -11,9 +11,11 @@ import javax.swing.JLabel;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
public class MainFrame {
|
||||
private static LangParent lang=Lang.refresh();
|
||||
|
||||
public static void main(String[] args) {
|
||||
JFrame jf = new JFrame ("CustomSkinLoader-GUI");
|
||||
|
||||
JFrame jf = new JFrame (lang.title()+lang.gui());
|
||||
Container con = jf.getContentPane();
|
||||
con.setLayout(null);
|
||||
//setBounds(x,y,width,height)
|
||||
@@ -22,25 +24,25 @@ public class MainFrame {
|
||||
Font boldCourier=new Font("Courier", Font.BOLD, 30);
|
||||
|
||||
JLabel title=new JLabel();
|
||||
title.setText("CustomSkinLoader Index");
|
||||
title.setText(lang.title()+lang.index());
|
||||
title.setFont(boldCourier);
|
||||
title.setBounds(15, 5, 370, 30);
|
||||
con.add(title);
|
||||
|
||||
if(args.length>0 && args[0].equalsIgnoreCase("f")){
|
||||
JLabel tip1=new JLabel();
|
||||
tip1.setText("It's your first time use CustomSkinLoader!");
|
||||
tip1.setText(lang.first1());
|
||||
tip1.setBounds(30, 55, 370, 15);
|
||||
con.add(tip1);
|
||||
|
||||
JLabel tip2=new JLabel();
|
||||
tip2.setText("Please click buttons below to modify config!");
|
||||
tip2.setText(lang.first2());
|
||||
tip2.setBounds(30, 70, 370, 15);
|
||||
con.add(tip2);
|
||||
}
|
||||
|
||||
JButton skinBtn=new JButton();
|
||||
skinBtn.setText("Skin Load List");
|
||||
skinBtn.setText(lang.skin()+lang.loadList());
|
||||
skinBtn.setBounds(15, 180, 370, 30);
|
||||
con.add(skinBtn);
|
||||
skinBtn.addActionListener(new ActionListener(){ //µ¥»÷ʼþ
|
||||
@@ -52,7 +54,7 @@ public class MainFrame {
|
||||
});
|
||||
|
||||
JButton clokeBtn=new JButton();
|
||||
clokeBtn.setText("Cloak Load List");
|
||||
clokeBtn.setText(lang.cloak()+lang.loadList());
|
||||
clokeBtn.setBounds(15, 215, 370, 30);
|
||||
con.add(clokeBtn);
|
||||
clokeBtn.addActionListener(new ActionListener(){ //µ¥»÷ʼþ
|
||||
|
||||
@@ -20,9 +20,10 @@ import javax.swing.JTextArea;
|
||||
import javax.swing.WindowConstants;
|
||||
|
||||
public class SkinFrame {
|
||||
private static LangParent lang=Lang.refresh();
|
||||
public static boolean mod=false;
|
||||
public static final String[] urls={
|
||||
"#Minecraft Offical",
|
||||
"#"+lang.minecraftOffical(),
|
||||
"http://s3.amazonaws.com/MinecraftSkins/*.png",
|
||||
"http://skins.minecraft.net/MinecraftSkins/*.png",
|
||||
"#MineCrack",
|
||||
@@ -35,7 +36,7 @@ public class SkinFrame {
|
||||
};
|
||||
|
||||
public static void main(String[] args) {
|
||||
final JFrame jf = new JFrame ("Skin Load List");
|
||||
final JFrame jf = new JFrame (lang.title()+" - "+lang.skin()+lang.loadList());
|
||||
Container con = jf.getContentPane();
|
||||
con.setLayout(null);
|
||||
//setBounds(x,y,width,height)
|
||||
@@ -44,7 +45,7 @@ public class SkinFrame {
|
||||
Font boldCourier=new Font("Courier", Font.BOLD, 30);
|
||||
|
||||
JLabel title=new JLabel();
|
||||
title.setText("Skin Load List");
|
||||
title.setText(lang.skin()+lang.loadList());
|
||||
title.setFont(boldCourier);
|
||||
title.setBounds(130, 5, 370, 30);
|
||||
con.add(title);
|
||||
@@ -55,7 +56,7 @@ public class SkinFrame {
|
||||
skinList.setText(read("skinurls.txt"));
|
||||
|
||||
JButton defaultBtn=new JButton();
|
||||
defaultBtn.setText("Use Default(Offical)");
|
||||
defaultBtn.setText(lang.useDefault());
|
||||
defaultBtn.setBounds(15, 310, 235, 30);
|
||||
con.add(defaultBtn);
|
||||
defaultBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
@@ -68,7 +69,7 @@ public class SkinFrame {
|
||||
};
|
||||
});
|
||||
JButton urlBtn=new JButton();
|
||||
urlBtn.setText("Use Recommended");
|
||||
urlBtn.setText(lang.useRecommended());
|
||||
urlBtn.setBounds(250, 310, 235, 30);
|
||||
con.add(urlBtn);
|
||||
urlBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
@@ -84,19 +85,19 @@ public class SkinFrame {
|
||||
|
||||
|
||||
JButton skinBtn=new JButton();
|
||||
skinBtn.setText("Save");
|
||||
skinBtn.setText(lang.save());
|
||||
skinBtn.setBounds(15, 350, 235, 30);
|
||||
con.add(skinBtn);
|
||||
skinBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
@Override
|
||||
public void actionPerformed (ActionEvent e){
|
||||
save(skinList.getText());
|
||||
JOptionPane.showMessageDialog(null,"Saved!");
|
||||
JOptionPane.showMessageDialog(null,lang.saved());
|
||||
};
|
||||
});
|
||||
|
||||
JButton clokeBtn=new JButton();
|
||||
clokeBtn.setText("Close");
|
||||
clokeBtn.setText(lang.close());
|
||||
clokeBtn.setBounds(250, 350, 235, 30);
|
||||
con.add(clokeBtn);
|
||||
clokeBtn.addActionListener(new ActionListener(){ //单击事件
|
||||
|
||||
Reference in new issue
Block a user