mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-30 20:14:23 +00:00
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:
12
assets/translations/zh_cn.json
Normal file
12
assets/translations/zh_cn.json
Normal 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": "点击以打开网页。"
|
||||
}
|
||||
@@ -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)
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user