From d1aa4821ea2a0aa49d5199f965334de842ad462d Mon Sep 17 00:00:00 2001 From: Cristian Gutierrez Date: Wed, 12 Aug 2026 12:40:08 +0200 Subject: [PATCH] fix(docs): Spanish strings were showing on the English docs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The docs are English-only, but Spanish had leaked into the chrome a reader sees. Not the prose, which is written in English: defaults and labels buried in components, which is why review kept missing them. What was showing in production: - "limitaciones conocidas" as the heading of the limits card on /docs/models. It is the default title of , used whenever the tag carries no explicit one. - "Copiar" on every code block, "Copiado" after clicking, "¡Copiado al portapapeles!" in the toast and "Error al copiar" on failure. - "rate limits por API key", "Paralelo máximo", "concurrentes", "tokens / min por modelo" and "requests / min por modelo" in the rate limits card. The card's default title and the rate-limit labels each live in TWO places that have to agree: the component a person reads and the extractor that feeds /api/docs and the Discord bot. Both sides are changed together, and the fixture that pins the extractor's output is updated with them. A guard is added over the docs components and the layout so this cannot come back. It only inspects strings a reader can see, not comments: the repo keeps Spanish comments in the layouts and styles on purpose. DocsTopBar.astro and ApiReference.astro are exempt because their Spanish is the translated chrome of /es/docs/api, which is the point. Verified by mutation: restoring any of the three Spanish strings, or letting the component and the extractor drift apart, makes the suite fail. --- src/components/docs/CodeBlock.astro | 4 +- src/components/docs/LimitationsCard.astro | 2 +- src/components/docs/RateLimits.astro | 10 +-- src/layouts/Docs.astro | 14 ++-- src/lib/__fixtures__/ratelimits.expected.md | 8 +- src/lib/mdxToText.test.ts | 8 +- src/lib/mdxToText.ts | 10 +-- src/tests/layouts/docsCopyIsEnglish.test.ts | 93 +++++++++++++++++++++ 8 files changed, 121 insertions(+), 28 deletions(-) create mode 100644 src/tests/layouts/docsCopyIsEnglish.test.ts diff --git a/src/components/docs/CodeBlock.astro b/src/components/docs/CodeBlock.astro index e7367f1..d6fd758 100644 --- a/src/components/docs/CodeBlock.astro +++ b/src/components/docs/CodeBlock.astro @@ -33,13 +33,13 @@ const uid = Math.random().toString(36).slice(2); {langLabel}
{code}
diff --git a/src/components/docs/LimitationsCard.astro b/src/components/docs/LimitationsCard.astro index f9b504b..7838013 100644 --- a/src/components/docs/LimitationsCard.astro +++ b/src/components/docs/LimitationsCard.astro @@ -9,7 +9,7 @@ interface Props { items: Limitation[]; } -const { title = 'limitaciones conocidas', items } = Astro.props; +const { title = 'known limitations', items } = Astro.props; ---
diff --git a/src/components/docs/RateLimits.astro b/src/components/docs/RateLimits.astro index 66d22ee..f14963e 100644 --- a/src/components/docs/RateLimits.astro +++ b/src/components/docs/RateLimits.astro @@ -13,7 +13,7 @@ const { perKey, tokensPerMinuteByModel, requestsPerMinuteByModel, windowedModels

- rate limits por API key + rate limits per API key

@@ -21,8 +21,8 @@ const { perKey, tokensPerMinuteByModel, requestsPerMinuteByModel, windowedModels
{perKey.requestsPerMinute} rpm
-
Paralelo máximo
-
{perKey.maxParallel} concurrentes
+
Max parallel
+
{perKey.maxParallel} concurrent
@@ -67,7 +67,7 @@ const { perKey, tokensPerMinuteByModel, requestsPerMinuteByModel, windowedModels

- tokens / min por modelo + tokens / min per model

{ @@ -83,7 +83,7 @@ const { perKey, tokensPerMinuteByModel, requestsPerMinuteByModel, windowedModels

- requests / min por modelo + requests / min per model

{ diff --git a/src/layouts/Docs.astro b/src/layouts/Docs.astro index 3f1c5be..ab9ea68 100644 --- a/src/layouts/Docs.astro +++ b/src/layouts/Docs.astro @@ -278,7 +278,7 @@ const searchData = [
-
¡Copiado al portapapeles!
+
Copied to clipboard