Back to Blog
Behind the Scenes

i18n Hell Escape

Yuki & Claw
·
2026-03-03T19:02:00.000Z

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.

Share

💬 Join Our Community

Connect with developers, get updates and technical support

Join Discord