Skip to content

fix(i18n): local times with their zone, translated update errors - #184

Merged
Derrors merged 1 commit into
mainfrom
fix/i18n-update-errors-and-times
Nov 24, 2026
Merged

Derrors merged 1 commit into
mainfrom
fix/i18n-update-errors-and-times

Conversation

@Derrors

@Derrors Derrors commented Nov 24, 2026

Copy link
Copy Markdown
Owner

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" in status / 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 from localtime_r at that instant, so DST is right; +00:00 if the zone can't be read). No new dependency. Nothing parses these timestamps. The last_resign sentence kept for older versions stays UTC, as they wrote it. Lines already in daemon.log keep 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 by iphone-control update, service install and the control page's update panel (last_update.detail). They're now tr! / 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's status field, which the page keys on, is unchanged. Pure-placeholder messages ("{}: {status}") stay as they are.

Not in this PR (found in the same review):

  • Pasting on iOS 27 only recognises "Allow Paste" in Simplified/Traditional Chinese and English, and the Touch ID "Use Passcode" button only in Chinese/English: needs samples from a phone in another language first.
  • main returns anyhow::Result, so every CLI error starts with Rust's English Error: / Caused by: even in Chinese.

Tests

1. Unit tests

  • New 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_language now checks local time and that the legacy sentence stays UTC
  • Those tests pass with TZ=UTC, the host's UTC+8 and TZ=America/St_Johns (−03:30)
  • fmt, cargo clippy --workspace --all-targets --all-features --locked -- -D warnings (also --target x86_64-apple-darwin), cargo test --workspace --all-features --locked: 535 passed
  • No existing test removed, ignored or loosened

2. Real-device regression

  • Not needed for the phone: no code that talks to a phone changed. By hand with this build: iphone-control update apply without a script install receipt prints 读不到脚本安装的记录;运行 iphone-control update check,查看这种安装方式怎么升级 with IPHONE_CONTROL_LANG=zh and the original English text with en

3. Regression cases (docs/dev/regression-cases.md)

Checklist

  • MCP tool names, parameters and default outputs stay compatible (D10)
  • No new dependencies
  • User-visible changes in CHANGELOG.md and CHANGELOG.zh-CN.md (Unreleased)

🤖 Generated with Claude Code

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>
@Derrors
Derrors merged commit 25a0333 into main Nov 24, 2026
7 checks passed
@Derrors
Derrors deleted the fix/i18n-update-errors-and-times branch November 24, 2026 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant