跳到主要内容

lang.yml

plugins/CloudHologram/lang.yml 存放插件发给玩家与控制台的提示文字,例如「看板已创建!」「该名称的看板不存在。」。 默认全部是简体中文,你可以改成自己服务器的风格。

怎么运作​

  • 第一次启动时,插件把所有提示文字的默认值写进 lang.yml。
  • 之后每次开服或 /clh reload,插件读取文件里的文字;文件里缺少的键会自动补回默认值。
  • 改完执行 /clh reload 就生效,不需要重启。

文件是 YAML,键名里的 . 代表一层缩进。例如键 hologram.does_not_exist 在文件里长这样:

prefix: '&8[&bCloudHologram&8] &7'
no_perm: '{prefix}&c你没有权限使用此功能。'
hologram:
does_not_exist: '{prefix}&c该名称的看板不存在。'
created: '{prefix}看板已创建!'
line:
added: '{prefix}行已添加!'
找不到某个键?

文件里各个键的顺序不固定。用编辑器的搜索功能找键名的最后一段(例如 does_not_exist)或找中文原文最快。

前缀 {prefix}​

键 prefix 是所有提示前面的那段 [CloudHologram]。文字里写 {prefix} 的地方会被换成它。

prefix: '&8[&b云全息&8] &7'
  • 改 prefix 会同时改到所有用 {prefix} 的提示,也包含 /clh click、/clh style、/clh validate 等快捷指令的提示。
  • 不想要前缀的提示,删掉那一句里的 {prefix} 即可。

参数 %1$s​

有些提示会带入数值,用 %1$s、%2$s 这种写法表示「第 1 个参数」「第 2 个参数」(%1$d 是整数)。 例如:

hologram:
renamed: '{prefix}看板已重命名!&7(&b%1$s&7 -> &b%2$s&7)' # %1$s = 旧名称,%2$s = 新名称
reloaded: '{prefix}&a重载成功,耗时 %1$d 毫秒!' # %1$d = 毫秒数
  • 参数可以调换位置,也可以删掉不用。
  • 有参数的那一句里如果要显示百分号 %,要写成 %%,否则那句提示会出错。
  • 参数只能用 %1$s、%1$d 这种写法;写成 {1}、$1 不会被替换。%1$d 只能放数字参数,不确定时用 %1$s 最安全。

颜色​

  • & 颜色代码、&#RRGGBB 十六进制颜色在所有版本都能用。
  • Paper / Purpur 1.18.2+ 也可以用 MiniMessage 标签,例如 <gradient:#78EFFF:#CB9CFF>看板已创建!</gradient>。写法见 颜色与格式。
  • 整句用单引号包起来;句子里本身有单引号(例如 '%1$s')要写成两个 ''。
  • 例外:line.edit 与 line.edit_hover 是可点击 / 悬停文字,只支持 & 颜色代码。

恢复默认​

想恢复做法
某一句在 lang.yml 里删掉那个键,/clh reload,会自动补回默认值。
全部删除(或改名备份)整个 lang.yml,/clh reload,会重新生成。
不在 lang.yml 里的文字

下面这些提示写在程序里,不能用 lang.yml 修改(前缀仍然跟着 prefix 变):

  • 快捷指令 /clh click、clickadd、clickclear、style、validate、addpage、setline 的提示。
  • /clh convert 的转换结果、/clh help 的指令列表、/clh info 的看板资讯、授权相关提示。
  • 少数指令的错误提示,例如坐标不是数字(坐标必须是数字(可以用 ~ 表示相对位置))、/clh page switch 的「找不到在线玩家」。

键名一览​

以下是全部的键与默认文字。

一般​

键默认文字
prefix&8[&bCloudHologram&8] &7
no_perm{prefix}&c你没有权限使用此功能。
only_player{prefix}&c此操作只能由玩家执行。
reloaded{prefix}&a重载成功,耗时 %1$d 毫秒!
new_version_available&3CloudHologram &f有新版本可用,下载地址:(目前不会使用)
command.use_help{prefix}输入 &b/clh help&7 查看可用指令。
command.usage{prefix}用法:&b%1$s
command.unknown_sub_command{prefix}未知的子指令。

看板(hologram)​

键默认文字
hologram.does_not_exist{prefix}&c该名称的看板不存在。
hologram.already_exists{prefix}&c该名称的看板已存在。
hologram.invalid_name{prefix}&c名称 '%1$s' 无效,只能使用英文字母、数字、下划线和短横线。
hologram.created{prefix}看板已创建!
hologram.cloned{prefix}看板已复制!
hologram.deleted{prefix}看板已删除!
hologram.updated{prefix}看板已更新!
hologram.renamed{prefix}看板已重命名!&7(&b%1$s&7 -> &b%2$s&7)
hologram.teleported{prefix}已传送!
hologram.moved{prefix}看板已移动!
hologram.aligned{prefix}看板已对齐!
hologram.align_self{prefix}无法将看板与自身对齐!
hologram.align_axis{prefix}该坐标轴不存在!
hologram.down_origin_set{prefix}向下排列已设为 &b'%1$s'&7!
hologram.down_origin_does_not_exist{prefix}向下排列(down origin)的值只能是 true 或 false!
hologram.facing_set{prefix}朝向已设置!
hologram.flag_add{prefix}已添加旗标 &b"%1$s"&7!
hologram.flag_remove{prefix}已移除旗标 &b"%1$s"&7!
hologram.permission_set{prefix}权限已设置!
hologram.permission_removed{prefix}权限已移除!
hologram.display_range_set{prefix}显示范围已设置!
hologram.update_range_set{prefix}更新范围已设置!
hologram.update_interval_set{prefix}更新间隔已设置!
hologram.disabled{prefix}看板已停用!
hologram.already_disabled{prefix}看板已经是停用状态!
hologram.enabled{prefix}看板已启用!
hologram.already_enabled{prefix}看板已经是启用状态!

页(page)​

键默认文字
page.added{prefix}页已添加!
page.add_failed{prefix}&c添加页失败。
page.inserted{prefix}页已插入!
page.insert_failed{prefix}&c插入页失败。
page.deleted{prefix}页已删除!
page.swapped{prefix}页已交换!
page.swap_self{prefix}&c无法将页与自身交换!
page.swap_failed{prefix}&c交换页失败。
page.does_not_exist{prefix}&c该页不存在。

点击动作(action)​

键默认文字
action.click_type_does_not_exist{prefix}&c该点击类型不存在。
action.does_not_exist{prefix}&c该动作不存在。
action.added{prefix}动作已添加。
action.removed{prefix}动作已移除。
action.cleared{prefix}动作已清空。
action.no_actions{prefix}该点击类型尚未设置任何动作。

行(line)​

键默认文字
line.added{prefix}行已添加!
line.add_failed{prefix}&c添加行失败。
line.set{prefix}行已设置!
line.edit{prefix}&a&l&n点击编辑此行!(/clh line edit 发出的可点击文字)
line.edit_hover&r%1$s(鼠标移到可点击文字上时显示,%1$s 是点击后会填进聊天栏的指令;/clh hologram lines 的列表也用它)
line.inserted{prefix}行已插入!
line.insert_failed{prefix}&c插入行失败。
line.removed{prefix}行已移除!
line.swapped{prefix}行已交换!
line.swap_self{prefix}&c无法将行与自身交换!
line.swap_failed{prefix}&c交换行失败。
line.aligned{prefix}行已对齐!
line.align_self{prefix}无法将行与自身对齐!
line.align_axis{prefix}该坐标轴不存在!
line.height_set{prefix}行高已设置!
line.offsetx_set{prefix}行的 X 偏移已设置!
line.offsetz_set{prefix}行的 Z 偏移已设置!
line.flag_added{prefix}已添加旗标 &b"%1$s"&7!
line.flag_removed{prefix}已移除旗标 &b"%1$s"&7!
line.does_not_exist{prefix}&c该行不存在。
line.permission_set{prefix}权限已设置!
line.permission_removed{prefix}权限已移除!
line.facing_set{prefix}朝向已设置!

注意看板与行的旗标键名不一样:看板是 flag_add / flag_remove,行是 flag_added / flag_removed。

功能(feature)​

%1$s 是功能名称,例如 damage_display。

键默认文字
feature.does_not_exist{prefix}&c功能 "%1$s" 不存在。
feature.enabled{prefix}功能 &b"%1$s"&7 已启用!
feature.already_enabled{prefix}&c功能 "%1$s" 已经是启用状态!
feature.disabled{prefix}功能 &b"%1$s"&7 已停用!
feature.already_disabled{prefix}&c功能 "%1$s" 已经是停用状态!
feature.reloaded{prefix}功能 &b"%1$s"&7 已重载!
Display 实体(display)
键默认文字
display.does_not_exist{prefix}&c该名称的 Display 不存在。
display.already_exists{prefix}&c该名称的 Display 已存在。
display.invalid_type{prefix}&c无效的 Display 类型 '%1$s'。可用类型:&b%2$s&7。
display.invalid_name{prefix}&c名称 '%1$s' 无效,只能使用英文字母、数字、下划线和短横线。
display.created{prefix}Display &b'%1$s'&7 已创建!
display.deleted{prefix}Display 已删除!
display.moved{prefix}Display 已移动!
display.renamed{prefix}Display 已重命名!
display.cloned{prefix}Display 已复制!
display.enabled{prefix}Display 已启用!
display.disabled{prefix}Display 已停用!
display.display_range_set{prefix}显示范围已设置!
display.update_interval_set{prefix}更新间隔已设置!
display.facing.set{prefix}朝向已设置!
display.facing.invalid_yaw{prefix}&cYaw 必须是 -180 到 180 度之间的有效数字。
display.facing.invalid_pitch{prefix}&cPitch 必须是 -90 到 90 度之间的有效数字。
display.attribute.does_not_exist{prefix}该 Display 没有属性 &b'%1$s'&7。
display.attribute.invalid_value{prefix}&c属性 '%1$s'&c 的值无效:%2$s
display.attribute.set{prefix}已将属性 &b'%1$s'&7 设为 &b'%2$s&b'&7。
display.attribute.reset{prefix}已重置属性 &b'%1$s'&7。
display.attribute.get{prefix}属性 &b'%1$s'&7 的当前值:&b'%2$s&b'&7。
display.attribute.get_not_set{prefix}属性 &b'%1$s'&7 尚未设置。
display.attribute.list.header属性列表的标题(多行,%s = Display 名称)
display.attribute.list.entry &8• &7%s: &b%s(属性名称、值)
display.attribute.list.footer属性列表的结尾(一个换行)
display.attribute.list.empty{prefix}该 Display 尚未设置任何属性。
display.teleported{prefix}&a已传送!
display.world_does_not_exist{prefix}&cDisplay '%1$s' 所在的世界不存在!
display.list.no_displays{prefix}目前没有任何 Display。
display.nearby.no_displays{prefix}附近没有任何 Display。
display.wrong_type{prefix}&c该 Display 不是 '%1$s' 类型。
display.invalid_block_type{prefix}&c无效的方块类型:'%1$s'
display.missing_block_content{prefix}&c方块 Display 必须填写内容。
display.block_set{prefix}已将 Display &b'%1$s'&7 的方块设为 &b'%2$s'&7。
display.invalid_item_type{prefix}&c无效的物品类型:'%1$s'
display.missing_item_content{prefix}&c物品 Display 必须填写内容。
display.item_set{prefix}已将 Display &b'%1$s'&7 的物品设为 &b'%2$s'&7。
display.text.line.added{prefix}已向 Display &b'%1$s'&7 添加一行。
display.text.line.set{prefix}已设置 Display &b'%1$s'&7 的第 &b%2$d&7 行。
display.text.line.removed{prefix}已移除 Display &b'%1$s'&7 的第 &b%2$d&7 行。
display.text.line.inserted{prefix}已向 Display &b'%1$s'&7 插入一行。
display.text.line.swapped{prefix}已交换 Display &b'%1$s'&7 的第 &b%2$d&7 行与第 &b%3$d&7 行。
display.text.line.cannot_swap_self{prefix}&c无法将行与自身交换!
性能分析(profiler)
键默认文字
profiler.started{prefix}性能分析器已启动!
profiler.already_running{prefix}性能分析器已在运行中!
profiler.disabled{prefix}性能分析器已停止!
profiler.not_running{prefix}性能分析器未在运行!
profiler.reset{prefix}性能分析器已重置!
profiler.timer_reset{prefix}计时器 &b'%1$s'&7 已重置!
profiler.stats{prefix}性能分析统计: + 换行 + 统计内容(%1$s)
profiler.timer_not_found{prefix}找不到 ID 为 &b'%1$s'&7 的计时器!