Skip to content
This repository was archived by the owner on Aug 8, 2025. It is now read-only.

Commit 14642bf

Browse files
authored
fix translation (#22)
1 parent 6318823 commit 14642bf

File tree

17 files changed

+103
-91
lines changed

17 files changed

+103
-91
lines changed

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
<configuration>
2828
<source>${java.version}</source>
2929
<target>${java.version}</target>
30+
<!-- lombok -->
31+
<annotationProcessorPaths>
32+
<path>
33+
<groupId>org.projectlombok</groupId>
34+
<artifactId>lombok</artifactId>
35+
<version>1.18.34</version>
36+
</path>
37+
</annotationProcessorPaths>
3038
</configuration>
3139
</plugin>
3240
<plugin>

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/ProjectAddonManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public void setup(Plugin inst) {
6262

6363
for (File folder : folders) {
6464
if (folder.isFile()) {
65-
ExceptionHandler.handleError(folder.getName() + " 不是文件夹!无法加载此附属!");
65+
ExceptionHandler.handleError(folder.getName() + " is not a folder! Unable to load addons!");
6666
continue;
6767
}
6868

@@ -120,7 +120,7 @@ public void setup(Plugin inst) {
120120
}
121121
} catch (Exception e) {
122122
if (folder.isFile()) {
123-
ExceptionHandler.handleError(folder.getName() + " 不是文件夹!无法加载此附属!");
123+
ExceptionHandler.handleError(folder.getName() + " is not a folder! Unable to load addon!");
124124
continue;
125125
}
126126
e.printStackTrace();

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/listeners/SingleItemRecipeGuideListener.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -510,7 +510,11 @@ public LinkedRecipeMenu(AContainer item, Player p, int index) {
510510

511511
profile.ifPresent(prof -> addItem(
512512
0,
513-
ChestMenuUtils.getBackButton(p, "", "&f左键: &7返回上一页", "&fShift + 左键: &7返回主菜单"),
513+
ChestMenuUtils.getBackButton(
514+
p,
515+
"",
516+
"&fLeft click: &7back to previous page",
517+
"&fShift + left click: &7back to the main menu"),
514518
(pl, s, is, action) -> {
515519
SurvivalSlimefunGuide guide = new SurvivalSlimefunGuide(false, false);
516520
GuideHistory history = prof.getGuideHistory();
@@ -558,7 +562,7 @@ public LinkedRecipeMenu(AContainer item, Player p, int index) {
558562
ItemStack chanceOutput = originalOutput.clone();
559563
if (chance < 100) {
560564
CommonUtils.addLore(
561-
chanceOutput, true, CMIChatColor.translate("&a有&b " + chance + "% &a的概率产出"));
565+
chanceOutput, true, CMIChatColor.translate("&b" + chance + "% &achance of &aproducing"));
562566
}
563567

564568
if (chance > 0) {
@@ -584,7 +588,7 @@ public LinkedRecipeMenu(AContainer item, Player p, int index) {
584588
}
585589

586590
int seconds = recipe.getTicks() / 2;
587-
String rawName = "&e制作时间: &b" + seconds + "&es";
591+
String rawName = "&eProduction time: &b" + seconds + "&es";
588592

589593
if (seconds > 60) {
590594
rawName = rawName.concat("(" + CommonUtils.formatSeconds(seconds) + "&e)");
@@ -606,7 +610,7 @@ public void open(Player... players) {
606610

607611
private ItemStack tagOutputChance(ItemStack item, int chance) {
608612
item = item.clone();
609-
CommonUtils.addLore(item, true, CMIChatColor.translate("&a有&b " + chance + "% &a的概率产出"));
613+
CommonUtils.addLore(item, true, CMIChatColor.translate("&aThere's a &b " + chance + "% &aprobability of producing"));
610614
return item;
611615
}
612616
}
@@ -653,7 +657,7 @@ public WorkbenchRecipeMenu(AContainer item, Player p, int index) {
653657
CommonUtils.addLore(
654658
chanceOutput,
655659
true,
656-
CMIChatColor.translate("&a有&b " + chance + "% &a的概率产出"));
660+
CMIChatColor.translate("&aThere's a &b " + chance + "% &aprobability of producing"));
657661
}
658662

659663
if (chance > 0) {
@@ -689,7 +693,7 @@ public void open(Player... players) {
689693

690694
private ItemStack tagOutputChance(ItemStack item, int chance) {
691695
item = item.clone();
692-
CommonUtils.addLore(item, true, CMIChatColor.translate("&a有&b " + chance + "% &a的概率产出"));
696+
CommonUtils.addLore(item, true, CMIChatColor.translate("&aThere's a &b " + chance + "% &aprobability of producing"));
693697
return item;
694698
}
695699
}

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/ProjectAddon.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,8 +208,6 @@ public String getId(@Nullable String configuredId, @Nullable String id_alias) {
208208
}
209209
if (id != null) {
210210
if (idPattern != null) {
211-
// 当前使用的 id 可能是正常引用的 id,也可能是 idPattern 格式化后的 id
212-
// 如果找不到已初始化的 item,则尝试用 idPattern 格式化 id
213211
SlimefunItem item = SlimefunItem.getById(id);
214212
if (item == null) {
215213
id = idPattern.replaceAll("%0", id);
@@ -218,12 +216,12 @@ public String getId(@Nullable String configuredId, @Nullable String id_alias) {
218216

219217
return id.toUpperCase();
220218
} else {
221-
ExceptionHandler.handleError("无法获取id");
219+
ExceptionHandler.handleError("Unable to get item's ID");
222220
ExceptionHandler.handleError("configuredId: " + configuredId == null ? "null" : configuredId);
223221
ExceptionHandler.handleError("id_alias: " + id_alias == null ? "null" : id_alias);
224222
ExceptionHandler.handleError("idPattern: " + idPattern == null ? "null" : idPattern);
225223
String randomId = "RSC_UNKNOWN_ID_" + ((int) (Math.random() * 1_000_000));
226-
ExceptionHandler.handleError("分配随机id");
224+
ExceptionHandler.handleError("Generating randomId");
227225
ExceptionHandler.handleError("randomId: " + randomId);
228226
return randomId;
229227
}

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/LinkedOutput.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ public void log() {
5050
// log free output & linked output
5151
for (int i = 0; i < freeOutput.length; i++) {
5252
ItemStack item = freeOutput[i];
53-
ExceptionHandler.info("FreeOutput: " + i + " 物品: " + item);
53+
ExceptionHandler.info("FreeOutput: " + i + " Item: " + item);
5454
}
5555

5656
for (int slot : linkedOutput.keySet()) {
5757
ItemStack item = linkedOutput.get(slot);
58-
ExceptionHandler.info("LinkedOutput: " + slot + " 物品: " + item + " 位置: " + slot);
58+
ExceptionHandler.info("LinkedOutput: " + slot + " Item: " + item + " Slot: " + slot);
5959
}
6060
}
6161
}

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/customs/machine/CustomTemplateMachine.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public void tick(Block b, SlimefunItem item, Config data) {
149149

150150
if (recipe.getInput().length == 0) {
151151
ItemStack templateItem = template.template().clone();
152-
CommonUtils.addLore(templateItem, true, "&d&l&o*模板物品不消耗*");
152+
CommonUtils.addLore(templateItem, true, "&d&l&o*Template item doesn't consume*");
153153
displayRecipes.add(templateItem);
154154
} else {
155155
displayRecipes.add(SingleItemRecipeGuideListener.tagItemTemplateRecipe(
@@ -159,7 +159,7 @@ public void tick(Block b, SlimefunItem item, Config data) {
159159
if (recipe.getOutput().length == 1) {
160160
int seconds = recipe.getTicks() / 2;
161161
ItemStack out = recipe.getOutput()[0].clone();
162-
String rawLore = "&e制作时间: &b" + seconds + "&es";
162+
String rawLore = "&eProduction time: &b" + seconds + "&es";
163163
if (seconds > 60) {
164164
rawLore = rawLore.concat("(" + CommonUtils.formatSeconds(seconds) + "&e)");
165165
}
@@ -185,7 +185,7 @@ private void tick(Block b) {
185185
if (inv != null) {
186186
ItemStack templateItem = inv.getItemInSlot(templateSlot);
187187

188-
// 断掉进度
188+
// Stop the process
189189
if (templateItem == null || templateItem.getType() == Material.AIR) {
190190
if (menu.getProgressSlot() >= 0) {
191191
inv.replaceExistingItem(

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/slimefun/ItemGroupButton.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@ public void run(Player p, int slot, ItemStack clickedItem, ClickAction clickActi
4848
if (actions != null) {
4949
for (String action : actions) {
5050
if (action.split(" ").length < 2) {
51-
ExceptionHandler.handleWarning("在" + getKey().getKey() + "物品组按钮中发现未知的操作格式: " + action);
51+
ExceptionHandler.handleWarning("Unknown action format found in item group button: " + action);
5252
continue;
5353
}
5454

5555
String type = action.split(" ")[0];
5656
String content = action.split(" ")[1];
5757
switch (type) {
5858
case "link" -> {
59-
p.sendMessage(CMIChatColor.translate("&e单击此处: "));
59+
p.sendMessage(CMIChatColor.translate("&eClick here: "));
6060
TextComponent link = new TextComponent(content);
6161
link.setColor(ChatColor.GRAY);
6262

@@ -68,7 +68,7 @@ public void run(Player p, int slot, ItemStack clickedItem, ClickAction clickActi
6868
case "console" -> {
6969
if (CommandSafe.isBadCommand(content)) {
7070
ExceptionHandler.handleDanger(
71-
"在" + getKey().getKey() + "物品组按钮中发现执行服务器高危操作,请联系附属对应作者进行处理!!!");
71+
"High-risk server operation detected in item group button. Please contact the author of the corresponding addon for processing!!!");
7272
continue;
7373
}
7474
content = action.replace(type + " ", "");
@@ -77,7 +77,7 @@ public void run(Player p, int slot, ItemStack clickedItem, ClickAction clickActi
7777
case "open_itemgroup" -> {
7878
if (content.split(":").length < 2) {
7979
ExceptionHandler.handleWarning(
80-
"在" + getKey().getKey() + "物品组按钮中发现未知的物品组 NamespacedKey: " + content);
80+
"Unknown NamespacedKey found in item group button: " + content);
8181
continue;
8282
}
8383
String namespace = content.split(":")[0];
@@ -92,7 +92,7 @@ public void run(Player p, int slot, ItemStack clickedItem, ClickAction clickActi
9292
Optional<PlayerProfile> Oprofile = PlayerProfile.find(p);
9393
if (Oprofile.isEmpty()) {
9494
ExceptionHandler.handleWarning(
95-
"在" + getKey().getKey() + "物品组按钮中发现无法获取 PlayerProfile: " + p.getName());
95+
"Unable to retrieve PlayerProfile in item group button: " + p.getName());
9696
continue;
9797
}
9898
PlayerProfile profile = Oprofile.get();
@@ -109,13 +109,13 @@ public void run(Player p, int slot, ItemStack clickedItem, ClickAction clickActi
109109
Optional<PlayerProfile> Oprofile = PlayerProfile.find(p);
110110
if (Oprofile.isEmpty()) {
111111
ExceptionHandler.handleWarning(
112-
"在" + getKey().getKey() + "物品组按钮中发现无法获取 PlayerProfile: " + p.getName());
112+
"Unable to retrieve PlayerProfile in item group button: " + p.getName());
113113
continue;
114114
}
115115
SlimefunItem item = SlimefunItem.getById(content);
116116
if (item == null) {
117117
ExceptionHandler.handleWarning(
118-
"在" + getKey().getKey() + "物品组按钮中发现未知的 SlimefunItem ID: " + content);
118+
"Unknown SlimefunItem ID found in item group button: " + content);
119119
continue;
120120
}
121121
PlayerProfile profile = Oprofile.get();
@@ -128,7 +128,7 @@ public void run(Player p, int slot, ItemStack clickedItem, ClickAction clickActi
128128
File file = new File(addon.getScriptsFolder(), content + ".js");
129129
if (!file.exists()) {
130130
ExceptionHandler.handleWarning(
131-
"在" + getKey().getKey() + "物品组按钮中发现执行脚本时遇到了问题: " + "找不到脚本文件 " + file.getName());
131+
"Script execution issue found in item group button: File not found " + file.getName());
132132
} else {
133133
eval = new JavaScriptEval(file, addon);
134134
}
@@ -137,7 +137,7 @@ public void run(Player p, int slot, ItemStack clickedItem, ClickAction clickActi
137137
eval.evalFunction("onButtonGroupClick", p, slot, clickedItem, clickAction, mode);
138138
}
139139
}
140-
default -> ExceptionHandler.handleWarning("在" + getKey().getKey() + "物品组按钮中发现未知的操作类型: " + action);
140+
default -> ExceptionHandler.handleWarning("Unknown action type found in item group button: " + action);
141141
}
142142
}
143143
}

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/yaml/RecipeTypesReader.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public RecipeType readEach(String s) {
3232
return new RecipeType(new NamespacedKey(RykenSlimefunCustomizer.INSTANCE, s.toLowerCase()), item);
3333
}
3434

35-
// 配方类型不需要预加载物品
35+
// No preloadItems for RecipeType
3636
@Override
3737
public List<SlimefunItemStack> preloadItems(String s) {
3838
return List.of();

src/main/java/org/lins/mmmjjkx/rykenslimefuncustomizer/objects/yaml/item/GeoResourceReader.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,8 +118,7 @@ public GEOResource readEach(String s) {
118118
DropFromBlock.addDrop(material, new DropFromBlock.Drop(sfis.item(), chance, addon, amount, amount));
119119
}
120120
} else {
121-
ExceptionHandler.handleError("在附属" + addon.getAddonId() + "中加载自然资源" + s + "时遇到了问题: " + "指定掉落方块材料类型"
122-
+ dropMaterial + "不存在!");
121+
ExceptionHandler.handleError("Failed to load natural resource " + s + " in addon " + addon.getAddonId() + ": Specified drop block material type " + dropMaterial + " does not exist!");
123122
}
124123
}
125124

0 commit comments

Comments
 (0)