Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/localization/english.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(super) const STRINGS: Strings = Strings {
update_available: "Update available",
update_prompt_now: "Version {version} is available. Do you want to update now?",
exit: "Exit",
show_widget: "Show Widget",
session_window: "5h",
weekly_window: "7d",
now: "now",
Expand Down
1 change: 1 addition & 0 deletions src/localization/french.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(super) const STRINGS: Strings = Strings {
update_available: "Mise à jour disponible",
update_prompt_now: "La version {version} est disponible. Voulez-vous mettre à jour maintenant ?",
exit: "Quitter",
show_widget: "Afficher le widget",
session_window: "5h",
weekly_window: "7d",
now: "maintenant",
Expand Down
1 change: 1 addition & 0 deletions src/localization/german.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(super) const STRINGS: Strings = Strings {
update_available: "Update verfügbar",
update_prompt_now: "Version {version} ist verfügbar. Möchten Sie jetzt aktualisieren?",
exit: "Beenden",
show_widget: "Widget anzeigen",
session_window: "5h",
weekly_window: "7d",
now: "jetzt",
Expand Down
1 change: 1 addition & 0 deletions src/localization/japanese.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(super) const STRINGS: Strings = Strings {
update_available: "更新が利用可能です",
update_prompt_now: "バージョン {version} が利用可能です。今すぐ更新しますか?",
exit: "終了",
show_widget: "ウィジェットを表示",
session_window: "5h",
weekly_window: "7d",
now: "今",
Expand Down
38 changes: 38 additions & 0 deletions src/localization/korean.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
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: "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: "5시간",
weekly_window: "7일",
now: "지금",
day_suffix: "일",
hour_suffix: "시간",
minute_suffix: "분",
second_suffix: "초",
};
11 changes: 10 additions & 1 deletion src/localization/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ mod english;
mod french;
mod german;
mod japanese;
mod korean;
mod spanish;

use windows::core::PWSTR;
Expand All @@ -17,15 +18,17 @@ pub enum LanguageId {
French,
German,
Japanese,
Korean,
}

impl LanguageId {
pub const ALL: [LanguageId; 5] = [
pub const ALL: [LanguageId; 6] = [
LanguageId::English,
LanguageId::Spanish,
LanguageId::French,
LanguageId::German,
LanguageId::Japanese,
LanguageId::Korean,
];

pub fn code(self) -> &'static str {
Expand All @@ -35,6 +38,7 @@ impl LanguageId {
Self::French => "fr",
Self::German => "de",
Self::Japanese => "ja",
Self::Korean => "ko",
}
}

Expand All @@ -45,6 +49,7 @@ impl LanguageId {
Self::French => "Français",
Self::German => "Deutsch",
Self::Japanese => "日本語",
Self::Korean => "한국어",
}
}

Expand All @@ -55,6 +60,7 @@ impl LanguageId {
Self::French => french::STRINGS,
Self::German => german::STRINGS,
Self::Japanese => japanese::STRINGS,
Self::Korean => korean::STRINGS,
}
}

Expand All @@ -65,6 +71,7 @@ impl LanguageId {
Self::French => french::UPDATE_VIA_WINGET_LABEL,
Self::German => german::UPDATE_VIA_WINGET_LABEL,
Self::Japanese => japanese::UPDATE_VIA_WINGET_LABEL,
Self::Korean => korean::UPDATE_VIA_WINGET_LABEL,
}
}

Expand All @@ -80,6 +87,7 @@ impl LanguageId {
"fr" => Some(Self::French),
"de" => Some(Self::German),
"ja" => Some(Self::Japanese),
"ko" => Some(Self::Korean),
_ => None,
}
}
Expand Down Expand Up @@ -111,6 +119,7 @@ pub struct Strings {
pub update_available: &'static str,
pub update_prompt_now: &'static str,
pub exit: &'static str,
pub show_widget: &'static str,
pub session_window: &'static str,
pub weekly_window: &'static str,
pub now: &'static str,
Expand Down
1 change: 1 addition & 0 deletions src/localization/spanish.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pub(super) const STRINGS: Strings = Strings {
update_available: "Actualización disponible",
update_prompt_now: "La versión {version} está disponible. ¿Quieres actualizar ahora?",
exit: "Salir",
show_widget: "Mostrar widget",
session_window: "5h",
weekly_window: "7d",
now: "ahora",
Expand Down
7 changes: 5 additions & 2 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ const IDM_LANG_SPANISH: u16 = 42;
const IDM_LANG_FRENCH: u16 = 43;
const IDM_LANG_GERMAN: u16 = 44;
const IDM_LANG_JAPANESE: u16 = 45;
const IDM_LANG_KOREAN: u16 = 46;

const DIVIDER_HIT_ZONE: i32 = 13; // LEFT_DIVIDER_W + DIVIDER_RIGHT_MARGIN

Expand Down Expand Up @@ -1817,14 +1818,15 @@ unsafe extern "system" fn wnd_proc(
SetTimer(hwnd, TIMER_POLL, new_interval, None);
}
IDM_LANG_SYSTEM | IDM_LANG_ENGLISH | IDM_LANG_SPANISH | IDM_LANG_FRENCH
| IDM_LANG_GERMAN | IDM_LANG_JAPANESE => {
| IDM_LANG_GERMAN | IDM_LANG_JAPANESE | IDM_LANG_KOREAN => {
let language_override = match id {
IDM_LANG_SYSTEM => None,
IDM_LANG_ENGLISH => Some(LanguageId::English),
IDM_LANG_SPANISH => Some(LanguageId::Spanish),
IDM_LANG_FRENCH => Some(LanguageId::French),
IDM_LANG_GERMAN => Some(LanguageId::German),
IDM_LANG_JAPANESE => Some(LanguageId::Japanese),
IDM_LANG_KOREAN => Some(LanguageId::Korean),
_ => None,
};
{
Expand Down Expand Up @@ -1991,6 +1993,7 @@ fn show_context_menu(hwnd: HWND) {
LanguageId::French => IDM_LANG_FRENCH,
LanguageId::German => IDM_LANG_GERMAN,
LanguageId::Japanese => IDM_LANG_JAPANESE,
LanguageId::Korean => IDM_LANG_KOREAN,
};
let label_str = native_interop::wide_str(language.native_name());
let flags = if language_override == Some(language) {
Expand Down Expand Up @@ -2040,7 +2043,7 @@ fn show_context_menu(hwnd: HWND) {
PCWSTR::from_raw(settings_label.as_ptr()),
);

let widget_label = native_interop::wide_str("Show Widget");
let widget_label = native_interop::wide_str(strings.show_widget);
let widget_flags = if widget_visible { MF_CHECKED } else { MENU_ITEM_FLAGS(0) };
let _ = AppendMenuW(
menu,
Expand Down