Skip to content

Commit f3e13fd

Browse files
committed
Close #3786 Add support for naming tag categories
1 parent 14a3ed6 commit f3e13fd

File tree

6 files changed

+28
-10
lines changed

6 files changed

+28
-10
lines changed

Common/src/main/resources/assets/jei/lang/en_us.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@
177177
"gui.jei.category.compostable.chance": "Chance: %s%%",
178178
"gui.jei.category.itemInformation": "Information",
179179
"gui.jei.category.tagInformation": "%s Tags",
180-
"gui.jei.category.recipe.crashed": "This recipe crashed. Please see client logs for details.",
180+
"gui.jei.category.tagInformation.block": "Block Tags",
181+
"gui.jei.category.tagInformation.fluid": "Fluid Tags",
182+
"gui.jei.category.tagInformation.item": "Item Tags",
183+
"gui.jei.category.recipe.crashed": "This recipe crashed. Please see the client logs for details.",
181184

182185
"_comment": "Messages",
183186
"jei.message.configured": "Install the \"Configured\" mod to access the in-game config",

Common/src/main/resources/assets/jei/lang/ja_jp.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@
177177
"gui.jei.category.compostable.chance": "確率:%s%%",
178178
"gui.jei.category.itemInformation": "説明",
179179
"gui.jei.category.tagInformation": "%sタグ",
180+
"gui.jei.category.tagInformation.block": "ブロックタグ",
181+
"gui.jei.category.tagInformation.fluid": "流体タグ",
182+
"gui.jei.category.tagInformation.item": "アイテムタグ",
180183

181184
"_comment": "Messages",
182185
"jei.message.configured": "ゲーム内で設定にアクセスするには、\n\"Configured\" Modをインストールしてください",

Common/src/main/resources/assets/jei/lang/sv_se.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,10 @@
161161
"gui.jei.category.compostable": "Kompostering",
162162
"gui.jei.category.compostable.chance": "Chans: %s %%",
163163
"gui.jei.category.itemInformation": "Information",
164+
"gui.jei.category.tagInformation.block": "Block taggar",
165+
"gui.jei.category.tagInformation.fluid": "Vätska taggar",
166+
"gui.jei.category.tagInformation.item": "Föremål taggar",
167+
"gui.jei.category.tagInformation": "%s taggar",
164168

165169
"_comment": "Messages",
166170
"jei.message.configured": "Installera modden \"Configured\" för att få åtkomst till konfigurationen i spelet",

Common/src/main/resources/assets/jei/lang/zh_cn.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,10 @@
176176
"gui.jei.category.compostable": "堆肥",
177177
"gui.jei.category.compostable.chance": "概率:%s%%",
178178
"gui.jei.category.itemInformation": "信息",
179-
"gui.jei.category.tagInformation": "%s标签",
179+
"gui.jei.category.tagInformation.block": "方块 标签",
180+
"gui.jei.category.tagInformation.fluid": "液体 标签",
181+
"gui.jei.category.tagInformation.item": "物品 标签",
182+
"gui.jei.category.tagInformation": "%s 标签",
180183

181184
"_comment": "Messages",
182185
"jei.message.configured": "安装“Configured”模组以访问游戏内配置",

Common/src/main/resources/assets/jei/lang/zh_tw.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,9 @@
161161
"gui.jei.category.compostable": "可堆肥",
162162
"gui.jei.category.compostable.chance": "機率:%s%%",
163163
"gui.jei.category.itemInformation": "資訊",
164-
"gui.jei.category.registry.block": "方塊",
165-
"gui.jei.category.registry.item": "物品",
166-
"gui.jei.category.registry.fluid": "流體",
164+
"gui.jei.category.tagInformation.block": "方塊 標籤",
165+
"gui.jei.category.tagInformation.fluid": "流體 標籤",
166+
"gui.jei.category.tagInformation.item": "物品 標籤",
167167
"gui.jei.category.tagInformation": "%s 標籤",
168168

169169
"_comment": "Messages",

Library/src/main/java/mezz/jei/library/plugins/jei/tags/TagInfoRecipeCategory.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import mezz.jei.common.platform.Services;
1818
import mezz.jei.library.util.ResourceLocationUtil;
1919
import net.minecraft.ChatFormatting;
20+
import net.minecraft.locale.Language;
2021
import net.minecraft.network.chat.Component;
2122
import net.minecraft.network.chat.FormattedText;
2223
import net.minecraft.resources.ResourceLocation;
@@ -41,11 +42,15 @@ public TagInfoRecipeCategory(IGuiHelper guiHelper, T recipeType, ResourceLocatio
4142
}
4243

4344
private static Component createTitle(ResourceLocation registryLocation) {
44-
Component registryName = Component.translatableWithFallback(
45-
"gui.jei.category.registry." + ResourceLocationUtil.sanitizePath(registryLocation.getPath()),
46-
StringUtils.capitalize(registryLocation.getPath())
47-
);
48-
return Component.translatable("gui.jei.category.tagInformation", registryName);
45+
String registryName = ResourceLocationUtil.sanitizePath(registryLocation.getPath());
46+
String registryNameTranslationKey = "gui.jei.category.tagInformation." + registryName;
47+
48+
Language language = Language.getInstance();
49+
if (language.has(registryNameTranslationKey)) {
50+
return Component.translatable(registryNameTranslationKey);
51+
}
52+
53+
return Component.translatable("gui.jei.category.tagInformation", StringUtils.capitalize(registryLocation.getPath()));
4954
}
5055

5156
@Override

0 commit comments

Comments
 (0)