Repository navigation
fix(i18n): local times with their zone, translated update errors - #184
Merged
Merged
Conversation
Times in the event log, `status` / `doctor` ("last re-sign") and the
re-sign message were UTC without saying so. They are now local time with
the UTC offset (`2026-11-24 16:08:52 +08:00`, offset from localtime_r, so
DST is right). The legacy `last_resign` sentence old versions read stays
UTC.
About 120 errors of the updater, the background service and the update
schedule were English only and reached Chinese users through
`iphone-control update` and the control page's update panel. They are now
tr!/trf! pairs; outcome.json's `status` field, which the page keys on, is
unchanged.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What and why
Two findings from an i18n review of the project.
Times were UTC without saying so: the event log (
status"Recent log"), "last re-sign" instatus/doctor, and the re-sign completion message. A user in UTC+8 saw times 8 hours off. They're now local time with the offset, e.g.2026-11-24 16:08:52 +08:00(eventlog::format_local, offset fromlocaltime_rat that instant, so DST is right;+00:00if the zone can't be read). No new dependency. Nothing parses these timestamps. Thelast_resignsentence kept for older versions stays UTC, as they wrote it. Lines already indaemon.logkeep their old UTC format.Update / service / schedule errors were English only (~120 messages in
update/transaction.rs,update/channel.rs,update/archive.rs,update/install.rs,update/release.rs,service.rs,schedule.rs,update.rs,main.rs), shown to Chinese users byiphone-control update,service installand the control page's update panel (last_update.detail). They're nowtr!/trf!pairs in the language of the process that hits them (the scheduled job reads the settings file like every command). Nothing matched on the English text;outcome.json'sstatusfield, which the page keys on, is unchanged. Pure-placeholder messages ("{}: {status}") stay as they are.Not in this PR (found in the same review):
mainreturnsanyhow::Result, so every CLI error starts with Rust's EnglishError:/Caused by:even in Chinese.Tests
1. Unit tests
local_time_carries_its_offset(+08:00, +00:00, −05:30, and a date crossing west of Greenwich);resign_result_is_shown_in_the_reader_languagenow checks local time and that the legacy sentence stays UTCTZ=UTC, the host's UTC+8 andTZ=America/St_Johns(−03:30)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(also--target x86_64-apple-darwin),cargo test --workspace --all-features --locked: 535 passed2. Real-device regression
iphone-control update applywithout a script install receipt prints读不到脚本安装的记录;运行 iphone-control update check,查看这种安装方式怎么升级withIPHONE_CONTROL_LANG=zhand the original English text withen3. Regression cases (docs/dev/regression-cases.md)
Checklist
🤖 Generated with Claude Code