Improve localization coverage#952
Open
xiaoqianWX wants to merge 4 commits into
Open
Conversation
There was a problem hiding this comment.
Pull request overview
This PR broadens CodexBar’s localization coverage across menus, provider settings, charts, alerts, accessibility text, and runtime usage/provider copy, while adding English fallback behavior and localized formatting helpers.
Changes:
- Added
LocalizedUsageTextandLocalizedProviderTexthelpers for reusable localized usage, reset, provider source, and status strings. - Replaced many hardcoded UI strings with localized lookups across preferences, menus, provider UIs, charts, alerts, and accessibility labels.
- Expanded English and Simplified Chinese localization files and added a test to catch empty localized string values.
Reviewed changes
Copilot reviewed 57 out of 57 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Tests/CodexBarTests/ProviderSettingsDescriptorTests.swift | Updates provider detail expectation for localized provider source labels. |
| Tests/CodexBarTests/MenuCardSubtitleTests.swift | Updates subtitle expectation for localized usage timestamps. |
| Tests/CodexBarTests/LocalizationBundleTests.swift | Adds bundled localization empty-value coverage. |
| Sources/CodexBar/UsageProgressBar.swift | Localizes progress bar accessibility percent text. |
| Sources/CodexBar/UsagePaceText.swift | Localizes pace summaries, ETA, and risk text. |
| Sources/CodexBar/UsageBreakdownChartMenuView.swift | Localizes usage breakdown chart empty states, accessibility, and hover labels. |
| Sources/CodexBar/StorageBreakdownMenuView.swift | Localizes storage menu labels, counts, cleanup headings, and copy actions. |
| Sources/CodexBar/StatusItemController+UsageHistoryMenu.swift | Localizes subscription utilization menu title. |
| Sources/CodexBar/StatusItemController+SwitcherViews.swift | Localizes provider switcher overview title. |
| Sources/CodexBar/StatusItemController+MenuTypes.swift | Localizes overview storage label. |
| Sources/CodexBar/StatusItemController+Menu.swift | Localizes menu descriptor rendering and several submenu titles/reset strings. |
| Sources/CodexBar/StatusItemController+HostedSubmenus.swift | Localizes hosted submenu placeholder item. |
| Sources/CodexBar/StatusItemController+Actions.swift | Localizes login alerts and login success notification text. |
| Sources/CodexBar/Resources/zh-Hans.lproj/Localizable.strings | Refreshes and expands Simplified Chinese translations. |
| Sources/CodexBar/Resources/en.lproj/Localizable.strings | Adds English keys for newly localized runtime/provider strings. |
| Sources/CodexBar/Providers/Windsurf/WindsurfProviderImplementation.swift | Localizes Windsurf source trailing text. |
| Sources/CodexBar/Providers/StepFun/StepFunProviderImplementation.swift | Reuses shared localized cached-cookie trailing text. |
| Sources/CodexBar/Providers/Shared/ProviderPresentation.swift | Localizes missing-version text. |
| Sources/CodexBar/Providers/Shared/ProviderCookieSourceUI.swift | Adds localized keychain-disabled and cached-cookie helper text. |
| Sources/CodexBar/Providers/OpenCode/OpenCodeProviderUI.swift | Reuses shared cached-cookie trailing text. |
| Sources/CodexBar/Providers/Mistral/MistralProviderImplementation.swift | Reuses shared cached-cookie trailing text. |
| Sources/CodexBar/Providers/MiniMax/MiniMaxProviderImplementation.swift | Localizes source presentation and cached-cookie trailing text. |
| Sources/CodexBar/Providers/MiMo/MiMoProviderImplementation.swift | Reuses shared cached-cookie trailing text. |
| Sources/CodexBar/Providers/Kilo/KiloProviderImplementation.swift | Localizes Kilo source trailing text. |
| Sources/CodexBar/Providers/Factory/FactoryProviderImplementation.swift | Reuses shared cached-cookie text and localizes extra usage balance. |
| Sources/CodexBar/Providers/Cursor/CursorProviderImplementation.swift | Reuses shared cached-cookie trailing text. |
| Sources/CodexBar/Providers/Copilot/CopilotLoginFlow.swift | Localizes Copilot login alert titles/messages. |
| Sources/CodexBar/Providers/Codex/CodexProviderImplementation.swift | Localizes Codex source/version and credit summaries. |
| Sources/CodexBar/Providers/Claude/ClaudeProviderImplementation.swift | Localizes Claude source/version and cached-cookie text. |
| Sources/CodexBar/Providers/Augment/AugmentProviderImplementation.swift | Reuses shared cached-cookie trailing text. |
| Sources/CodexBar/Providers/Antigravity/AntigravityProviderImplementation.swift | Localizes Antigravity source trailing text. |
| Sources/CodexBar/Providers/Alibaba/AlibabaCodingPlanProviderImplementation.swift | Localizes source presentation and cached-cookie trailing text. |
| Sources/CodexBar/Providers/Abacus/AbacusProviderImplementation.swift | Reuses shared cached-cookie trailing text. |
| Sources/CodexBar/PreferencesProvidersPane.swift | Localizes automatic menu bar metric option for balance-only providers. |
| Sources/CodexBar/PreferencesProviderSidebarView.swift | Localizes reorder help/accessibility and disabled status prefix. |
| Sources/CodexBar/PreferencesProviderSettingsRows.swift | Localizes provider settings rows, buttons, placeholders, and token account controls. |
| Sources/CodexBar/PreferencesProviderErrorView.swift | Localizes copy-error help text. |
| Sources/CodexBar/PreferencesProviderDetailView.swift | Localizes provider detail labels, status/source/update text, metrics, and notes. |
| Sources/CodexBar/PreferencesGeneralPane.swift | Localizes refresh cadence picker and cost update text. |
| Sources/CodexBar/PreferencesDisplayPane.swift | Localizes display mode picker label. |
| Sources/CodexBar/PreferencesDebugPane.swift | Localizes debug picker labels, log levels, loading patterns, and simulated error placeholder. |
| Sources/CodexBar/PreferencesCodexAccountsSection.swift | Localizes Codex account labels, notices, buttons, and system account text. |
| Sources/CodexBar/PreferencesAdvancedPane.swift | Localizes provider storage setting copy. |
| Sources/CodexBar/PreferencesAboutPane.swift | Localizes update channel labels/descriptions. |
| Sources/CodexBar/PlanUtilizationHistoryChartMenuView.swift | Localizes plan utilization chart labels, empty states, and detail lines. |
| Sources/CodexBar/OpenAICreditsPurchaseWindowController.swift | Localizes buy credits window title. |
| Sources/CodexBar/MenuDescriptor.swift | Localizes menu descriptor usage, account, plan, quota, status, and reset strings. |
| Sources/CodexBar/MenuCardView+ModelHelpers.swift | Routes reset text through localized usage helper. |
| Sources/CodexBar/MenuCardView.swift | Localizes menu card sections, status/reset/details, credits, cost, and regen copy. |
| Sources/CodexBar/LocalizedUsageText.swift | Adds localized usage/reset/update/credit formatting helper. |
| Sources/CodexBar/LocalizedProviderText.swift | Adds localized provider source/status helper. |
| Sources/CodexBar/Localization.swift | Adds locale helper and English fallback lookup for missing localized keys. |
| Sources/CodexBar/KeychainPromptCoordinator.swift | Localizes keychain prompt titles and messages. |
| Sources/CodexBar/Date+RelativeDescription.swift | Localizes relative date descriptions. |
| Sources/CodexBar/CursorLoginRunner.swift | Localizes Cursor login window title. |
| Sources/CodexBar/CreditsHistoryChartMenuView.swift | Localizes credits history chart text and accessibility. |
| Sources/CodexBar/CostHistoryChartMenuView.swift | Localizes cost history chart text and most hover detail text. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "\(dayLabel): \(cost) · \(UsageFormatter.tokenCountString(tokens)) tokens" | ||
| String(format: L("%1$@: %2$@ · %3$@ tokens"), dayLabel, cost, UsageFormatter.tokenCountString(tokens)) | ||
| } else { | ||
| "\(dayLabel): \(cost)" |
Contributor
Author
|
seems like CI is failing on linux due to commit 2905c5e 's additions |
# Conflicts: # Sources/CodexBar/CostHistoryChartMenuView.swift # Sources/CodexBar/CursorLoginRunner.swift # Sources/CodexBar/MenuCardView.swift # Sources/CodexBar/PreferencesProviderSettingsRows.swift # Sources/CodexBar/Resources/en.lproj/Localizable.strings # Sources/CodexBar/Resources/zh-Hans.lproj/Localizable.strings # Tests/CodexBarTests/LocalizationBundleTests.swift
…-20260515203032 # Conflicts: # Sources/CodexBar/StatusItemController+Menu.swift
Contributor
Author
|
@steipete probably good now? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LocalizedUsageTextandLocalizedProviderTexthelpers for reusable localized usage/provider copy.token/tokensas-is where appropriate.