Skip to content

Commit 40f7fbd

Browse files
committed
Close #3786 Add support for naming tag categories instead of registries
1 parent c8357cd commit 40f7fbd

File tree

7 files changed

+28
-23
lines changed

7 files changed

+28
-23
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@
174174
"gui.jei.category.compostable": "Composting",
175175
"gui.jei.category.compostable.chance": "Chance: %s%%",
176176
"gui.jei.category.itemInformation": "Information",
177-
"gui.jei.category.registry.block": "Block",
178-
"gui.jei.category.registry.item": "Item",
179-
"gui.jei.category.registry.fluid": "Fluid",
180177
"gui.jei.category.tagInformation": "%s Tags",
178+
"gui.jei.category.tagInformation.block": "Block Tags",
179+
"gui.jei.category.tagInformation.fluid": "Fluid Tags",
180+
"gui.jei.category.tagInformation.item": "Item Tags",
181181
"gui.jei.category.recipe.crashed": "This recipe crashed. Please see the client logs for details.",
182182

183183
"_comment": "Messages",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@
174174
"gui.jei.category.compostable": "堆肥化",
175175
"gui.jei.category.compostable.chance": "確率:%s%%",
176176
"gui.jei.category.itemInformation": "説明",
177-
"gui.jei.category.registry.block": "ブロック",
178-
"gui.jei.category.registry.item": "アイテム",
179-
"gui.jei.category.registry.fluid": "流体",
180177
"gui.jei.category.tagInformation": "%sタグ",
178+
"gui.jei.category.tagInformation.block": "ブロックタグ",
179+
"gui.jei.category.tagInformation.fluid": "流体タグ",
180+
"gui.jei.category.tagInformation.item": "アイテムタグ",
181181

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

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,9 @@
7878
"gui.jei.category.compostable": "Compostável",
7979
"gui.jei.category.compostable.chance": "Probabilidade: %s%%",
8080
"gui.jei.category.itemInformation": "Informação",
81-
"gui.jei.category.registry.block": "Bloco",
82-
"gui.jei.category.registry.item": "Item",
83-
"gui.jei.category.registry.fluid": "Fluído",
81+
"gui.jei.category.tagInformation.block": "Bloco Etiquetas",
82+
"gui.jei.category.tagInformation.fluid": "Fluído Etiquetas",
83+
"gui.jei.category.tagInformation.item": "Item Etiquetas",
8484
"gui.jei.category.tagInformation": "%s Etiquetas",
8585

8686
"_comment": "Key Names",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@
171171
"gui.jei.category.compostable": "Kompostering",
172172
"gui.jei.category.compostable.chance": "Chans: %s %%",
173173
"gui.jei.category.itemInformation": "Information",
174-
"gui.jei.category.registry.block": "Block",
175-
"gui.jei.category.registry.item": "Föremål",
176-
"gui.jei.category.registry.fluid": "Vätska",
174+
"gui.jei.category.tagInformation.block": "Block taggar",
175+
"gui.jei.category.tagInformation.fluid": "Vätska taggar",
176+
"gui.jei.category.tagInformation.item": "Föremål taggar",
177177
"gui.jei.category.tagInformation": "%s taggar",
178178

179179
"_comment": "Messages",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@
173173
"gui.jei.category.compostable": "堆肥",
174174
"gui.jei.category.compostable.chance": "概率:%s%%",
175175
"gui.jei.category.itemInformation": "信息",
176-
"gui.jei.category.registry.block": "方块",
177-
"gui.jei.category.registry.item": "物品",
178-
"gui.jei.category.registry.fluid": "液体",
176+
"gui.jei.category.tagInformation.block": "方块 标签",
177+
"gui.jei.category.tagInformation.fluid": "液体 标签",
178+
"gui.jei.category.tagInformation.item": "物品 标签",
179179
"gui.jei.category.tagInformation": "%s 标签",
180180

181181
"_comment": "Messages",

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,9 +171,9 @@
171171
"gui.jei.category.compostable": "可堆肥",
172172
"gui.jei.category.compostable.chance": "機率:%s%%",
173173
"gui.jei.category.itemInformation": "資訊",
174-
"gui.jei.category.registry.block": "方塊",
175-
"gui.jei.category.registry.item": "物品",
176-
"gui.jei.category.registry.fluid": "流體",
174+
"gui.jei.category.tagInformation.block": "方塊 標籤",
175+
"gui.jei.category.tagInformation.fluid": "流體 標籤",
176+
"gui.jei.category.tagInformation.item": "物品 標籤",
177177
"gui.jei.category.tagInformation": "%s 標籤",
178178

179179
"_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.library.util.ResourceLocationUtil;
1818
import net.minecraft.ChatFormatting;
1919
import net.minecraft.client.gui.navigation.ScreenRectangle;
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;
@@ -50,11 +51,15 @@ public TagInfoRecipeCategory(IGuiHelper guiHelper, T recipeType, ResourceLocatio
5051
}
5152

5253
private static Component createTitle(ResourceLocation registryLocation) {
53-
Component registryName = Component.translatableWithFallback(
54-
"gui.jei.category.registry." + ResourceLocationUtil.sanitizePath(registryLocation.getPath()),
55-
StringUtils.capitalize(registryLocation.getPath())
56-
);
57-
return Component.translatable("gui.jei.category.tagInformation", registryName);
54+
String registryName = ResourceLocationUtil.sanitizePath(registryLocation.getPath());
55+
String registryNameTranslationKey = "gui.jei.category.tagInformation." + registryName;
56+
57+
Language language = Language.getInstance();
58+
if (language.has(registryNameTranslationKey)) {
59+
return Component.translatable(registryNameTranslationKey);
60+
}
61+
62+
return Component.translatable("gui.jei.category.tagInformation", StringUtils.capitalize(registryLocation.getPath()));
5863
}
5964

6065
@Override

0 commit comments

Comments
 (0)