Add Japanese support and repair double-encoded locale files - #49
Merged
Conversation
"ja" was missing from Locale.supportedLanguages even though every app already ships a ja.json, so Japanese browsers silently fell back to English. Add it to all four Locale copies. The locale JSON files were also stored double-encoded: UTF-8 bytes that had been read back as windows-1252, so "キャンセル" was on disk as "ã‚ャンセル". This affected every non-ASCII language, not just Japanese - Spanish showed "Número de Cuenta", German "Schließen". Decode them back to real UTF-8 and add a test that fails if mangled text is ever committed again. Also finishes the Japanese translations: ja.json now covers all 237 keys (was 194 translated, 2 missing). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KZcActb7JW6orsPWtVMHRs
This was referenced Sep 4, 2026
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.
Closes the Japanese half of https://github.com/orgs/ChurchApps/discussions/707 for the web apps (B1Mobile is out of scope here).
Japanese was never switched on
Every app already ships a
ja.json, butjawas missing fromLocale.supportedLanguages, so aja-JPbrowser silently fell through to English. Added to all fourLocalecopies (helpers,forms,donations,login).The locale files were double-encoded
public/locales/*.jsonheld UTF-8 bytes that had been read back as windows-1252, so text was mangled on disk:ã‚ャンセルキャンセルNúmero de CuentaNúmero de CuentaSchließenSchließenПожалуйÑтаПожалуйстаThis hit all 27 non-ASCII locale files, so turning Japanese on without fixing it would just have swapped English for garbage — and Spanish, the language the discussion opened about, was already showing it on donation forms.
The mangling used the WHATWG windows-1252 table rather than strict CP1252 (
0x81 0x8D 0x8F 0x90 0x9Dpass through as their own code points), which is why a plaincp1252round-trip only recovers part of it.Tests
Locale.test.tsgains a per-file check that fails if double-encoded text is committed again, plus coverage forjabeing supported. Verified the check actually fires by re-mangling a string. Full suite: 113 passing.Rollout
B1Admin and B1App consume this from npm, so they need an apphelper release before Japanese turns on for them. Their translation-side changes are in ChurchApps/B1Admin#516 and ChurchApps/B1App#540.
🤖 Generated with Claude Code
https://claude.ai/code/session_01KZcActb7JW6orsPWtVMHRs