Skip to content

fix(docs): Spanish strings were showing on the English docs - #23

Merged
crstian19 merged 1 commit into
mainfrom
fix/spanish-strings-in-english-docs
Aug 12, 2026
Merged

fix(docs): Spanish strings were showing on the English docs#23
crstian19 merged 1 commit into
mainfrom
fix/spanish-strings-in-english-docs

Conversation

@crstian19

Copy link
Copy Markdown
Contributor

The docs are English-only, but Spanish had leaked into the chrome a reader
sees. Not the prose, which is written in English: these are defaults and labels
buried in components, which is why review kept walking past them.

Showing in production right now

Where Was
/docs/models, limits card heading limitaciones conocidas
Every code block Copiar, Copiado, ¡Copiado al portapapeles!, Error al copiar
Rate limits card rate limits por API key, Paralelo máximo, concurrentes, tokens / min por modelo, requests / min por modelo

The heading came from the default title of <LimitationsCard>, used whenever
the tag carries no explicit one, so it only surfaced on the one page that omits
it.

Two places, one string

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
generates the text /api/docs serves to the Discord bot. Both sides are
changed together here, along with the fixture that pins the extractor's output.

That pairing is the same one rateLimits.ts exists to protect: the page and
the API had already drifted apart once over these numbers.

Guard

A test walks the docs components and the layout and fails on Spanish in
anything a reader can see. It ignores comments, since the repo deliberately
keeps Spanish ones in the layouts and styles. DocsTopBar.astro and
ApiReference.astro are exempt: their Spanish is the translated chrome of
/es/docs/api, which is the point.

It also checks that the component and the extractor agree on the default title,
rather than each being asserted in isolation.

Testing

654 tests green. The guard is verified by mutation: restoring any of the three
Spanish strings, or letting the component and the extractor drift apart, makes
the suite fail.

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 <LimitationsCard>, 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.
@crstian19
crstian19 merged commit 272d64c into main Aug 12, 2026
2 checks passed
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.

2 participants