Added some Simplified Chinese translations. (#1129)

* Added some Simplified Chinese translations.

This is my first Pumpkin PR, and it means the world to me. (≧∇≦)🎃

* Added Simplified Chinese

* Added Simplified Chinese
This commit is contained in:
Missing_Love
2025-08-16 23:23:49 +08:00
committed by GitHub
parent 4205befa5d
commit b741881729
2 changed files with 18 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
{
"commands.pumpkin.version": "Pumpkin %s\n",
"commands.pumpkin.description": "赋予每个人托管快速高效的 \nMinecraft 服务器的能力。\n",
"commands.pumpkin.minecraft_version": "(Minecraft %1$s, 协议 %2$s)\n",
"commands.pumpkin.github": "[GitHub 仓库]",
"commands.pumpkin.website": "[网页]",
"commands.pumpkin.version.hover": "点击以复制版本。",
"commands.pumpkin.description.hover": "点击以复制描述。",
"commands.pumpkin.minecraft_version.hover": "点击以复制 Minecraft 的版本。",
"commands.pumpkin.github.hover": "点击以打开仓库。",
"commands.pumpkin.website.hover": "点击以打开网页。"
}

View File

@@ -17,6 +17,7 @@ use crate::text::{TextComponentBase, TextContent, style::Style};
static VANILLA_EN_US_JSON: &str = include_str!("../../assets/en_us.json");
static PUMPKIN_EN_US_JSON: &str = include_str!("../../assets/translations/en_us.json");
static PUMPKIN_ES_ES_JSON: &str = include_str!("../../assets/translations/es_es.json");
static PUMPKIN_ZH_CN_JSON: &str = include_str!("../../assets/translations/zh_cn.json");
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, Hash)]
pub struct SubstitutionRange {
@@ -188,6 +189,8 @@ pub static TRANSLATIONS: LazyLock<Mutex<[HashMap<String, String>; Locale::last()
serde_json::from_str(PUMPKIN_EN_US_JSON).expect("Could not parse en_us.json.");
let pumpkin_es_es: HashMap<String, String> =
serde_json::from_str(PUMPKIN_ES_ES_JSON).expect("Could not parse es_es.json.");
let pumpkin_zh_cn: HashMap<String, String> =
serde_json::from_str(PUMPKIN_ZH_CN_JSON).expect("Could not parse zh_cn.json.");
for (key, value) in vanilla_en_us {
array[Locale::EnUs as usize].insert(format!("minecraft:{key}"), value);
@@ -198,6 +201,9 @@ pub static TRANSLATIONS: LazyLock<Mutex<[HashMap<String, String>; Locale::last()
for (key, value) in pumpkin_es_es {
array[Locale::EsEs as usize].insert(format!("pumpkin:{key}"), value);
}
for (key, value) in pumpkin_zh_cn {
array[Locale::ZhCn as usize].insert(format!("pumpkin:{key}"), value);
}
Mutex::new(array)
});