Repository navigation
Website: multilingual site (12 languages) with staged rollout - #115
Merged
Merged
Conversation
…ry and interaction pages)
…atable islands; per-language sitemaps
🔎 Website previewhttps://pr-115--affectionate-goldberg-13a61e.netlify.app Updated for commit 2c2da0d. |
This branch was successfully deployed
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.
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.tshas aliveflag per language, and only live languages are built, so nothing unfinished reaches a sitemap, an hreflang link or Google. This PR makes onlyzhlive, 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.astrohold the page bodies.src/pages/*render them with English,src/pages/[locale]/*with the other languages.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.src/content/documentation.<code>.md, with English heading ids ({#props}) so anchors keep working.stringsprops, and analytics values stay language-neutral.Checks:
vp checkis 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.