Skip to content

Commit

Permalink
feat: add multi language support
Browse files Browse the repository at this point in the history
  • Loading branch information
RTAkland committed May 2, 2024
1 parent 908bbda commit 84c069f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/java/cn/rtast/viewdimension/ViewDimension.kt
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ class ViewDimension : ModInitializer {
val dimension = player.world.dimension.effects.path
val oldName = player.name.string
val dimensionText = when (dimension) {
"overworld" -> Text.literal(" <Overworld>")
"overworld" -> Text.literal(" <").append(Text.translatable("vdim.overworld")).append(Text.literal(">"))
.styled { it.withColor(Formatting.GREEN).withItalic(true) }
"the_nether" -> Text.literal(" <The Nether>")
"the_nether" ->Text.literal(" <").append(Text.translatable("vdim.thenether")).append(Text.literal(">"))
.styled { it.withColor(Formatting.DARK_RED).withItalic(true) }
"the_end" -> Text.literal(" <The End>")
"the_end" -> Text.literal(" <").append(Text.translatable("vdim.theend")).append(Text.literal(">"))
.styled { it.withColor(Formatting.DARK_PURPLE).withItalic(true) }
else -> Text.literal(" <$dimension>")
.styled { it.withColor(Formatting.GRAY).withItalic(true) }
Expand Down
5 changes: 5 additions & 0 deletions src/main/resources/assets/viewdimension/lang/en_us.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"vdim.overworld": "Overworld",
"vdim.theend": "The End",
"vdim.thenether": "The Nether"
}
5 changes: 5 additions & 0 deletions src/main/resources/assets/viewdimension/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"vdim.overworld": "主世界",
"vdim.theend": "末地",
"vdim.thenether": "下界"
}

0 comments on commit 84c069f

Please sign in to comment.