From cf5b6c07417be9fee95aeae961cc305b702dad4b Mon Sep 17 00:00:00 2001 From: caduaraxa Date: Wed, 10 Jun 2026 17:10:37 -0300 Subject: [PATCH 1/5] Add new translation file for PT-BR (Brazilian Portuguese) --- .gitignore | 1 + src/localization/portuguese_brazil.rs | 46 +++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 src/localization/portuguese_brazil.rs diff --git a/.gitignore b/.gitignore index 0475229..2d0c3ba 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ # IDE .idea/ .vscode/ +.history/ *.swp *.swo *~ diff --git a/src/localization/portuguese_brazil.rs b/src/localization/portuguese_brazil.rs new file mode 100644 index 0000000..1576e06 --- /dev/null +++ b/src/localization/portuguese_brazil.rs @@ -0,0 +1,46 @@ +use super::Strings; + +pub(super) const UPDATE_VIA_WINGET_LABEL: &str = "Atualizar via WinGet"; + +pub(super) const STRINGS: Strings = Strings { + window_title: "Monitor de Uso do Claude Code", + refresh: "Atualizar", + update_frequency: "Frequência de Atualização", + one_minute: "1 Minuto", + five_minutes: "5 Minutos", + fifteen_minutes: "15 Minutos", + one_hour: "1 Hora", + models: "Modelos", + claude_code_model: "Claude Code", + codex_model: "Codex", + settings: "Configurações", + start_with_windows: "Iniciar com o Windows", + reset_position: "Redefinir Posição", + language: "Idioma", + system_default: "Padrão do Sistema", + check_for_updates: "Busca atualizações", + checking_for_updates: "Buscando por atualizações...", + updates: "Atualizações", + update_in_progress: "Uma verificação de atualização já está em andamento.", + up_to_date: "Você já tem a versão mais recente.", + up_to_date_short: "Atualizado", + update_failed: "Não foi possível atualizar automaticamente", + applying_update: "Aplicando atualização...", + update_to: "Atualizar para", + update_available: "Atualização disponível", + update_prompt_now: "Versão {version} está disponível. Deseja atualizar agora?", + exit: "Sair", + show_widget: "Exibir Widget", + session_window: "5h", + weekly_window: "7d", + now: "agora", + day_suffix: "d", + hour_suffix: "h", + minute_suffix: "m", + token_expired_title: "Erro de Autenticação do Claude Code", + token_expired_body: "Execute 'claude' em um terminal, use '/login' e siga as instruções. Depois disso, atualize ou reinicie este aplicativo.", + codex_token_expired_title: "Erro de Autenticação do Codex", + codex_token_expired_body: "Execute 'codex' em um terminal e siga as instruções de login. Depois disso, atualize ou reinicie este aplicativo.", + codex_window_title: "Monitor de uso do Codex", + second_suffix: "s", +}; From 374d94fac2ebea0a93eaac68c5344f6a70264b88 Mon Sep 17 00:00:00 2001 From: Craig Constable Date: Fri, 12 Jun 2026 19:37:31 +1000 Subject: [PATCH 2/5] fix: wire up Russian in language menu command handler The PR added IDM_LANG_RUSSIAN to the context menu but not to the WM_COMMAND handler, so selecting it did nothing. Also reorder second_suffix to match the Strings field order used by the other language files. Co-Authored-By: Claude Fable 5 --- src/localization/mod.rs | 2 +- src/localization/russian.rs | 2 +- src/window.rs | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/localization/mod.rs b/src/localization/mod.rs index 3b7f577..962883c 100644 --- a/src/localization/mod.rs +++ b/src/localization/mod.rs @@ -120,7 +120,7 @@ impl LanguageId { } else { None } - }, + } "ru" => Some(Self::Russian), _ => None, } diff --git a/src/localization/russian.rs b/src/localization/russian.rs index 6a445b8..786d0fa 100644 --- a/src/localization/russian.rs +++ b/src/localization/russian.rs @@ -37,10 +37,10 @@ pub(super) const STRINGS: Strings = Strings { day_suffix: "д", hour_suffix: "ч", minute_suffix: "м", + second_suffix: "с", token_expired_title: "Ошибка авторизации Claude Code", token_expired_body: "Запустите 'claude' в терминале, затем используйте '/login' и следуйте инструкциям. После этого обновите или перезапустите приложение.", codex_token_expired_title: "Ошибка авторизации Codex", codex_token_expired_body: "Запустите 'codex' в терминале и следуйте инструкциям для входа. После этого обновите или перезапустите приложение.", codex_window_title: "Монитор использования Codex", - second_suffix: "с", }; \ No newline at end of file diff --git a/src/window.rs b/src/window.rs index abf9292..3981aaa 100644 --- a/src/window.rs +++ b/src/window.rs @@ -2259,7 +2259,8 @@ unsafe extern "system" fn wnd_proc( | IDM_LANG_GERMAN | IDM_LANG_JAPANESE | IDM_LANG_KOREAN - | IDM_LANG_TRADITIONAL_CHINESE => { + | IDM_LANG_TRADITIONAL_CHINESE + | IDM_LANG_RUSSIAN => { let language_override = match id { IDM_LANG_SYSTEM => None, IDM_LANG_ENGLISH => Some(LanguageId::English), @@ -2270,6 +2271,7 @@ unsafe extern "system" fn wnd_proc( IDM_LANG_JAPANESE => Some(LanguageId::Japanese), IDM_LANG_KOREAN => Some(LanguageId::Korean), IDM_LANG_TRADITIONAL_CHINESE => Some(LanguageId::TraditionalChinese), + IDM_LANG_RUSSIAN => Some(LanguageId::Russian), _ => None, }; { @@ -2481,7 +2483,7 @@ fn show_context_menu(hwnd: HWND) { LanguageId::Japanese => IDM_LANG_JAPANESE, LanguageId::Korean => IDM_LANG_KOREAN, LanguageId::TraditionalChinese => IDM_LANG_TRADITIONAL_CHINESE, - LanguageId::Russian => IDM_LANG_RUSSIAN + LanguageId::Russian => IDM_LANG_RUSSIAN, }; let label_str = native_interop::wide_str(language.native_name()); let flags = if language_override == Some(language) { From 286dd89a67a154ee493441bbd86964c958610547 Mon Sep 17 00:00:00 2001 From: Craig Constable Date: Fri, 12 Jun 2026 19:39:35 +1000 Subject: [PATCH 3/5] v1.4.2 - Add Russian localization - Thanks to @st7105 for the contribution in PR #28 Co-Authored-By: Claude Fable 5 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6ac3321..e677df6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,7 +38,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "claude-code-usage-monitor" -version = "1.4.1" +version = "1.4.2" dependencies = [ "dirs", "native-tls", diff --git a/Cargo.toml b/Cargo.toml index f89b125..c7275fa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "claude-code-usage-monitor" -version = "1.4.1" +version = "1.4.2" edition = "2021" license = "MIT" description = "Claude Code Usage Monitor" From c1056a4bd3964671a1ee3db15f074a7d92202504 Mon Sep 17 00:00:00 2001 From: Craig Constable Date: Fri, 12 Jun 2026 19:53:19 +1000 Subject: [PATCH 4/5] feat: wire up Brazilian Portuguese language support The PR added the translation file only; register it in the localization module (enum, codes, native name, string lookups, pt locale detection) and add the context menu entry and command handler. Also trim trailing whitespace and align field order with the other language files. Co-Authored-By: Claude Fable 5 --- src/localization/mod.rs | 10 +++++++++- src/localization/portuguese_brazil.rs | 28 +++++++++++++-------------- src/window.rs | 6 +++++- 3 files changed, 28 insertions(+), 16 deletions(-) diff --git a/src/localization/mod.rs b/src/localization/mod.rs index 962883c..39ee702 100644 --- a/src/localization/mod.rs +++ b/src/localization/mod.rs @@ -7,6 +7,7 @@ mod korean; mod spanish; mod traditional_chinese; mod russian; +mod portuguese_brazil; use windows::core::PWSTR; use windows::Win32::Globalization::{ @@ -25,10 +26,11 @@ pub enum LanguageId { Korean, TraditionalChinese, Russian, + PortugueseBrazil, } impl LanguageId { - pub const ALL: [LanguageId; 9] = [ + pub const ALL: [LanguageId; 10] = [ LanguageId::English, LanguageId::Dutch, LanguageId::Spanish, @@ -38,6 +40,7 @@ impl LanguageId { LanguageId::Korean, LanguageId::TraditionalChinese, LanguageId::Russian, + LanguageId::PortugueseBrazil, ]; pub fn code(self) -> &'static str { @@ -51,6 +54,7 @@ impl LanguageId { Self::Korean => "ko", Self::TraditionalChinese => "zh-TW", Self::Russian => "ru", + Self::PortugueseBrazil => "pt-BR", } } @@ -65,6 +69,7 @@ impl LanguageId { Self::Korean => "한국어", Self::TraditionalChinese => "繁體中文", Self::Russian => "Русский", + Self::PortugueseBrazil => "Português (Brasil)", } } @@ -79,6 +84,7 @@ impl LanguageId { Self::Korean => korean::STRINGS, Self::TraditionalChinese => traditional_chinese::STRINGS, Self::Russian => russian::STRINGS, + Self::PortugueseBrazil => portuguese_brazil::STRINGS, } } @@ -93,6 +99,7 @@ impl LanguageId { Self::Korean => korean::UPDATE_VIA_WINGET_LABEL, Self::TraditionalChinese => traditional_chinese::UPDATE_VIA_WINGET_LABEL, Self::Russian => russian::UPDATE_VIA_WINGET_LABEL, + Self::PortugueseBrazil => portuguese_brazil::UPDATE_VIA_WINGET_LABEL, } } @@ -122,6 +129,7 @@ impl LanguageId { } } "ru" => Some(Self::Russian), + "pt" => Some(Self::PortugueseBrazil), _ => None, } } diff --git a/src/localization/portuguese_brazil.rs b/src/localization/portuguese_brazil.rs index 1576e06..691ee77 100644 --- a/src/localization/portuguese_brazil.rs +++ b/src/localization/portuguese_brazil.rs @@ -5,7 +5,7 @@ pub(super) const UPDATE_VIA_WINGET_LABEL: &str = "Atualizar via WinGet"; pub(super) const STRINGS: Strings = Strings { window_title: "Monitor de Uso do Claude Code", refresh: "Atualizar", - update_frequency: "Frequência de Atualização", + update_frequency: "Frequência de Atualização", one_minute: "1 Minuto", five_minutes: "5 Minutos", fifteen_minutes: "15 Minutos", @@ -15,18 +15,18 @@ pub(super) const STRINGS: Strings = Strings { codex_model: "Codex", settings: "Configurações", start_with_windows: "Iniciar com o Windows", - reset_position: "Redefinir Posição", + reset_position: "Redefinir Posição", language: "Idioma", - system_default: "Padrão do Sistema", + system_default: "Padrão do Sistema", check_for_updates: "Busca atualizações", checking_for_updates: "Buscando por atualizações...", updates: "Atualizações", - update_in_progress: "Uma verificação de atualização já está em andamento.", - up_to_date: "Você já tem a versão mais recente.", - up_to_date_short: "Atualizado", - update_failed: "Não foi possível atualizar automaticamente", - applying_update: "Aplicando atualização...", - update_to: "Atualizar para", + update_in_progress: "Uma verificação de atualização já está em andamento.", + up_to_date: "Você já tem a versão mais recente.", + up_to_date_short: "Atualizado", + update_failed: "Não foi possível atualizar automaticamente", + applying_update: "Aplicando atualização...", + update_to: "Atualizar para", update_available: "Atualização disponível", update_prompt_now: "Versão {version} está disponível. Deseja atualizar agora?", exit: "Sair", @@ -37,10 +37,10 @@ pub(super) const STRINGS: Strings = Strings { day_suffix: "d", hour_suffix: "h", minute_suffix: "m", - token_expired_title: "Erro de Autenticação do Claude Code", - token_expired_body: "Execute 'claude' em um terminal, use '/login' e siga as instruções. Depois disso, atualize ou reinicie este aplicativo.", - codex_token_expired_title: "Erro de Autenticação do Codex", - codex_token_expired_body: "Execute 'codex' em um terminal e siga as instruções de login. Depois disso, atualize ou reinicie este aplicativo.", - codex_window_title: "Monitor de uso do Codex", second_suffix: "s", + token_expired_title: "Erro de Autenticação do Claude Code", + token_expired_body: "Execute 'claude' em um terminal, use '/login' e siga as instruções. Depois disso, atualize ou reinicie este aplicativo.", + codex_token_expired_title: "Erro de Autenticação do Codex", + codex_token_expired_body: "Execute 'codex' em um terminal e siga as instruções de login. Depois disso, atualize ou reinicie este aplicativo.", + codex_window_title: "Monitor de uso do Codex", }; diff --git a/src/window.rs b/src/window.rs index 3981aaa..7ce1dea 100644 --- a/src/window.rs +++ b/src/window.rs @@ -120,6 +120,7 @@ const IDM_LANG_JAPANESE: u16 = 46; const IDM_LANG_KOREAN: u16 = 47; const IDM_LANG_TRADITIONAL_CHINESE: u16 = 48; const IDM_LANG_RUSSIAN: u16 = 49; +const IDM_LANG_PORTUGUESE_BRAZIL: u16 = 50; const IDM_MODEL_CLAUDE_CODE: u16 = 60; const IDM_MODEL_CODEX: u16 = 61; @@ -2260,7 +2261,8 @@ unsafe extern "system" fn wnd_proc( | IDM_LANG_JAPANESE | IDM_LANG_KOREAN | IDM_LANG_TRADITIONAL_CHINESE - | IDM_LANG_RUSSIAN => { + | IDM_LANG_RUSSIAN + | IDM_LANG_PORTUGUESE_BRAZIL => { let language_override = match id { IDM_LANG_SYSTEM => None, IDM_LANG_ENGLISH => Some(LanguageId::English), @@ -2272,6 +2274,7 @@ unsafe extern "system" fn wnd_proc( IDM_LANG_KOREAN => Some(LanguageId::Korean), IDM_LANG_TRADITIONAL_CHINESE => Some(LanguageId::TraditionalChinese), IDM_LANG_RUSSIAN => Some(LanguageId::Russian), + IDM_LANG_PORTUGUESE_BRAZIL => Some(LanguageId::PortugueseBrazil), _ => None, }; { @@ -2484,6 +2487,7 @@ fn show_context_menu(hwnd: HWND) { LanguageId::Korean => IDM_LANG_KOREAN, LanguageId::TraditionalChinese => IDM_LANG_TRADITIONAL_CHINESE, LanguageId::Russian => IDM_LANG_RUSSIAN, + LanguageId::PortugueseBrazil => IDM_LANG_PORTUGUESE_BRAZIL, }; let label_str = native_interop::wide_str(language.native_name()); let flags = if language_override == Some(language) { From 7af314996d19265de3b93f7afc4b7a5c173c488c Mon Sep 17 00:00:00 2001 From: Craig Constable Date: Fri, 12 Jun 2026 19:54:11 +1000 Subject: [PATCH 5/5] v1.4.3 - Add Brazilian Portuguese (pt-BR) localization - Thanks to @caduaraxa for the contribution in PR #29 Co-Authored-By: Claude Fable 5 --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e677df6..b4bef3d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -38,7 +38,7 @@ checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" [[package]] name = "claude-code-usage-monitor" -version = "1.4.2" +version = "1.4.3" dependencies = [ "dirs", "native-tls", diff --git a/Cargo.toml b/Cargo.toml index c7275fa..2c2ac9f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "claude-code-usage-monitor" -version = "1.4.2" +version = "1.4.3" edition = "2021" license = "MIT" description = "Claude Code Usage Monitor"