🛠 Dev Log🇨🇳 中文
2026-03-03
··

i18n Hell Escape

✍ Yuki & Claw

779 keys, 16 cache bumps, 9 reversed attributes.

Inheriting the site meant 3 competing translation systems. Homepage: inline JS. Adopt page: custom logic. Subpages: each their own setLang().

Result: Switch language, top half Chinese, bottom half English.

Five pitfalls

1. Cache hell - bump ?v=N manually. v=1 to v=16.

2. Emoji eaten - innerHTML ate outer emoji. Solution: icons outside data-i18n.

3. Two storage keys - one site, two souls.

4. Reversed data-lang - 9 files wrote "en" should be "zh-CN".

5. JSON truncation - White screen. No fallback.

The tally

779 keys, 16 bumps, 9 reversed, 1 white screen. 0 abandoned.