Skip to content

Commit

Permalink
Now the GUI has better I18n.
Browse files Browse the repository at this point in the history
  • Loading branch information
3TUSK committed Sep 24, 2024
1 parent d660460 commit b07f840
Show file tree
Hide file tree
Showing 3 changed files with 84 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ protected void init() {

@Override
public void render(@NotNull GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks) {
// TODO: this.renderBackground(guiGraphics, mouseX, mouseY, partialTicks);
this.renderBackground(guiGraphics, mouseX, mouseY, partialTicks);
this.drawGuiContainerBackgroundLayer(guiGraphics, partialTicks, mouseX, mouseY);
for (Renderable renderable : this.renderables) {
Expand Down Expand Up @@ -166,7 +165,7 @@ private void drawCategoriesInSlide(GuiGraphics guiGraphics) {
ACShowPropEditScreen.Info info = this.infoCollection.get(i);
// draw property name
int y1 = y0 + 8;
drawScrollingString(guiGraphics, font, Component.literal(info.prop()), x0 + 4, y1, x0 + 92, y1 + 10, TEXT_COLOR);
drawScrollingString(guiGraphics, font, Component.translatable("area_control.property." + info.prop()), x0 + 4, y1, x0 + 92, y1 + 10, TEXT_COLOR);
Boolean state = this.states.get(info.prop());
if (state == null) {
// Unset is selected
Expand Down
59 changes: 42 additions & 17 deletions src/main/resources/assets/area_control/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,48 @@

"area_control.admin.welcome": "AreaControl: Welcome back, administrator %s",

"area_control.property.area.allow_spawn.tooltip": "If allowed, entities can spawn in this area.",
"area_control.property.area.allow_pvp.tooltip": "If allowed, players can attack each other in this area.",
"area_control.property.area.allow_attack.tooltip": "If allowed, players can attack other entities (except players) in this area.",
"area_control.property.area.allow_interact_entity.tooltip": "If allowed, players can interact with entities in this area.",
"area_control.property.area.allow_ride.tooltip": "If allowed, players can mount on (specified) entities in this area.",
"area_control.property.area.allow_break_block.tooltip": "If allowed, players can break blocks in this area.",
"area_control.property.area.allow_click_block.tooltip": "If allowed, players can click on block in this area.",
"area_control.property.area.allow_activate_block.tooltip": "If allowed, players can interact with blocks in this area.",
"area_control.property.area.allow_place_block.tooltip": "If allowed, players can place blocks in this area.",
"area_control.property.area.allow_use_item.tooltip": "If allowed, players can use items in this area.",
"area_control.property.area.allow_possess.tooltip": "If allowed, players can have (specified) items in their inventory while in this area.",
"area_control.property.area.allow_explosion.tooltip": "If allowed, explosion can happen in this area.",
"area_control.property.area.allow_explosion_affect_blocks.tooltip": "If allowed, explosion can break blocks in this area.",
"area_control.property.area.allow_explosion_affect_entities.tooltip": "If allowed, explosion can hurt entities in this area.",
"area_control.property.area.allow_trample_farmland.tooltip": "If allowed, anyone can trample farmland back into dirt in this area.",
"area_control.property.area.allow_fire_spread.tooltip": "If allowed, fire can spread within this area.",

"area_control.property.spawn": "Spawn Entities",
"area_control.property.spawn.tooltip": "If allowed, entities can spawn in this area.",
"area_control.property.pvp": "PvP",
"area_control.property.pvp.tooltip": "If allowed, players can attack each other in this area.",
"area_control.property.attack": "Attack Non-Player Entities",
"area_control.property.attack.tooltip": "If allowed, players can attack other entities (except players) in this area.",
"area_control.property.interact_entity": "Interact Entities",
"area_control.property.interact_entity.tooltip": "If allowed, players can interact with entities in this area.",
"area_control.property.ride": "Ride Entities",
"area_control.property.ride.tooltip": "If allowed, players can mount on (specified) entities in this area.",
"area_control.property.break_block": "Break Blocks",
"area_control.property.break_block.tooltip": "If allowed, players can break blocks in this area.",
"area_control.property.click_block": "Click Blocks",
"area_control.property.click_block.tooltip": "If allowed, players can click on block in this area.",
"area_control.property.activate_block": "Use On Blocks",
"area_control.property.activate_block.tooltip": "If allowed, players can interact with blocks in this area.",
"area_control.property.place_block": "Place Blocks",
"area_control.property.place_block.tooltip": "If allowed, players can place blocks in this area.",
"area_control.property.use_item": "Use Items",
"area_control.property.use_item.tooltip": "If allowed, players can use items in this area.",
"area_control.property.possess": "Possess Items",
"area_control.property.possess.tooltip": "If allowed, players can have (specified) items in their inventory while in this area.",
"area_control.property.explosion": "Explosion",
"area_control.property.explosion.tooltip": "If allowed, explosion can happen in this area.",
"area_control.property.explosion_affect_blocks": "Explosion Affect Blocks",
"area_control.property.explosion_affect_blocks.tooltip": "If allowed, explosion can break blocks in this area.",
"area_control.property.explosion_affect_entities": "Explosion Affect Entities",
"area_control.property.explosion_affect_entities.tooltip": "If allowed, explosion can hurt entities in this area.",
"area_control.property.trample_farmland": "Trample Farmland",
"area_control.property.trample_farmland.tooltip": "If allowed, anyone can trample farmland back into dirt in this area.",
"area_control.property.fire_spread": "Fire Spread",
"area_control.property.fire_spread.tooltip": "If allowed, fire can spread within this area.",

"area_control.property.select_from_child_area_by_entity": "Entity Selectors select entities by entity in child areas",
"area_control.property.select_from_child_area_by_entity.tooltip": "If allowed, entities from child areas can use Entity Selectors to select entities in this area.",
"area_control.property.select_from_parent_area_by_entity": "Entity Selectors select entities by entity in parent areas",
"area_control.property.select_from_parent_area_by_entity.tooltip": "If allowed, entities from parent areas can use Entity Selectors select entities in this area.",
"area_control.property.select_from_child_area_by_command_block": "Entity Selectors select entities by command blocks in child areas",
"area_control.property.select_from_child_area_by_command_block.tooltip": "If allowed, Command Blocks from child areas can use Entity Selectors select entities in this area.",
"area_control.property.select_from_parent_area_by_command_block": "Entity Selectors select entities by command blocks in parent areas",
"area_control.property.select_from_parent_area_by_command_block.tooltip": "If allowed, Command Blocks from parent areas can use Entity Selectors select entities in this area.",

"area_control.owner.aka": "Known as %s in-game",

"area_control.claim.how_to": "To claim a area, you need a(n) %1$s. You need to hold this item and use it on the lower-left corner of the area you would like to claim. \nThen, do the same on the upper-right corner of the area you would like to claim. Finally, execute command /ac claim.\nYou may also use /ac claim chunk to claim one or more chunks.\nServers may apply additional rules. In case of conflicts, ask your server op.",
Expand Down
57 changes: 41 additions & 16 deletions src/main/resources/assets/area_control/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,47 @@

"area_control.admin.welcome": "AreaControl:欢迎回来,管理员 %s",

"area_control.property.area.allow_spawn.tooltip": "是否允许实体在该领地中生成。",
"area_control.property.area.allow_pvp.tooltip": "是否允许该领地中玩家攻击其他玩家。",
"area_control.property.area.allow_attack.tooltip": "是否允许该领地中玩家攻击非玩家实体。",
"area_control.property.area.allow_interact_entity.tooltip": "是否允许玩家与该领地中的实体交互。",
"area_control.property.area.allow_ride.tooltip": "是否允许玩家在该领地中骑乘(特定)载具。",
"area_control.property.area.allow_break_block.tooltip": "是否允许玩家破坏该领地中的方块。",
"area_control.property.area.allow_click_block.tooltip": "是否允许玩家点击(左击)该领地中的方块。",
"area_control.property.area.allow_activate_block.tooltip": "是否允许玩家与该领地中的方块互动(右击方块)。",
"area_control.property.area.allow_place_block.tooltip": "是否允许玩家在该领地中放置方块。",
"area_control.property.area.allow_use_item.tooltip": "是否允许玩家在该领地中使用物品。",
"area_control.property.area.allow_possess.tooltip": "是否允许玩家在该领地中持有(特定)物品。",
"area_control.property.area.allow_explosion.tooltip": "是否允许爆炸。",
"area_control.property.area.allow_explosion_affect_blocks.tooltip": "是否允许爆炸破坏该领地中方块。",
"area_control.property.area.allow_explosion_affect_entities.tooltip": "是否允许爆炸伤害该领地中实体。",
"area_control.property.area.allow_trample_farmland.tooltip": "是否允许踩坏该领地内耕地。",
"area_control.property.area.allow_fire_spread.tooltip": "是否允许火焰蔓延至该领地内。",
"area_control.property.spawn": "实体生成",
"area_control.property.spawn.tooltip": "是否允许实体在该领地中生成。",
"area_control.property.pvp": "PvP",
"area_control.property.pvp.tooltip": "是否允许该领地中玩家攻击其他玩家。",
"area_control.property.attack": "攻击非玩家实体",
"area_control.property.attack.tooltip": "是否允许该领地中玩家攻击非玩家实体。",
"area_control.property.interact_entity": "实体交互",
"area_control.property.interact_entity.tooltip": "是否允许玩家与该领地中的实体交互。",
"area_control.property.ride": "骑乘载具",
"area_control.property.ride.tooltip": "是否允许玩家在该领地中骑乘(特定)载具。",
"area_control.property.break_block": "破坏方块",
"area_control.property.break_block.tooltip": "是否允许玩家破坏该领地中的方块。",
"area_control.property.click_block": "点击(左击)方块",
"area_control.property.click_block.tooltip": "是否允许玩家点击(左击)该领地中的方块。",
"area_control.property.activate_block": "使用(右击)方块",
"area_control.property.activate_block.tooltip": "是否允许玩家与该领地中的方块互动(右击方块)。",
"area_control.property.place_block": "放置方块",
"area_control.property.place_block.tooltip": "是否允许玩家在该领地中放置方块。",
"area_control.property.use_item": "使用物品",
"area_control.property.use_item.tooltip": "是否允许玩家在该领地中使用物品。",
"area_control.property.possess": "持有物品",
"area_control.property.possess.tooltip": "是否允许玩家在该领地中持有(特定)物品。",
"area_control.property.explosion": "爆炸",
"area_control.property.explosion.tooltip": "是否允许爆炸。",
"area_control.property.explosion_affect_blocks": "爆炸破坏方块",
"area_control.property.explosion_affect_blocks.tooltip": "是否允许爆炸破坏该领地中方块。",
"area_control.property.explosion_affect_entities": "爆炸伤害实体",
"area_control.property.explosion_affect_entities.tooltip": "是否允许爆炸伤害该领地中实体。",
"area_control.property.trample_farmland": "践踏耕地",
"area_control.property.trample_farmland.tooltip": "是否允许踩坏该领地内耕地。",
"area_control.property.fire_spread": "火焰蔓延",
"area_control.property.fire_spread.tooltip": "是否允许火焰蔓延至该领地内。",

"area_control.property.select_from_child_area_by_entity": "下级领地内实体使用实体选择器选中本领地实体",
"area_control.property.select_from_child_area_by_entity.tooltip": "是否允许来自子领地的实体使用实体选择器选中本领地中的实体",
"area_control.property.select_from_parent_area_by_entity": "上级领地内实体使用实体选择器选中本领地实体",
"area_control.property.select_from_parent_area_by_entity.tooltip": "是否允许来自外层领地的实体使用实体选择器选中本领地中的实体",
"area_control.property.select_from_child_area_by_command_block": "下级领地内命令方块使用实体选择器选中本领地实体",
"area_control.property.select_from_child_area_by_command_block.tooltip": "是否允许来自子领地的命令方块使用实体选择器选中本领地中的实体",
"area_control.property.select_from_parent_area_by_command_block": "上级领地内命令方块使用实体选择器选中本领地实体",
"area_control.property.select_from_parent_area_by_command_block.tooltip": "是否允许来自外层领地的命令方块使用实体选择器选中本领地中的实体",

"area_control.owner.aka": "在游戏中又名 %s",

Expand Down

0 comments on commit b07f840

Please sign in to comment.