fix(i18n): localize hardcoded "tomorrow" in reset time display#1568
Merged
steipete merged 4 commits intoJun 16, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR localizes the “tomorrow at ” reset label by switching from hard-coded string interpolation to a localized format string.
Changes:
- Added a new localization key
reset_tomorrow_formatacross multipleLocalizable.stringsfiles. - Updated
UsageFormatterto format “tomorrow” via localized string lookup + substitution instead of embedding English punctuation/wording in code.
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Sources/CodexBarCore/UsageFormatter.swift | Uses a localized format key for “tomorrow, %@” instead of hard-coded English string interpolation |
| Sources/CodexBar/Resources/en.lproj/Localizable.strings | Adds reset_tomorrow_format in English |
| Sources/CodexBar/Resources/zh-Hans.lproj/Localizable.strings | Adds reset_tomorrow_format in Simplified Chinese |
| Sources/CodexBar/Resources/zh-Hant.lproj/Localizable.strings | Adds reset_tomorrow_format in Traditional Chinese |
| Sources/CodexBar/Resources/vi.lproj/Localizable.strings | Adds reset_tomorrow_format in Vietnamese |
| Sources/CodexBar/Resources/uk.lproj/Localizable.strings | Adds reset_tomorrow_format in Ukrainian |
| Sources/CodexBar/Resources/tr.lproj/Localizable.strings | Adds reset_tomorrow_format in Turkish |
| Sources/CodexBar/Resources/sv.lproj/Localizable.strings | Adds reset_tomorrow_format in Swedish |
| Sources/CodexBar/Resources/pt-BR.lproj/Localizable.strings | Adds reset_tomorrow_format in Brazilian Portuguese |
| Sources/CodexBar/Resources/pl.lproj/Localizable.strings | Adds reset_tomorrow_format in Polish |
| Sources/CodexBar/Resources/nl.lproj/Localizable.strings | Adds reset_tomorrow_format in Dutch |
| Sources/CodexBar/Resources/ko.lproj/Localizable.strings | Adds reset_tomorrow_format in Korean |
| Sources/CodexBar/Resources/ja.lproj/Localizable.strings | Adds reset_tomorrow_format in Japanese |
| Sources/CodexBar/Resources/it.lproj/Localizable.strings | Adds reset_tomorrow_format in Italian |
| Sources/CodexBar/Resources/id.lproj/Localizable.strings | Adds reset_tomorrow_format in Indonesian |
| Sources/CodexBar/Resources/fr.lproj/Localizable.strings | Adds reset_tomorrow_format in French |
| Sources/CodexBar/Resources/es.lproj/Localizable.strings | Adds reset_tomorrow_format in Spanish |
| Sources/CodexBar/Resources/ca.lproj/Localizable.strings | Adds reset_tomorrow_format in Catalan |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+111
to
+112
| let timeStr = date.formatted(.dateTime.hour().minute().locale(self.currentLocale())) | ||
| return self.localized("reset_tomorrow_format", timeStr) |
steipete
force-pushed
the
upstream-pr/localize-tomorrow-string
branch
from
June 16, 2026 05:01
910acca to
47d0a19
Compare
UsageFormatter.resetDescription() returned the English word "tomorrow" verbatim, causing mixed-language output like "tomorrow 10:50 にリセット" under Japanese locale. Replace the hardcoded string with a new reset_tomorrow_format localization key that embeds both the word and the time argument, letting each locale control word choice and punctuation (e.g. "明日 %@" in Japanese vs "tomorrow, %@" in English). Added reset_tomorrow_format to all 18 supported language files: - ja: 明日 %@ ko: 내일 %@ zh-Hans/Hant: 明天 %@ - de/nl: morgen, %@ fr: demain, %@ es: mañana, %@ - it: domani, %@ pt-BR: amanhã, %@ pl: jutro, %@ - sv: imorgon %@ tr: yarın, %@ uk: завтра, %@ - ca: demà, %@ vi: ngày mai, %@ id: besok, %@ Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
steipete
force-pushed
the
upstream-pr/localize-tomorrow-string
branch
from
June 16, 2026 05:37
47d0a19 to
a37b832
Compare
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
UsageFormatter.resetDescription()returned the English word "tomorrow" verbatim regardless of the user's locale setting. Under Japanese (and all other non-English locales) this produced mixed-language output:Root cause
The string was hardcoded directly in Swift:
While same-day and future-date resets were correctly formatted using
DateFormatterwith the current locale, "tomorrow" was never routed through the localization system.Fix
Replaced the hardcoded string with a new
reset_tomorrow_formatkey run throughlocalized(). Each locale controls the word, punctuation, and word order independently — for example, Japanese omits the comma:"明日 %@".Added
reset_tomorrow_formatto all 18 supported language files with native translations:ja明日 %@ko내일 %@zh-Hans/zh-Hant明天 %@frdemain, %@de/nlmorgen, %@esmañana, %@itdomani, %@pt-BRamanhã, %@pljutro, %@svimorgon %@tryarın, %@ukзавтра, %@cademà, %@vingày mai, %@idbesok, %@entomorrow, %@