mirror of
https://github.com/CodeZeno/Claude-Code-Usage-Monitor.git
synced 2026-06-20 10:19:27 +08:00
Add files via upload
This commit is contained in:
parent
a407f69453
commit
494484acf9
@ -35,4 +35,7 @@ pub(super) const STRINGS: Strings = Strings {
|
||||
hour_suffix: "h",
|
||||
minute_suffix: "m",
|
||||
second_suffix: "s",
|
||||
quiet_hours: "Quiet Hours",
|
||||
quiet_start: "Start",
|
||||
quiet_end: "End",
|
||||
};
|
||||
|
||||
@ -35,4 +35,7 @@ pub(super) const STRINGS: Strings = Strings {
|
||||
hour_suffix: "h",
|
||||
minute_suffix: "m",
|
||||
second_suffix: "s",
|
||||
quiet_hours: "Quiet Hours",
|
||||
quiet_start: "Start",
|
||||
quiet_end: "End",
|
||||
};
|
||||
|
||||
@ -35,4 +35,7 @@ pub(super) const STRINGS: Strings = Strings {
|
||||
hour_suffix: "h",
|
||||
minute_suffix: "m",
|
||||
second_suffix: "s",
|
||||
quiet_hours: "Quiet Hours",
|
||||
quiet_start: "Start",
|
||||
quiet_end: "End",
|
||||
};
|
||||
|
||||
@ -35,4 +35,7 @@ pub(super) const STRINGS: Strings = Strings {
|
||||
hour_suffix: "時間",
|
||||
minute_suffix: "分",
|
||||
second_suffix: "秒",
|
||||
quiet_hours: "サイレント時間",
|
||||
quiet_start: "開始",
|
||||
quiet_end: "終了",
|
||||
};
|
||||
|
||||
@ -35,4 +35,7 @@ pub(super) const STRINGS: Strings = Strings {
|
||||
hour_suffix: "시간",
|
||||
minute_suffix: "분",
|
||||
second_suffix: "초",
|
||||
quiet_hours: "조용한 시간",
|
||||
quiet_start: "시작",
|
||||
quiet_end: "종료",
|
||||
};
|
||||
|
||||
@ -4,6 +4,7 @@ mod german;
|
||||
mod japanese;
|
||||
mod korean;
|
||||
mod spanish;
|
||||
mod traditional_chinese;
|
||||
|
||||
use windows::core::PWSTR;
|
||||
use windows::Win32::Globalization::{
|
||||
@ -19,16 +20,18 @@ pub enum LanguageId {
|
||||
German,
|
||||
Japanese,
|
||||
Korean,
|
||||
TraditionalChinese,
|
||||
}
|
||||
|
||||
impl LanguageId {
|
||||
pub const ALL: [LanguageId; 6] = [
|
||||
pub const ALL: [LanguageId; 7] = [
|
||||
LanguageId::English,
|
||||
LanguageId::Spanish,
|
||||
LanguageId::French,
|
||||
LanguageId::German,
|
||||
LanguageId::Japanese,
|
||||
LanguageId::Korean,
|
||||
LanguageId::TraditionalChinese,
|
||||
];
|
||||
|
||||
pub fn code(self) -> &'static str {
|
||||
@ -39,6 +42,7 @@ impl LanguageId {
|
||||
Self::German => "de",
|
||||
Self::Japanese => "ja",
|
||||
Self::Korean => "ko",
|
||||
Self::TraditionalChinese => "zh-TW",
|
||||
}
|
||||
}
|
||||
|
||||
@ -50,6 +54,7 @@ impl LanguageId {
|
||||
Self::German => "Deutsch",
|
||||
Self::Japanese => "日本語",
|
||||
Self::Korean => "한국어",
|
||||
Self::TraditionalChinese => "繁體中文",
|
||||
}
|
||||
}
|
||||
|
||||
@ -61,6 +66,7 @@ impl LanguageId {
|
||||
Self::German => german::STRINGS,
|
||||
Self::Japanese => japanese::STRINGS,
|
||||
Self::Korean => korean::STRINGS,
|
||||
Self::TraditionalChinese => traditional_chinese::STRINGS,
|
||||
}
|
||||
}
|
||||
|
||||
@ -72,6 +78,7 @@ impl LanguageId {
|
||||
Self::German => german::UPDATE_VIA_WINGET_LABEL,
|
||||
Self::Japanese => japanese::UPDATE_VIA_WINGET_LABEL,
|
||||
Self::Korean => korean::UPDATE_VIA_WINGET_LABEL,
|
||||
Self::TraditionalChinese => traditional_chinese::UPDATE_VIA_WINGET_LABEL,
|
||||
}
|
||||
}
|
||||
|
||||
@ -81,13 +88,26 @@ impl LanguageId {
|
||||
return None;
|
||||
}
|
||||
|
||||
match normalized.split('-').next().unwrap_or_default() {
|
||||
let prefix = normalized.split('-').next().unwrap_or_default();
|
||||
match prefix {
|
||||
"en" => Some(Self::English),
|
||||
"es" => Some(Self::Spanish),
|
||||
"fr" => Some(Self::French),
|
||||
"de" => Some(Self::German),
|
||||
"ja" => Some(Self::Japanese),
|
||||
"ko" => Some(Self::Korean),
|
||||
"zh" => {
|
||||
// 細分繁體(zh-TW、zh-HK、zh-Hant)與簡體
|
||||
if normalized.contains("tw")
|
||||
|| normalized.contains("hk")
|
||||
|| normalized.contains("hant")
|
||||
{
|
||||
Some(Self::TraditionalChinese)
|
||||
} else {
|
||||
// 簡體中文目前不支援,fallback 至系統語言
|
||||
None
|
||||
}
|
||||
}
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
@ -127,6 +147,9 @@ pub struct Strings {
|
||||
pub hour_suffix: &'static str,
|
||||
pub minute_suffix: &'static str,
|
||||
pub second_suffix: &'static str,
|
||||
pub quiet_hours: &'static str,
|
||||
pub quiet_start: &'static str,
|
||||
pub quiet_end: &'static str,
|
||||
}
|
||||
|
||||
pub fn resolve_language(language_override: Option<LanguageId>) -> LanguageId {
|
||||
|
||||
@ -35,4 +35,7 @@ pub(super) const STRINGS: Strings = Strings {
|
||||
hour_suffix: "h",
|
||||
minute_suffix: "m",
|
||||
second_suffix: "s",
|
||||
quiet_hours: "Quiet Hours",
|
||||
quiet_start: "Start",
|
||||
quiet_end: "End",
|
||||
};
|
||||
|
||||
41
src/localization/traditional_chinese.rs
Normal file
41
src/localization/traditional_chinese.rs
Normal file
@ -0,0 +1,41 @@
|
||||
use super::Strings;
|
||||
|
||||
pub(super) const UPDATE_VIA_WINGET_LABEL: &str = "透過 WinGet 更新";
|
||||
|
||||
pub(super) const STRINGS: Strings = Strings {
|
||||
window_title: "Claude Code 使用量監控",
|
||||
refresh: "重新整理",
|
||||
update_frequency: "更新頻率",
|
||||
one_minute: "1 分鐘",
|
||||
five_minutes: "5 分鐘",
|
||||
fifteen_minutes: "15 分鐘",
|
||||
one_hour: "1 小時",
|
||||
settings: "設定",
|
||||
start_with_windows: "開機時啟動",
|
||||
reset_position: "重置位置",
|
||||
language: "語言",
|
||||
system_default: "系統預設",
|
||||
check_for_updates: "檢查更新",
|
||||
checking_for_updates: "正在檢查更新...",
|
||||
updates: "更新",
|
||||
update_in_progress: "已有更新檢查正在進行中。",
|
||||
up_to_date: "您已使用最新版本。",
|
||||
up_to_date_short: "已是最新",
|
||||
update_failed: "無法自動更新",
|
||||
applying_update: "正在套用更新...",
|
||||
update_to: "更新至",
|
||||
update_available: "有可用更新",
|
||||
update_prompt_now: "版本 {version} 已可用。是否立即更新?",
|
||||
exit: "結束",
|
||||
show_widget: "顯示小工具",
|
||||
session_window: "5h",
|
||||
weekly_window: "7d",
|
||||
now: "現在",
|
||||
day_suffix: "天",
|
||||
hour_suffix: "時",
|
||||
minute_suffix: "分",
|
||||
second_suffix: "秒",
|
||||
quiet_hours: "安靜時刻",
|
||||
quiet_start: "開始時間",
|
||||
quiet_end: "結束時間",
|
||||
};
|
||||
Loading…
x
Reference in New Issue
Block a user