Skip to content

docs: internationalize docs.atuin.sh - #3760

Closed
markovejnovic wants to merge 10 commits into
mainfrom
docs/i18n-switcher
Closed

docs: internationalize docs.atuin.sh#3760
markovejnovic wants to merge 10 commits into
mainfrom
docs/i18n-switcher

Conversation

@markovejnovic

@markovejnovic markovejnovic commented Jul 27, 2026

Copy link
Copy Markdown
Member
  • Adds a new plugin for i18n support on docs.atuin.sh
  • We lose instant navigation due to plugin compatibility
image image image image

Adds the mkdocs-static-i18n plugin in suffix mode with three locales
(en default, zh, ru) so translated pages can live alongside their
English source as *.zh.md / *.ru.md. English continues to build at
the version root; fallback_to_default keeps zh/ru trees populated
with English content until real translations land.
mkdocs-static-i18n rebuilds each extra locale by calling mkdocs'
build() again against the same config object, so every plugin
instance (and its mutable state) is reused across locales rather than
reset. mkdocs-llmstxt keys its page cache on src_uri, which is
identical across locales for any page served by the default-language
fallback, but derives each entry's URL from dest_uri, which is
locale-prefixed. Each nested build overwrote the English state with
the next locale's URLs, so llms.txt / llms-full.txt ended up entirely
pointing at whichever locale (ru) built last -- reproducible with zero
translated files, so not a translation-content bug.

docs/hooks/llmstxt_i18n.py makes llmstxt's on_files / on_page_content
/ on_post_build no-ops outside the default-language build pass, so its
cache is only ever populated and flushed once, during the English
pass. It has to swap the bound methods in config.plugins.events[...]
directly: mkdocs binds plugin methods into that dispatch table when
plugins load, so setting a new attribute on the plugin instance itself
is silently ignored by the dispatcher.

Also drops theme.features: navigation.instant(.prefetch/.progress).
mkdocs-static-i18n logs an unconditional warning when that feature is
enabled (its contextual language-switcher links aren't compatible with
instant loading), and since each locale's nested build() call re-enters
mkdocs' own --strict warning check, that warning aborted the locale
loop before later locales (ru) ever built. Dropping the feature removes
the warning at the source; mike deploy (which never passes --strict)
was already unaffected either way.
@socket-security

socket-security Bot commented Jul 27, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedpypi/​mkdocs-static-i18n@​1.3.1100100100100100

View full report

The __self__-identity check already makes the wrap idempotent: a method we
replaced is the plain wrapper closure, which has no __self__ and fails the
match on mkdocs' per-locale on_config re-runs. The marker was never read.
The Chinese README mirrored a years-old English README structure (212 lines
vs the current 134) and was unmaintained. A stale translated landing page
misleads more than the English one; drop it and its language toggle.
Both were inline-level (img default inline, .eyebrow inline-flex), so they
shared one line instead of stacking; the logo's margin-bottom did nothing.
Make each a block-level, auto-centered element.
The community/untranslated notices were admonition boxes in the content
flow. Render them in Material's announce block instead -- the full-width
bar at the very top, above the header -- and paint it to match the version
outdated warning banner. Tight whitespace keeps English pages banner-free.
The untranslated banner linked to "Read in English" on a page already
showing English fallback content -- nonsensical -- so drop the link. Add zh
and ru translations of both notice strings so the banner speaks the reader's
language; English remains the per-string fallback.
@markovejnovic
markovejnovic marked this pull request as ready for review July 28, 2026 22:29
@greptile-apps

greptile-apps Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

Adds Chinese and Russian MkDocs localization, translated-page notices, and an i18n-aware hook that keeps llms.txt English-only.

Confidence Score: 5/5

The PR appears safe to merge.

The localization configuration, translated content moves, notice template, and llms.txt hook form a consistent documentation-build change with no concrete blocking failure identified.

Important Files Changed

Filename Overview
docs/mkdocs.yml Configures suffix-based localization for English, Chinese, and Russian documentation.
docs/hooks/llmstxt_i18n.py Prevents localized builds from overwriting mkdocs-llmstxt’s English page state.
docs/overrides/main.html Displays localized notices for translated and fallback-English pages.
docs/pyproject.toml Adds mkdocs-static-i18n to the documentation build dependencies.
docs/uv.lock Locks mkdocs-static-i18n 1.3.1 without changing the investigated pre-existing vulnerable dependency versions.

Reviews (1): Last reviewed commit: "docs: localize i18n banner text, drop re..." | Re-trigger Greptile

@markovejnovic
markovejnovic requested a review from ellie July 28, 2026 22:37
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