From 09f7daf5cb8b591041737f339df65516593ce272 Mon Sep 17 00:00:00 2001 From: CrazyHPi Date: Wed, 18 Feb 2026 13:47:20 +0800 Subject: [PATCH 1/4] add Chinese translation --- locales/zh.json | 82 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 locales/zh.json diff --git a/locales/zh.json b/locales/zh.json new file mode 100644 index 0000000..a815517 --- /dev/null +++ b/locales/zh.json @@ -0,0 +1,82 @@ +{ + "_version": 1, + "language_name": "中文", + "gui.ui.title": "Ornithe 安装器", + "gui.ui.language": "语言: ", + "gui.error.no_available_minecraft_versions":"无法找到可用的 Minecraft 版本。请确保你已连接到互联网!", + "gui.ui.button.pick_location":"选择安装位置", + "gui.ui.environment":"环境", + "gui.ui.minecraft_version":"Minecraft 版本", + "gui.ui.search_available_versions":"搜索可用版本...", + "gui.ui.checkbox.snapshots": "快照版", + "gui.ui.checkbox.historical":"历史版本", + "gui.ui.loader":"加载器", + "gui.ui.selection.loader.name":"%{name} 加载器", + "gui.ui.loader_version":"版本:", + "gui.error.installation_failed": "安装失败", + "gui.error.no_supported_minecraft_version_selected":"未选择任何受支持的 Minecraft 版本", + "gui.error.failed_to_install":"安装失败:%{error}", + "gui.dialog.installation_successful": "安装成功", + "gui.dialog.installation_successful.message": "已成功安装 Ornithe。\n多数模组需要安装Ornithe Standard Libraries并放置在mods文件夹中。\n你现在想要打开OSL的modrinth网站吗?", + "gui.error.failed_to_open_modrinth": "无法打开modrinth网站", + "gui.error.failed_to_open_modrinth.message": "打开OSL的modrinth网站.\n你可以在这里找到它: %{osl_url}", + "gui.checkbox.generate_profile": "生成启动器配置文件", + "gui.checkbox.download_minecraft_server": "下载 Minecraft 服务器", + "gui.checkbox.copy_profile_path": "复制配置文件路径到剪贴板", + "gui.checkbox.generate_instance_zip": "生成实例压缩包", + "gui.error.no_matching_intermediary_version": "无法找到 intermediary 对应的版本: %{version}", + "gui.ui.output": "输出", + "gui.button.back": "返回", + "gui.ui.output_location":"输出位置", + "gui.ui.install_location": "安装位置", + "gui.button.install": "安装", + "gui.error.generic": "Ornithe 安装器错误", + "gui.mode.client": "客户端(官方启动器)", + "gui.mode.mmc": "MultiMC/PrismLauncher", + "gui.mode.server": "服务端", + "gui.ui.show_loader_betas": "显示 Beta 版本", + "client.error.directory_does_not_exist": "目录: %{dir} 不存在。请确保你选择了正确的文件夹并且至少启动过一次游戏。", + "client.info.installation_start": "正在安装 Minecraft %{version} 的客户端和 %{loader} %{loader_version} 加载器到 %{destination}", + "client.info.fetching_launch_jsons": "正在获取启动 JSON...", + "client.info.setting_up_destination": "正在设置安装目的地...", + "client.info.creating_files": "正在创建文件...", + "client.info.done": "已完成!", + "client.error.could_not_find_launcher_profiles_json": "无法找到 launcher_profiles json!", + "client.error.invalid_launcher_profiles_json": "无效的 launcher_profiles.json 文件!", + "client.error.profiles_not_an_object": "\"profiles\" 字段必须是一个对象!", + "client.error.cannot_update_profile": "无法更新 %{name} 的配置因为它不是一个对象!", + "client.error.failed_to_parse_launcher_profiles_json": "解析 launcher_profiles.json 失败", + "client.error.failed_to_read_launcher_profiles_json": "无法读取 launcher_profiles.json", + "mmc.info.starting_installation": "正在生成 MMC/Prism 实例:Minecraft %{version} 和 %{loader} %{loader_version} 加载器到 %{destination}", + "mmc.info.fetching_version_information": "正在获取版本信息...", + "mmc.info.transforming_templates": "正在转换模板...", + "mmc.info.fetching_library_information": "获取依赖库信息中...", + "mmc.info.found_library_upgrades":"找到 %{num_libraries} 个库升级!", + "mmc.info.generating_instance_zip":"正在生成实例压缩包...", + "mmc.info.generating_output_files":"正在生成输出文件...", + "mmc.info.adding_library_components":"正在添加库组件...", + "mmc.info.done":"已完成!", + "mmc.error.failed_to_retrieve_intermediary_coordinates": "获取 intermediary maven 仓库位置失败", + "mmc.error.instance_already_exists":"实例已经存在", + "mmc.error.failed_to_copy_path": "复制配置路径失败", + "server.info.installed":"已安装 Minecraft %{version} Ornithe 服务端和 %{loader} %{loader_version} 加载器到 %{destination}", + "server.info.starting_installation":"正在安装 Minecraft %{version} Ornithe服务端和 %{loader} %{loader_version} 加载器到 %{destination}", + "server.info.installing_libraries":"正在安装库...", + "server.info.downloaded_library":"已下载 %{name}, %{num}/%{lib_count}", + "server.info.downloaded_libraries":"已下载 %{lib_count} 个库!", + "server.info.downloading_server_jar":"正在下载服务端 jar...", + "server.info.launching":"启动服务器中...", + "server.error.wrong_type_from_endpoint":"由于服务器终点返回的类型错误,无法创建服务器安装。", + "server.error.could_not_find_main_class_entry":"无法找到主类入口", + "server.error.no_libraries":"没有指定库需要安装!", + "server.error.no_library_name":"库没有名称!", + "server.error.no_library_url":"库没有url!", + "server.error.library_failed":"下载库失败:%{error}", + "server.error.libraries_failed":"下载库失败:%{error}", + "server.error.failed_to_find_manifest_attribute":"无法在 jar manifest 中找到:'%{attribute}' !", + "meta.error.launch_json_no_id": "启动json中没有 'id' 键!", + "manifest.error.failed_to_deserialize": "无法将 %{error} 反序列化为字符串", + "manifest.error.fetching_launch_json": "从manifest获取启动json时发生错误", + "manifest.error.no_download_for_version": "%{side} 没有对应版本的下载链接", + "manifest.error.no_lwjgl": "找不到 Minecraft %{mc_version} 对应的 lwjgl 版本" +} \ No newline at end of file From 67a6841bed74e477184d1022d738bce4c6387d9c Mon Sep 17 00:00:00 2001 From: CrazyHPi Date: Wed, 18 Feb 2026 16:25:45 +0800 Subject: [PATCH 2/4] add support for chinese font/character --- Cargo.lock | 13 +++++++++++-- Cargo.toml | 1 + src/ui/gui.rs | 10 +++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index fc56480..73cf3c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1067,6 +1067,14 @@ dependencies = [ "unicode-segmentation", ] +[[package]] +name = "egui-chinese-font" +version = "0.2.1" +source = "git+https://github.com/CrazyHPi/egui-chinese-font.git?tag=v0.2.1#1e81a3feb770b7d270d7aaaa7aadca33209da4a4" +dependencies = [ + "egui", +] + [[package]] name = "egui-wgpu" version = "0.33.3" @@ -2896,6 +2904,7 @@ dependencies = [ "current_locale", "eframe", "egui", + "egui-chinese-font", "embed-resource", "env_logger", "indicatif", @@ -4342,9 +4351,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.20.0" +version = "1.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" +checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" dependencies = [ "js-sys", "serde_core", diff --git a/Cargo.toml b/Cargo.toml index 98019cd..3ad84d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,6 +14,7 @@ clap = { version = "4.5.35", features = ["cargo", "derive", "string"] } current_locale = { version = "0.1.1", optional = true } eframe = { version = "0.33.2", features = ["wgpu"], optional = true } egui = { version = "0.33.2", optional = true } +egui-chinese-font = { git = "https://github.com/CrazyHPi/egui-chinese-font.git", tag = "v0.2.1" } env_logger = "0.11.8" indicatif = { version = "0.18.3", features = ["improved_unicode"] } log = "0.4.27" diff --git a/src/ui/gui.rs b/src/ui/gui.rs index 85403b0..ea17ade 100644 --- a/src/ui/gui.rs +++ b/src/ui/gui.rs @@ -31,6 +31,8 @@ use egui::{ }; use std::hash::Hash; +use egui_chinese_font::setup_only_chinese_fonts; + #[derive(PartialEq, Clone, Copy, Debug)] enum Mode { Client, @@ -80,7 +82,13 @@ async fn create_window() -> Result<(), InstallerError> { eframe::run_native( &("Ornithe Installer ".to_owned() + crate::VERSION), options, - Box::new(|_cc| Ok(Box::new(app))), + Box::new(|_cc| { + // setup chinese font + // only replace font for chinese char + setup_only_chinese_fonts(&_cc.egui_ctx).expect("Failed to load Chinese fonts"); + + Ok(Box::new(app)) + }), )?; Ok(()) } From 8bf7cc74eb3814f3e73ab6296b28b9cca12fe517 Mon Sep 17 00:00:00 2001 From: CrazyHPi Date: Thu, 19 Feb 2026 23:20:28 +0800 Subject: [PATCH 3/4] Revert "add support for chinese font/character" This reverts commit 67a6841bed74e477184d1022d738bce4c6387d9c. --- Cargo.lock | 13 ++----------- Cargo.toml | 1 - src/ui/gui.rs | 10 +--------- 3 files changed, 3 insertions(+), 21 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 73cf3c3..fc56480 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1067,14 +1067,6 @@ dependencies = [ "unicode-segmentation", ] -[[package]] -name = "egui-chinese-font" -version = "0.2.1" -source = "git+https://github.com/CrazyHPi/egui-chinese-font.git?tag=v0.2.1#1e81a3feb770b7d270d7aaaa7aadca33209da4a4" -dependencies = [ - "egui", -] - [[package]] name = "egui-wgpu" version = "0.33.3" @@ -2904,7 +2896,6 @@ dependencies = [ "current_locale", "eframe", "egui", - "egui-chinese-font", "embed-resource", "env_logger", "indicatif", @@ -4351,9 +4342,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.21.0" +version = "1.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b672338555252d43fd2240c714dc444b8c6fb0a5c5335e65a07bba7742735ddb" +checksum = "ee48d38b119b0cd71fe4141b30f5ba9c7c5d9f4e7a3a8b4a674e4b6ef789976f" dependencies = [ "js-sys", "serde_core", diff --git a/Cargo.toml b/Cargo.toml index 3ad84d5..98019cd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,6 @@ clap = { version = "4.5.35", features = ["cargo", "derive", "string"] } current_locale = { version = "0.1.1", optional = true } eframe = { version = "0.33.2", features = ["wgpu"], optional = true } egui = { version = "0.33.2", optional = true } -egui-chinese-font = { git = "https://github.com/CrazyHPi/egui-chinese-font.git", tag = "v0.2.1" } env_logger = "0.11.8" indicatif = { version = "0.18.3", features = ["improved_unicode"] } log = "0.4.27" diff --git a/src/ui/gui.rs b/src/ui/gui.rs index ea17ade..85403b0 100644 --- a/src/ui/gui.rs +++ b/src/ui/gui.rs @@ -31,8 +31,6 @@ use egui::{ }; use std::hash::Hash; -use egui_chinese_font::setup_only_chinese_fonts; - #[derive(PartialEq, Clone, Copy, Debug)] enum Mode { Client, @@ -82,13 +80,7 @@ async fn create_window() -> Result<(), InstallerError> { eframe::run_native( &("Ornithe Installer ".to_owned() + crate::VERSION), options, - Box::new(|_cc| { - // setup chinese font - // only replace font for chinese char - setup_only_chinese_fonts(&_cc.egui_ctx).expect("Failed to load Chinese fonts"); - - Ok(Box::new(app)) - }), + Box::new(|_cc| Ok(Box::new(app))), )?; Ok(()) } From aff9f250df64d2f39cb5b3b8b3b0a52a531eaa02 Mon Sep 17 00:00:00 2001 From: CrazyHPi Date: Thu, 19 Feb 2026 23:54:08 +0800 Subject: [PATCH 4/4] rename simplified chinese translation file --- locales/{zh.json => zh-CN.json} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename locales/{zh.json => zh-CN.json} (100%) diff --git a/locales/zh.json b/locales/zh-CN.json similarity index 100% rename from locales/zh.json rename to locales/zh-CN.json