Our "fully translated" site showed 174 strings in English
Published
An older version of this site had an English/Japanese switch on every page. In Japanese mode, 174 strings across 15 pages were still in English. Nothing looked broken, so nobody noticed. Here is how we found them, what the comparison could not find, and how to check your own project.
How the old site was translated
Each page carried its own translation table: one object with English strings and one with Japanese strings, keyed by names such as nav_json or page_desc. Elements on the page pointed to a key. Switching the language replaced each element's text with the value for that key.
The catch was in one line of the switching code: if the Japanese table had no value for a key, the element was left as it was. The page's original text was English, so a missing Japanese key meant the English text simply stayed. No error, no blank space.
How we checked
We took the 15 pages as they were in the old site's last commit, extracted each page's English and Japanese tables into two JSON files, and compared every pair with the JSON key compare tool on this site.
What we found
- Across the 15 pages there were 503 English keys and 314 Japanese ones. 189 keys had no Japanese value.
- 174 of them were actually used on their page, so those strings stayed English in Japanese mode. Pages share some strings, so the same key is counted once per page.
- On 13 of the 15 pages, the tool names in the navigation menu stayed English: all 12 on each tool page, and the 10 listed on the home page. The menu headings were translated; the items under them were not.
- On 6 pages the description under the page title stayed English. On the QR code page, the Download button did too.
- The other 15 missing keys were not used anywhere on their page. For example, the loading message "Loading AI model..." from the background remover had been copied into 12 other pages that have no AI model.
- The privacy and terms pages were complete. There were no placeholder mismatches, empty values or duplicate keys.
Why it happened
We can't be certain from the record, but the pattern points one way. Every page kept its own copy of the shared menu strings. The English side of every copy had the menu items; the Japanese side of 13 copies did not. It looks as if the menu items were added to the English tables page by page, and the Japanese tables never got the same treatment. Copying shared strings into each page makes this kind of drift almost inevitable.
What the comparison could not find
The color converter page used three keys, for the headings of its explanation sections, that existed in neither table. Those headings never changed with the language. Comparing two translation files cannot catch this: both files agree, they are just both missing the key. To find it you have to compare the keys the code uses against the table, which is a different check.
How to check your own project
1. Compare your locale files key by key
Paste both files into the JSON key compare tool, or run this in the folder that contains en.json and ja.json (Node.js; bash, zsh or similar). It prints keys present in only one file, including nested ones:
node -e 'const f=(o,p="")=>Object.entries(o).flatMap(([k,v])=>v&&typeof v=="object"&&!Array.isArray(v)?f(v,p+k+"."):[p+k]);const a=new Set(f(require("./en.json"))),b=new Set(f(require("./ja.json")));for(const k of a)if(!b.has(k))console.log("missing in ja:",k);for(const k of b)if(!a.has(k))console.log("only in ja:",k)'
On the old QR code page's tables it printed 16 lines, starting with:
missing in ja: btn_download
missing in ja: page_desc
2. Check the keys your code uses
Search your templates or code for the keys they reference (for example t("…") calls or data-i18n attributes) and make sure each exists in the base file. This catches what a file-to-file comparison can't.
3. Keep shared strings in one place
Menus, footers and buttons that appear on every page belong in one shared file, not in each page. Then there is one copy to keep complete instead of fifteen.
What we did
The old site was later rebuilt. The new one generates a separate English and Japanese page for each URL at build time, so there is no runtime table that can silently fall back to English.
To compare your own translation files, paste them into the JSON key compare tool. It runs in your browser and nothing is uploaded.