Merge pull request #15 from ForestOfLight/pr-chinese-translation
add Chinese translation, thanks to wed150
This commit is contained in:
@@ -41,15 +41,16 @@ class BlockInfo {
|
||||
static getBlockMessage(block) {
|
||||
if (!block)
|
||||
return { translate: 'construct.blockinfo.unknown' };
|
||||
const message = { rawtext: [{ text: '§a' }, { translate: block.type.id }]};
|
||||
const message = { rawtext: [{ text: '§a' }, { translate: block.localizationKey }] };
|
||||
const states = block.getAllStates();
|
||||
if (Object.keys(states).length > 0)
|
||||
message.rawtext.push({ text: `\n§7${this.getFormattedStates(states)}` });
|
||||
if (block.isWaterlogged)
|
||||
if (block.isWaterlogged) {
|
||||
message.rawtext.push({ rawtext: [
|
||||
{ text: '\n§7' },
|
||||
{ translate: 'construct.blockinfo.waterlogged' }
|
||||
]});
|
||||
] });
|
||||
}
|
||||
return message;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import { ActionFormData, ModalFormData } from '@minecraft/server-ui';
|
||||
import { MenuFormBuilder } from '../MenuFormBuilder';
|
||||
import { StructureVerifier } from '../Verifier/StructureVerifier';
|
||||
import { StructureStatistics } from '../Structure/StructureStatistics';
|
||||
import { EntityComponentTypes, TicksPerSecond } from '@minecraft/server';
|
||||
import {EntityComponentTypes, TicksPerSecond, world} from '@minecraft/server';
|
||||
|
||||
export class InstanceFormBuilder {
|
||||
static structureVerifier;
|
||||
@@ -15,10 +15,15 @@ export class InstanceFormBuilder {
|
||||
{ translate: 'construct.instance.menu.body', with: [instance.getName(), instance.getStructureId()] }
|
||||
]};
|
||||
if (instance.hasLocation())
|
||||
body.rawtext.push(...[
|
||||
{ text: '\n' },
|
||||
{ translate: 'construct.instance.menu.location', with: [String(location.location.x), String(location.location.y), String(location.location.z), location.dimensionId] }
|
||||
]);
|
||||
body.rawtext.push(...[
|
||||
{ text: '\n' },
|
||||
{ translate: 'construct.instance.menu.location', with: { rawtext: [
|
||||
{ text:String(location.location.x) },
|
||||
{ text:String(location.location.y) },
|
||||
{ text:String(location.location.z) },
|
||||
{ translate:world.getDimension(location.dimensionId).localizationKey }
|
||||
]} }
|
||||
]);
|
||||
form.body(body);
|
||||
options.forEach(option => {
|
||||
form.button({ translate: option });
|
||||
@@ -29,7 +34,7 @@ export class InstanceFormBuilder {
|
||||
static buildRenameInstance(currentName) {
|
||||
return new ModalFormData()
|
||||
.title(MenuFormBuilder.menuTitle)
|
||||
.textField({ translate: 'construct.isntance.menu.rename' }, currentName)
|
||||
.textField({ translate: 'construct.instance.menu.rename' }, currentName)
|
||||
.submitButton({ translate: 'construct.menu.instance.button.rename' });
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,7 @@ function handleWaterlogging(block, structureBlock) {
|
||||
function playBlockPlacementSound(player, block, structureBlock) {
|
||||
const blockId = structureBlock.type.id.replace('minecraft:', '');
|
||||
const blockData = blocks[blockId];
|
||||
let blockSound = blockData['sound'] || 'stone';
|
||||
let blockSound = blockData?.sound || 'stone';
|
||||
let blockSoundId = block_sounds[blockSound].events.place?.sound
|
||||
|| block_sounds[block_sounds[blockSound].base].events.place?.sound;
|
||||
player.dimension.playSound(blockSoundId, block.location);
|
||||
|
||||
@@ -31,7 +31,7 @@ construct.instance.validation.alreadyRunning=§cA verification is already in pro
|
||||
construct.instance.validation.formfail=§cFailed to build statistics form.
|
||||
construct.instance.menu.body=Instance: §a%1\n§fStructure: §2%2 ## Insert strings: instance name, structure name
|
||||
construct.instance.menu.location=§7(%1 %2 %3 in %4) ## Is added to the body when the instance has is placed. Insert strings: x, y, z coordinates, dimension
|
||||
construct.isntance.menu.rename=Enter a new name for the instance:
|
||||
construct.instance.menu.rename=Enter a new name for the instance:
|
||||
construct.instance.option.validation=Block Validation
|
||||
construct.instance.option.validation.description=Shows missing and incorrect block overlay.
|
||||
construct.instance.option.layer=Layer
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
[
|
||||
"en_US"
|
||||
"en_US",
|
||||
"zh_CN"
|
||||
]
|
||||
@@ -0,0 +1,111 @@
|
||||
## 物品
|
||||
construct.menu.name=投影构筑菜单
|
||||
construct.easyplace.name=便捷放置器
|
||||
construct.materialgrabber.name=材料收集器
|
||||
|
||||
## 菜单
|
||||
construct.menu.open.closechat=§8请关闭聊天窗口以打开菜单
|
||||
construct.menu.open.timeout=§8菜单已超时
|
||||
construct.menu.submit=§2确定
|
||||
construct.menu.instance.button.unknown=未知
|
||||
construct.menu.instance.button.place=§a放置项目
|
||||
construct.menu.instance.button.enable=§a启用项目
|
||||
construct.menu.instance.button.disable=§c禁用项目
|
||||
construct.menu.instance.button.rename=重命名项目
|
||||
construct.menu.instance.button.delete=§c删除项目
|
||||
construct.menu.instance.button.nextLayer=增加图层
|
||||
construct.menu.instance.button.previousLayer=减少图层
|
||||
construct.menu.instance.button.move=移至此处
|
||||
construct.menu.instance.button.flexibleMove=自由移动项目
|
||||
construct.menu.instance.button.statistics=统计数据
|
||||
construct.menu.instance.button.settings=设置
|
||||
construct.menu.instance.button.materials=材料列表
|
||||
construct.menu.instance.unknownOption=§c未知选项: %s
|
||||
construct.menu.instance.nameEmpty=§c项目名称不能为空
|
||||
|
||||
construct.instance.flexibleMove.alreadyMoving=§c此项目已处于移动状态
|
||||
construct.instance.flexibleMove.start=§a正在移动"%s", 完成后使用"投影构筑菜单"物品确认 ## 插入字符串: 实例名称
|
||||
construct.instance.flexibleMove.finish=§a已将"%1"移动至%2 ## 插入字符串: 项目名称, 坐标
|
||||
construct.instance.rename.error=§c重命名项目时出错: %s
|
||||
construct.instance.validation.alreadyRunning=§c检验已在进行中, 请稍后
|
||||
construct.instance.validation.formfail=§c创建统计表单时出错
|
||||
construct.instance.menu.body=项目: §a%1\n§f结构: §2%2 ## 插入字符串: 项目名称, 结构名称
|
||||
construct.instance.menu.location=§7(%4 %1 %2 %3 ) ## 当项目已放置时添加到主体; 插入字符串: x, y, z 坐标, 维度(We change the dimension name to be inserted according to the client language)
|
||||
construct.instance.menu.rename=请输入项目的新名称:
|
||||
construct.instance.option.validation=方块检验
|
||||
construct.instance.option.validation.description=检验并且显示项目中缺失和摆放错误的方块
|
||||
construct.instance.option.layer=层级
|
||||
construct.instance.option.layer.description=更改活动的层级, 使用 0 表示所有层级
|
||||
construct.instance.materials.noinventory=§c无效的玩家背包
|
||||
construct.instance.materials.missing.header=§c背包中缺失的材料:
|
||||
construct.instance.materials.missing.button=显示缺失材料
|
||||
construct.instance.materials.layer=§7(第%s层) ## 当项目处于层级模式时添加到标题; 插入字符串: 图层编号
|
||||
construct.instance.materials.all.header=§a所有材料:
|
||||
construct.instance.materials.all.button=显示所有材料
|
||||
|
||||
construct.materials.grabber.menu.title= 材料收集器
|
||||
construct.materials.grabber.menu.success=§7成功选择"§2%s§f"为材料收集器的目标项目 ## 插入字符串: 项目名称
|
||||
construct.materials.grabber.menu.header=§7当前项目:
|
||||
construct.materials.grabber.menu.noinstance=§7无
|
||||
construct.materials.grabber.menu.selectinstance=§7请选择一个项目:
|
||||
|
||||
construct.structure.statistics.header=§f"§a%s§f"的统计信息: ## 插入字符串: 项目名称
|
||||
construct.structure.statistics.blocks=§7方块总数: §2%s ## 插入字符串: 结构中非空气方块的数量
|
||||
construct.structure.statistics.skipped=§c[!]本次分析跳过了%s个方块 ## 插入字符串: 分析跳过的方块数量
|
||||
construct.structure.statistics.correct=§7正确的方块: §a%s ## 插入字符串: 正确放置的方块数量
|
||||
construct.structure.statistics.stateincorrect=§7方块状态有误: §e%s ## 插入字符串: 状态错误的方块数量
|
||||
construct.structure.statistics.incorrect=§7方块位置错误: §c%s ## 插入字符串: 位置错误的方块数量
|
||||
construct.structure.statistics.missing=§7缺失方块: §3%s ## 插入字符串: 缺失的方块数量
|
||||
|
||||
## 结构方块信息显示
|
||||
construct.blockinfo.header=结构:
|
||||
construct.blockinfo.none=§7无
|
||||
construct.blockinfo.nosupply=§c[缺少材料] ## 目标方块在玩家背包中缺失
|
||||
construct.blockinfo.unknown=§7未知
|
||||
construct.blockinfo.waterlogged=§3是§7含水方块
|
||||
|
||||
construct.mainmenu.instance.exists=§c项目名称"%s"已被占用, 请尝试使用其他名称 ## 插入字符串: 项目名称
|
||||
construct.mainmenu.instance.notfound=§c未找到结构ID"%s"; 若你查找的是已放入structures文件夹的结构, 请重启存档后重试 ## 插入字符串: 结构名称
|
||||
construct.mainmenu.title=§l§2投影·构建 ## 这是addon的名称
|
||||
construct.mainmenu.selectinstance=请选择一个项目:
|
||||
construct.mainmenu.settings=构建器设置
|
||||
construct.mainmenu.newinstance=创建新项目
|
||||
construct.mainmenu.newinstance.prompt=请输入新项目的名称:
|
||||
construct.mainmenu.newinstance.placeholder=示例_项目 ## 用户输入项目名称的文本框中的占位符文本
|
||||
construct.mainmenu.selectstructure.header=请选择一个结构:
|
||||
construct.mainmenu.selectstructure.other=其他
|
||||
construct.mainmenu.selectstructure.howto=如何添加/移除结构
|
||||
construct.mainmenu.selectstructure.other.prompt=请输入结构ID:
|
||||
construct.mainmenu.selectstructure.other.placeholder=示例_结构 ## 用户输入结构名称的文本框中的占位符文本
|
||||
construct.mainmenu.selectstructure.howto.add.header=§a如何添加结构:
|
||||
construct.mainmenu.selectstructure.howto.add.structureblock=§7-使用§f结构方块§7或§f/structure§7命令保存一个结构
|
||||
construct.mainmenu.selectstructure.howto.add.or=§7§l或§r
|
||||
construct.mainmenu.selectstructure.howto.add.mcstructure=§7-将§f.mcstructure§7文件添加到此插件的§fstructures文件夹§7; 选择结构时, 选择§f其他§7选项, 然后使用文件名(不带'.mcstructure')作为§f结构ID§7; 使用后, 它会被添加到结构列表中
|
||||
construct.mainmenu.selectstructure.howto.remove.header=§c如何移除结构:
|
||||
construct.mainmenu.selectstructure.howto.remove.body=§7-使用§f/structure delete§7命令从存档中移除结构
|
||||
|
||||
## 命令
|
||||
|
||||
construct.commands.construct=打开投影构筑菜单
|
||||
construct.commands.item=获得投影构筑菜单物品,可以使用它打开投影构筑菜单
|
||||
construct.commands.item.denyorigin=此命令只能由玩家使用
|
||||
construct.commands.item.fail=§c给予投影构筑菜单物品时发生错误
|
||||
construct.commands.item.success=§a您已获得投影构筑菜单物品, 使用它以打开投影构筑菜单
|
||||
|
||||
## 选项
|
||||
|
||||
construct.option.enabled=现已启用!
|
||||
construct.option.disabled=现已禁用!
|
||||
construct.option.easyplace.name=便捷放置
|
||||
construct.option.easyplace.description=帮助放置正确的方块
|
||||
construct.option.easyplace.howto=将"便捷放置器"物品放在副手槽位, 在项目中放置方块时自动修正方块
|
||||
construct.option.easyplace.actionprevented=§c操作被便捷放置功能阻止
|
||||
construct.option.fasteasyplace.name=快速放置
|
||||
construct.option.fasteasyplace.description=使用即可放置建筑对应的所需方块
|
||||
construct.option.fasteasyplace.howto=主手持"便捷放置器"物品, 对准建筑中缺失的方块长按(右键)即可补放
|
||||
construct.option.materialgrabber.name=材料收集器
|
||||
construct.option.materialgrabber.description=从箱子等容器中获取建筑所需物品
|
||||
construct.option.materialgrabber.howto=使用"材料收集器"物品与箱子等容器交互, 即可从中获取建筑所需物品
|
||||
construct.option.materialgrabber.grabbed.zero=§7已收集 0 个物品
|
||||
construct.option.materialgrabber.grabbed.one=§a已收集 1 个物品
|
||||
construct.option.materialgrabber.grabbed.many=§a已收集 %s 个物品 ## 插入字符串: 收集给玩家的物品数
|
||||
Reference in New Issue
Block a user