diff --git a/common/src/main/java/dev/ftb/mods/ftblibrary/util/TextComponentUtils.java b/common/src/main/java/dev/ftb/mods/ftblibrary/util/TextComponentUtils.java index c5fb858f..cb8835dc 100644 --- a/common/src/main/java/dev/ftb/mods/ftblibrary/util/TextComponentUtils.java +++ b/common/src/main/java/dev/ftb/mods/ftblibrary/util/TextComponentUtils.java @@ -3,6 +3,9 @@ import dev.architectury.injectables.annotations.ExpectPlatform; import net.minecraft.ChatFormatting; import net.minecraft.network.chat.Component; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.level.Level; public class TextComponentUtils { @ExpectPlatform @@ -15,4 +18,12 @@ public static Component hotkeyTooltip(String txt) { .append(Component.literal(txt).withStyle(ChatFormatting.GRAY)) .append(Component.literal("]").withStyle(ChatFormatting.DARK_GRAY)); } + + public static Component translatedDimension(ResourceKey key) { + return translatedDimension(key.location()); + } + + public static Component translatedDimension(ResourceLocation dimId) { + return Component.translatableWithFallback(dimId.toLanguageKey("dimension"), dimId.toString()); + } } diff --git a/common/src/main/resources/assets/ftblibrary/lang/en_us.json b/common/src/main/resources/assets/ftblibrary/lang/en_us.json index dbf765af..8d3f7d76 100644 --- a/common/src/main/resources/assets/ftblibrary/lang/en_us.json +++ b/common/src/main/resources/assets/ftblibrary/lang/en_us.json @@ -93,5 +93,10 @@ "ftblibrary.panel.position.right": "Right", "ftblibrary.panel.position.bottom_left": "Bottom Left", "ftblibrary.panel.position.bottom": "Bottom", - "ftblibrary.panel.position.bottom_right": "Bottom Right" + "ftblibrary.panel.position.bottom_right": "Bottom Right", + "dimension.minecraft.overworld": "Overworld", + "dimension.minecraft.the_nether": "The Nether", + "dimension.minecraft.the_end": "The End", + "dimension.hyperbox.hyperbox": "Hyperbox", + "dimension.ae2.spatial_storage": "AE2 Spatial Storage" }