diff --git a/loc/base.ts b/loc/base.ts index c8cf843..f6f4f9e 100644 --- a/loc/base.ts +++ b/loc/base.ts @@ -2,6 +2,7 @@ import { DeepPartial } from '../src/util/type_util'; import { en_GB } from './en_GB'; import { en_US } from './en_US'; import { ru_RU } from './ru_RU'; +import { zh_CN } from './zh_CN'; export type TTranslationMap = typeof en_GB.translations; @@ -15,4 +16,5 @@ export const locales = [ en_GB, en_US, ru_RU, + zh_CN, ]; diff --git a/loc/en_GB.ts b/loc/en_GB.ts index 601bf9e..3b76b9b 100644 --- a/loc/en_GB.ts +++ b/loc/en_GB.ts @@ -48,6 +48,10 @@ export const en_GB = { components: { 'no_materials_loaded': 'No materials loaded', 'material_type': 'Type', + 'solid': 'Solid', + 'textured': 'Textured', + 'no_image_loaded' : 'No image loaded', + 'choose': 'Choose', 'texture_filtering': 'Filtering', 'texture_wrap': 'Wrap', 'transparency': 'Transparency', diff --git a/loc/zh_CN.ts b/loc/zh_CN.ts new file mode 100644 index 0000000..892c4a3 --- /dev/null +++ b/loc/zh_CN.ts @@ -0,0 +1,163 @@ +// Credits: +// KatMelon + +export const zh_CN = { + display_name: '简体中文', + language_code: 'zh_CN', + translations: { + something_went_wrong: '发生了意料之外的错误', + init: { + initialising: '正在初始化...', + ready: '完毕', + }, + settings: { + heading: '设置', + components: { + language: '语言', + }, + changing_language: '正在更换语言...', + changed_language: '已更换语言', + }, + import: { + heading: '1. 导入', + button: '加载网格模型', + importing_mesh: '正在导入网格模型...', + imported_mesh: '已导入网格模型', + rendering_mesh: '正在渲染网格模型...', + rendered_mesh: '已渲染网格模型', + no_vertices_loaded: '未加载任何顶点', + no_triangles_loaded: '未加载任何三角面', + could_not_scale_mesh: '无法正确缩放网格模型 - 此模型似乎为 2D 平面,请旋转此模型,使其竖直高度不为零', + invalid_encoding: '发现无法识别的字符,请使用 UTF-8 编码', + invalid_face_data: '网格面数据与顶点数量不匹配: {{count, number}}', + too_many_triangles: '导入的网格模型拥有 {{count, number}} 个三角面,请考虑使用 Blender 等建模软件进行简化', + vertex_triangle_count: '{{vertex_count, number}} 个顶点,{{triangle_count, number}} 个三角面', + missing_normals: '部分顶点未定义法线,可能导致体素错误对齐', + failed_to_parse_line: '尝试解析 "{{line}}" 失败,原因: "{{error}}"', + gltf_experimental: '导入 GLTF 目前为实验性功能,可能产生预料外的结果', + components: { + input: '3D 模型(.obj, .gltf/.glb)', + rotation: '旋转', + }, + }, + materials: { + heading: '2. 材质', + button: '更新材质', + updating_materials: '正在更新材质...', + updated_materials: '已更新材质', + components: { + 'no_materials_loaded': '未加载任何材质', + 'material_type': '类型', + 'solid': '纯色', + 'textured': '纹理', + 'no_image_loaded' : '未加载图像', + 'choose': '选择', + 'texture_filtering': '纹理过滤', + 'texture_wrap': '纹理环绕', + 'transparency': '透明度', + 'diffuse_map': '漫反射贴图', + 'alpha': '不透明度', + 'alpha_map': '使用不透明度映射图', + 'alpha_channel': '不透明度通道', + 'linear': '线性', + 'nearest': '最近', + 'clamp': '拉伸', + 'repeat': '重复', + 'none': '无', + 'alpha_constant': '使用不透明度常量', + 'diffuse_map_alpha_channel': '使用漫反射贴图的不透明度通道', + }, + }, + voxelise: { + heading: '3. 体素化', + button: '体素化网格模型', + loading_voxel_mesh: '正在加载体素模型...', + loaded_voxel_mesh: '已加载体素模型', + rendering_voxel_mesh: '正在渲染体素模型...', + rendered_voxel_mesh: '已渲染体素模型', + voxel_count: '{{count, number}} 个体素', + voxel_mesh_dimensions: '大小为 {{x, number}} x {{y, number}} x {{z, number}} 体素', + components: { + constraint_axis: '约束轴向', + size: '尺寸', + algorithm: '算法', + ambient_occlusion: '环境光遮蔽', + multisampling: '多重采样', + voxel_overlap: '体素重叠', + colour: '颜色', + x_axis: 'X (宽度)(红色轴)', + y_axis: 'Y (高度)(绿色轴)', + z_axis: 'Z (深度)(蓝色轴)', + ray_based: '基于射线', + bvh_ray: '基于 BVH 射线', + ncrb: 'NCRB', + average_recommended: '均值(推荐)', + first: '首个', + on_recommended: '启用(推荐)', + off_faster: '禁用(速度更快)', + }, + }, + assign: { + heading: '3. 绑定', + button: '绑定方块', + loading_block_mesh: '正在加载方块模型...', + loaded_block_mesh: '已加载方块模型', + rendering_block_mesh: '正在渲染方块模型...', + rendered_block_mesh: '已渲染方块模型', + deselected_blocks: '未选择 {{count, number}} 种方块', + selected_blocks: '已选择 {{count, number}} 种方块', + found_blocks: '已找到 {{count, number}} 种方块', + block_not_namespaced: '"{{block_name}}" 未正确使用命名空间,是不是指 "minecraft:{{block_name}}"?', + could_not_use_block: '无法使用 "{{block_name}}",因为其不受支持', + reading_palette: '正在读取 {{file_name}}...', + block_palette_missing_light_blocks: '方块色板中不包含可供放置的发光方块', + blocks_missing_textures: '{{count, number}} 种色板中的方块缺失纹理,将不会被使用', + falling_blocks: '{{count, number}} 个方块将在结构放置时因重力而下落', + components: { + texture_atlas: '纹理包', + block_palette: '方块色板', + dithering: '混色抖动', + dithering_magnitude: '抖动程度', + fallable_blocks: '可掉落方块', + colour_accuracy: '颜色精准度', + smart_averaging: '智能平均', + smoothness: '平滑度', + calculate_lighting: '计算光照', + light_threshold: '光照阈值', + vanilla: '原版', + ordered: '有序', + random: '随机', + off: '禁用', + replace_falling: '使用固态方块替换将要掉落的方块', + replace_fallable: '使用固态方块替换可以掉落的方块', + do_nothing: '不替换', + search: '搜索...', + }, + }, + export: { + heading: '5. 导出', + button: '导出建筑结构', + exporting_structure: '正在导出结构...', + exported_structure: '已导出结构', + schematic_unsupported_blocks: '{{count, number}} 个方块({{unique, number}} 种)不受 .schematic 文件格式支持,将使用石头方块代替。尝试使用支持 .schematic 格式的色板,或使用 .litematica 格式导出', + nbt_exporter_too_big: '结构方块仅支持 48x48x48 大小的区域,此范围外的方块将会被移除', + components: { + exporter: '导出为', + litematic: 'Litematic (.litematic)', + schematic: 'Schematic (.schematic)', + sponge_schematic: 'Sponge Schematic (.schem)', + structure_blocks: '结构方块 (.nbt)', + indexed_json: '有索引的 JSON (.json)', + uncompressed_json: '未压缩的 JSON (.json)', + }, + }, + misc: { + red: '红', + green: '绿', + blue: '蓝', + alpha: '不透明度', + on: '启用', + off: '禁用', + }, + }, +}; diff --git a/src/ui/components/image.ts b/src/ui/components/image.ts index 79ad8c1..7a0d6e0 100644 --- a/src/ui/components/image.ts +++ b/src/ui/components/image.ts @@ -2,6 +2,7 @@ import { TImageRawWrap } from '../../texture'; import { getRandomID } from '../../util'; import { ASSERT } from '../../util/error_util'; import { UIUtil } from '../../util/ui_util'; +import { LOC } from '../../localiser'; import { AppIcons } from '../icons'; import { ConfigComponent } from './config'; import { ToolbarItemComponent } from './toolbar_item'; @@ -15,7 +16,7 @@ export class ImageComponent extends ConfigComponent, HTML super(Promise.resolve(param ?? { raw: '', filetype: 'png' })); this._switchElement = new ToolbarItemComponent({ id: 'sw', iconSVG: AppIcons.UPLOAD }) - .setLabel('Choose') + .setLabel(LOC('materials.components.choose')) .onClick(() => { const inputElement = UIUtil.getElementById(this._getId() + '-input') as HTMLInputElement; inputElement.click(); @@ -32,7 +33,7 @@ export class ImageComponent extends ConfigComponent, HTML
${AppIcons.IMAGE_MISSING}
-
No image loaded
+
${LOC('materials.components.no_image_loaded')}
diff --git a/src/ui/components/material_type.ts b/src/ui/components/material_type.ts index 24fa0d0..b9884a8 100644 --- a/src/ui/components/material_type.ts +++ b/src/ui/components/material_type.ts @@ -1,5 +1,6 @@ import { MaterialType, SolidMaterial, TexturedMaterial } from '../../mesh'; import { AppIcons } from '../icons'; +import { LOC } from '../../localiser'; import { ConfigComponent } from './config'; import { ToolbarItemComponent } from './toolbar_item'; @@ -13,7 +14,7 @@ export class MaterialTypeComponent extends ConfigComponent { if (this._material.type === MaterialType.textured) { @@ -22,7 +23,7 @@ export class MaterialTypeComponent extends ConfigComponent { if (this._material.type === MaterialType.solid) { diff --git a/src/ui/layout.ts b/src/ui/layout.ts index f3f9314..193e7c1 100644 --- a/src/ui/layout.ts +++ b/src/ui/layout.ts @@ -229,7 +229,7 @@ export class UI { payload: 'replace-falling', }, { - displayLocKey: 'assign.components.fallable_blocks', + displayLocKey: 'assign.components.replace_fallable', payload: 'replace-fallable', }, { @@ -321,7 +321,7 @@ export class UI { payload: 'schem', }, { - displayLocKey: 'export.exported_structure', + displayLocKey: 'export.components.structure_blocks', payload: 'nbt', }, {