Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,32 @@ quality-ratchet/
# runtime. The previous `docs/*` block hid every file except openapi.yaml,
# so the in-product help screen failed with ENOENT for every page.
# We now keep the English markdown tree plus the docs assets imported by MDX
# during `next build`, while still dropping the bulky translated docs and
# extra raster diagram sources that account for most of the docs footprint
# of the ~50 MB docs directory. The Docs viewer reads the default-locale
# (English) sources at runtime, so translations are not required in the
# container image.
# during `next build`, while still dropping the extra raster diagram sources
# and the translated files the runtime never reads.
#
# 2026-11-03 (owner decision): the image serves the translated /docs pages
# (#18699), which read docs/i18n/<locale>/docs/<section>/<PAGE>.md at runtime.
# Re-include exactly those mirrors: the sections source.config.ts compiles,
# minus the operator-internal security pages re-excluded below. The README,
# CHANGELOG, agent-guide and llm.txt mirrors at each locale root stay out.
# Keep in sync with scripts/build/docsMirrorRuntime.mjs (enforced by
# tests/unit/docs-mirror-runtime-shipping.test.ts).
docs/i18n/**
!docs/i18n/*/docs/getting-started/**/*.md
!docs/i18n/*/docs/guides/**/*.md
!docs/i18n/*/docs/architecture/**/*.md
!docs/i18n/*/docs/reference/**/*.md
!docs/i18n/*/docs/frameworks/**/*.md
!docs/i18n/*/docs/routing/**/*.md
!docs/i18n/*/docs/security/**/*.md
!docs/i18n/*/docs/compression/**/*.md
!docs/i18n/*/docs/ops/**/*.md
!docs/i18n/*/docs/providers/**/*.md
!docs/i18n/*/docs/comparison/**/*.md
docs/i18n/*/docs/security/STEALTH_GUIDE.md
docs/i18n/*/docs/security/SOCKET_DEV_FINDINGS.md
docs/i18n/*/docs/security/MITM-TPROXY-DECRYPT.md
docs/i18n/*/docs/security/PUBLIC_CREDS.md
# Internal planning artifacts (gitignored). `*.md` above only matches the root,
# so without this rule these land in /app/docs and become readable through the
# dashboard's Docs viewer at runtime.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- **feat(docs):** npm and Docker installs now serve the translated `/docs` pages. The npm package (under `dist/docs/i18n/`) and the Docker image ship the 8,885 page mirrors the docs route can read, without the README/CHANGELOG/agent-guide mirrors or the operator-internal security pages, and `jsdom`, which renders them, is now a runtime dependency. The npm tarball grows from about 112 MB to 191 MB ([#18869](https://github.com/cheaper-inference/OmniRoute/pull/18869))
1 change: 1 addition & 0 deletions config/quality/.license-allowlist.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
"BSD-3-Clause",
"ISC",
"0BSD",
"MIT-0",
"CC0-1.0",
"Unlicense",
"Python-2.0",
Expand Down
15 changes: 15 additions & 0 deletions docs/guides/I18N.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,21 @@ Only the `readme` mode (root README variants) has no replacement yet.
3. Dynamic import loads `messages/{locale}.json`
4. Components use `useTranslations("namespace")` and `t("key")`

### Translated `/docs` pages

When the `NEXT_LOCALE` cookie names a non-English locale, `/docs/<section>/<PAGE>` serves
`docs/i18n/<locale>/docs/<section>/<PAGE>.md` (`src/lib/docsI18nRender.ts`). A page or locale
without a mirror gets the English page.

Every install method ships these mirrors: the standalone build, Electron, the npm package (under
`dist/docs/i18n/`) and the Docker image. The npm package and the image carry only the mirrors the
route can serve: the sections `source.config.ts` compiles, without the operator-internal security
pages it excludes. The README, CHANGELOG, agent-guide and `llm.txt` mirrors at each locale root
stay out of both.
`scripts/build/docsMirrorRuntime.mjs` holds that rule; the npm pack policy and `.dockerignore`
follow it, and `tests/unit/docs-mirror-runtime-shipping.test.ts` keeps them in sync. The pages are
sanitized through `jsdom`, which is a runtime dependency for that reason.

### Supported Locales

| Code | Language | RTL | Google Translate Code |
Expand Down
36 changes: 1 addition & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,7 @@
"ink-text-input": "^6.0.0",
"ioredis": "^5.10.1",
"jose": "^6.2.10",
"jsdom": "^30.0.1",
"js-yaml": "^5.4.2",
"jsonc-parser": "^3.3.1",
"lowdb": "^7.0.1",
Expand Down Expand Up @@ -488,7 +489,6 @@
"intl-messageformat": "11.2.14",
"istanbul-lib-instrument": "6.0.3",
"jscpd": "^4.3.0",
"jsdom": "^30.0.1",
"junit-to-ctrf": "^0.0.14",
"knip": "^6.35.1",
"license-checker-rseidelsohn": "^5.0.1",
Expand Down
4 changes: 3 additions & 1 deletion scripts/build/assembleStandalone.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -1279,7 +1279,9 @@ export function assembleStandalone({

// #18699: the translated /docs pages sanitize through jsdom, an external Next's trace leaves
// out of the bundle. Without it every translated page falls back to English. Only bundles that
// carry the mirrors can reach that import, so Docker (which excludes them) stays lean.
// carry the mirrors can reach that import, so a build without them stays lean. Docker carries
// them since 2026-11-03 (.dockerignore re-includes them) and gets jsdom here; the npm tarball
// never packs node_modules, so npm installs get it from `dependencies` instead.
if (fsSync.existsSync(path.join(resolvedOutDir, "docs", "i18n"))) {
colocateLlmlinguaOptionals({
rootDir: projectRoot,
Expand Down
Loading
Loading