Skip to content

Localize user-facing error messages; move developer details to the log - #99

Merged
dadachi merged 1 commit into
mainfrom
fix/localize-error-messages
Oct 14, 2026
Merged

dadachi merged 1 commit into
mainfrom
fix/localize-error-messages

Conversation

@dadachi

@dadachi dadachi commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Summary

User-facing CodedError text was developer text in English (NativeAppTemplateAPIError::NoData, <message> [Status: 500], EntityAdapterError::InvalidOrMissingAttributes). It is now localized (en + ja), worded the same as the paid template and MyTurnTag iOS/Android; developer details go to the log.

Error Shown (en) Shown (ja)
NATIVEAPPTEMPLATE-2001 requestFailed without error_message Something went wrong while communicating with the server. Please try again later. サーバーとの通信中に問題が発生しました。しばらくしてからもう一度お試しください。
2001 with error_message the API's message as is, without [Status: nnn] (already localized by the API)
1001, 2002–2005, EntityAdapterError 2006–2008, 4001–4004 An unexpected error occurred. 予期しないエラーが発生しました。
  • Codes and the [CODE] description format are unchanged; no flow changes. The generic strings contain no rename-target nouns.
  • New CodedError.debugDescription keeps status code, API message, field name, underlying error; Error.debugCodedDescription returns it. All Failure logs use it, and URLSession.apiResponse logs failed and unreadable responses (Failure.request).
  • Sign-up showed "UNKNOWN" for a failure without error_message; it now shows the coded generic text.
  • AGENTS.md: user-facing error text is localized; developer details go to logs; NATIVEAPPTEMPLATE-nnnn codes stay untranslated. CHANGELOG updated.

Verification

  • Failing tests first: 40 issues red before the change, green after.
  • make lint: 0 violations, 0 files need formatting.
  • Full suite on the iPhone: 434 passed (+1 known issue); 6 of them are new.
  • xcrun xcstringstool sync against the build's .stringsdata: both new keys present, every key has ja translated.
  • On device in Japanese (-testLanguage ja), a temporary uncommitted test against the local nativeapptemplateapi and a local HTTP server, checking Message(error:).message:
    • wrong password (local API, 401) → [NATIVEAPPTEMPLATE-2001] メールアドレスまたはパスワードが正しくありません。もう一度お試しください。 (log has Status: 401)
    • missing shop (local API, 404) → [NATIVEAPPTEMPLATE-2001] 見つかりませんでした。
    • 500 without body → [NATIVEAPPTEMPLATE-2001] サーバーとの通信中に問題が発生しました。しばらくしてからもう一度お試しください。
    • two resources for a detail request → [NATIVEAPPTEMPLATE-2002] 予期しないエラーが発生しました。
    • Keychain item missing → [NATIVEAPPTEMPLATE-4002] 予期しないエラーが発生しました。
  • App installed and launched on the iPhone with devicectl (Japanese); it reaches the local API.

🤖 Generated with Claude Code

https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH

CodedError descriptions were developer text ("NativeAppTemplateAPIError::NoData",
"<message> [Status: 500]") shown to the user in English. What the user sees
is now localized (en + ja), with the same wording as Android:

- NATIVEAPPTEMPLATE-2001 without the API's error_message: "Something went
  wrong while communicating with the server. Please try again later."
- 2001 with error_message: the message as is, without the " [Status: nnn]"
  suffix
- Developer-only errors (1001, 2002-2008, 4001-4004): "An unexpected error
  occurred."

Codes and codedDescription's "[CODE] description" format are unchanged.
Status codes, field names and underlying errors move to the new
CodedError.debugDescription; Failure logs and URLSession.apiResponse log it
(error.debugCodedDescription). Sign-up no longer shows "UNKNOWN" for a
failure without error_message. AGENTS.md's localization rule is updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5hZEFqXhBsUQwSWsgR6eH
@dadachi
dadachi merged commit 47b8d83 into main Oct 14, 2026
2 checks passed
@dadachi
dadachi deleted the fix/localize-error-messages branch October 14, 2026 09:13
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