Skip to content

Website: multilingual site (12 languages) with staged rollout - #115

Merged
tuanphungcz merged 9 commits into
mainfrom
website-i18n
Oct 13, 2026
Merged

tuanphungcz merged 9 commits into
mainfrom
website-i18n

Conversation

@tuanphungcz

Copy link
Copy Markdown
Collaborator

Makes useanimations.com multilingual without touching the English pages: their visible text, titles and meta descriptions are unchanged (checked by diffing the text of all 337 English pages against main). The only English changes are the footer (a language list instead of the 中文 link) and new hreflang / og:locale tags.

What gets translated. Home, documentation, licence page and the 33 hubs (icons, categories, interactions, Lottie, shadcn), i.e. 34 pages per language, into zh, es, pt-BR, de, fr, ja, ko, cs, vi, id, tr and ru. Icon pages, Markdown twins, llms.txt, icons.json and the registry stay English. Translating the 300 templated icon pages ×12 is what Google's scaled-content policy describes, so they are left out on purpose.

Staged rollout. website/src/i18n/locales.ts has a live flag per language, and only live languages are built, so nothing unfinished reaches a sitemap, an hreflang link or Google. This PR makes only zh live, at the same URL /zh. That replaces the hand-written page, whose title, H1 and key phrases are kept. Later waves are one-line PRs: wave 1 es/pt-BR/de/fr, wave 2 ja/ko/cs, wave 3 vi/id/tr/ru. Each one opens when the previous wave is indexed and English traffic is stable. PR previews build every language (I18N_PREVIEW=1, still noindex).

How it works

  • src/i18n/: the locales, t(locale) messages typed against English (messages/en/* is the contract) and Intl-based plural/list helpers. Sentences with counts or lists are per-language functions, so no language uses English grammar.
  • src/views/*Page.astro hold the page bodies. src/pages/* render them with English, src/pages/[locale]/* with the other languages.
  • Every translated page has a self-canonical, a full reciprocal hreflang set with x-default and og:locale. Each language gets its own sitemap (/sitemap-<code>.xml) so Search Console reports indexing per language. Dataset and SoftwareApplication JSON-LD stay on the English pages only, so they aren't duplicated.
  • Documentation translations are src/content/documentation.<code>.md, with English heading ids ({#props}) so anchors keep working.
  • On English pages, a visitor whose browser prefers another available language gets a small bar in that language offering the page. There are no redirects.
  • React islands take strings props, and analytics values stay language-neutral.

Checks: vp check is clean. The all-language build has 744 pages, no English sentences left on any translated page, all titles and descriptions within limits (60/155, CJK 32/80) and no duplicates; the one exception is the existing zh home title, kept on purpose. Headless Chromium tested the banner, icon dialog, search and mobile layout on several languages with no page errors.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

🔎 Website preview

https://pr-115--affectionate-goldberg-13a61e.netlify.app

Updated for commit 2c2da0d.

@tuanphungcz
tuanphungcz merged commit 88b845d into main Oct 13, 2026
7 checks passed
@tuanphungcz
tuanphungcz deleted the website-i18n branch October 13, 2026 13:12

This branch was successfully deployed

1 active deployment
preview — 2c2da0d2 Deployed Oct 13, 2026 by tuanphungcz via preview #69
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