Languages

The plugin ships with 18 complete translations. By default it picks one based on the server's region; you can also pin it.

Supported languages

CodeLanguageCodeLanguage
en_usEnglish (default)it_itItaliano
zh_cn简体中文pt_ptPortuguês
zh_tw繁體中文ru_ruРусский
ja_jp日本語nl_nlNederlands
ko_kr한국어pl_plPolski
fr_frFrançaissv_seSvenska
de_deDeutschtr_trTürkçe
es_esEspañolar_saالعربية
hi_inहिन्दीth_thไทย

Legacy codes still work

Earlier versions used two-letter codes. They are converted automatically, so existing configs do not need to change:

OldBecomesOldBecomesOldBecomes
zhzh_cndede_desvsv_se
zhtzh_tweses_estrtr_tr
enen_usitit_itarar_sa
jaja_jpptpt_pthihi_in
koko_krruru_ruthth_th
frfr_frnlnl_nl

If you edited languages/zh.yml in the past, it is renamed to zh_cn.yml on startup — your changes are kept.

Auto detection

With language: auto the plugin looks up the country of the server's public IP during enable, then maps it to a language.

  • Six public GeoIP endpoints are queried in parallel; the first valid answer wins, so one dead or rate-limited API cannot break detection;
  • 3 s connect and 3 s read timeouts, 6 s total, then it gives up;
  • If everything fails it falls back to en_us and logs [GeoIP] All region APIs failed;
  • After the lookup it hops back onto the main thread (the global region thread on Folia) before touching any Bukkit state.

Country to language

LanguageCountry codes
zh_cnCN, MO
zh_twHK, TW
ja_jpJP
ko_krKR
fr_frFR, BE, CH, LU, MC, CA
de_deDE, AT, LI
es_esES, MX, AR, CO, CL, PE, VE
it_itIT, SM
pt_ptPT, BR
ru_ruRU, BY, KZ, KG, UA
ar_saSA, AE, EG, DZ, MA
hi_inIN
tr_trTR
nl_nlNL
pl_plPL
sv_seSE
th_thTH
en_usevery other country
!

Auto-detection needs outbound internet access. LAN-only servers, hosts that block foreign requests, and fully offline setups all fail and land on English. For those, set language: en_us (or your language) explicitly instead of auto.

With debug: true the log shows the resolved result:

[GeoIP] CN → 简体中文 (zh_cn)

Custom language files

Files live in plugins/CreeperConfettiPro/languages/ and are plain YAML. Edit the text and run /cc language reload.

command:
  no_permission: "&cYou do not have permission to use this command!"
  reload_success: "&aConfiguration reloaded!"
help:
  header: "&6&l=== CreeperConfettiPro help ==="
effect:
  list_header: "&6=== Firework styles (&e{0}&6) ==="
  chance_set: "&aStyle '&e{0}&a is now &f{1}%&a."
RuleDetails
Placeholders{0}, {1}… are filled by the plugin; order matters, repetition is fine
Missing keysFall back to the en_us text, so you can translate only what you care about
Overwrite policyFiles are only written when missing; your edits are never replaced
ResetDelete the file and restart to regenerate the original
Console messagesThe console.* strings are built into the jar and cannot be changed via language files

Key groups: command.* generic messages, help.* the help screen, effect.* style operations, chance.* chances, language.* language management, gui.* interface text.

v

Want a brand new language? Copy en_us.yml to xx_yy.yml and translate. Note that only the 18 built-in codes are loaded — a new code has to be added to SUPPORTED_LANGUAGES in the source.

Colour codes

Use & for colours (same as § in game). & needs no escaping in YAML, but in XML/HTML it has to be written as &.

CodeColourCodeColourCodeStyle
&0Black&9Blue&lBold
&1Dark blue&aGreen&oItalic
&2Dark green&bAqua&nUnderline
&3Dark aqua&cRed&mStrikethrough
&4Dark red&dLight purple&kObfuscated
&5Dark purple&eYellow&rReset
&6Gold&fWhite
&7Gray&8Dark gray

These codes are converted to ANSI colours in the console, so the startup banner is coloured in a Linux terminal too.

多语言

插件自带 18 种语言的完整翻译。默认情况下它会根据服务器所在地区自动挑选语言,你也可以直接指定。

支持的语言

代码语言代码语言
zh_cn简体中文it_itItaliano 意大利语
zh_tw繁體中文pt_ptPortuguês 葡萄牙语
en_usEnglish 英语(默认)ru_ruРусский 俄语
ja_jp日本語 日语nl_nlNederlands 荷兰语
ko_kr한국어 韩语pl_plPolski 波兰语
fr_frFrançais 法语sv_seSvenska 瑞典语
de_deDeutsch 德语tr_trTürkçe 土耳其语
es_esEspañol 西班牙语ar_saالعربية 阿拉伯语
hi_inहिन्दी 印地语th_thไทย 泰语

旧版代码仍然可用

早期版本使用两位语言代码,这些写法会被自动转换成新代码,不必修改现有配置:

旧代码转换为旧代码转换为旧代码转换为
zhzh_cndede_desvsv_se
zhtzh_tweses_estrtr_tr
enen_usitit_itarar_sa
jaja_jpptpt_pthihi_in
koko_krruru_ruthth_th
frfr_frnlnl_nl

如果你之前改过 languages/zh.yml,插件在启动时会自动把它重命名为 zh_cn.yml,改动不会丢。

自动检测原理

当 config.yml 中 language: auto 时,插件会在启用阶段异步查询服务器公网 IP 所在国家,再映射到对应语言。

  • 同时向 6 个公开 GeoIP 接口发起请求,谁先返回有效结果就用谁——单个接口挂掉或被限流不影响检测;
  • 单次连接与读取超时各 3 秒,整体上限 6 秒,超时后直接放弃;
  • 全部失败时回退到 en_us,并在控制台打一条 [GeoIP] All region APIs failed 警告;
  • 查询完成后回到主线程(Folia 为全局区域线程)再应用语言,避免线程安全问题。

国家代码到语言的映射

语言匹配的国家/地区代码
zh_cnCN、MO
zh_twHK、TW
ja_jpJP
ko_krKR
fr_frFR、BE、CH、LU、MC、CA
de_deDE、AT、LI
es_esES、MX、AR、CO、CL、PE、VE
it_itIT、SM
pt_ptPT、BR
ru_ruRU、BY、KZ、KG、UA
ar_saSA、AE、EG、DZ、MA
hi_inIN
tr_trTR
nl_nlNL
pl_plPL
sv_seSE
th_thTH
en_us其它所有国家
!

自动检测依赖公网访问。内网服务器、屏蔽了境外请求的机房、或者完全离线的环境都会失败,最终落到英文。这类服务器请直接把 language 设成 zh_cn,不要用 auto。

打开 debug: true 后,日志会写出识别结果:

[GeoIP] CN → 简体中文 (zh_cn)

自定义语言文件

语言文件位于 plugins/CreeperConfettiPro/languages/,是普通的 YAML。直接改文案即可,改完执行 /cc language reload 生效。

command:
  no_permission: "&c您没有权限使用此命令!"
  reload_success: "&a已重新加载配置!"
help:
  header: "&6&l=== CreeperConfettiPro 帮助 ==="
effect:
  list_header: "&6=== 烟花样式列表 (&e{0}&6) ==="
  chance_set: "&a样式 '&e{0}&a' 的概率已设为 &f{1}%&a。"
规则说明
占位符{0}、{1}… 由插件填充,顺序不能改,可以重复使用
缺失键自动回退到 en_us 的对应文案,所以可以只翻译想改的部分
文件覆盖只有文件不存在时才会写入默认内容,你的修改不会被插件覆盖
恢复原文删除该文件后重启,插件会重新生成一份
控制台消息console.* 系列文案内置于插件中,无法通过语言文件修改

常见键名分组:command.* 通用提示、help.* 帮助菜单、effect.* 样式操作、chance.* 概率、language.* 语言管理、gui.* 界面文字。

v

想做一份全新语言?复制 en_us.yml 为 xx_yy.yml 再逐条翻译即可。注意插件只识别内置的 18 个语言代码,全新代码需要在源码里加入 SUPPORTED_LANGUAGES 才会被加载。

颜色代码

语言文件里用 & 表示颜色(等价于游戏内的 §),& 在 YAML 里无需转义,但在 XML/HTML 里要写成 &。

代码颜色代码颜色代码样式
&0黑色&9蓝色&l粗体
&1深蓝&a绿色&o斜体
&2深绿&b青色&n下划线
&3深青&c红色&m删除线
&4深红&d粉色&k乱码字符
&5深紫&e黄色&r重置
&6金色&f白色
&7灰色&8深灰

这些代码在控制台日志里会被转换成 ANSI 颜色输出,因此启动信息在 Linux 终端下也是有颜色的。