Skip to content

v1.3.9-beta: built-in navigation labels render in Spanish on Spanish sites#37

Merged
juancobo merged 4 commits into
mainfrom
v1.3.9-beta
Jun 23, 2026
Merged

v1.3.9-beta: built-in navigation labels render in Spanish on Spanish sites#37
juancobo merged 4 commits into
mainfrom
v1.3.9-beta

Conversation

@juancobo

Copy link
Copy Markdown
Member

v1.3.9-beta

A navigation labelling fix for Spanish sites.

What's fixed

On a published site set to Spanish (telar_language: es), the built-in "Objects" and "Glossary" menu links rendered in English. buildNavigationYml copied a built-in item's single stored (English) label into both title_en and titulo_es, so Spanish sites published titulo_es: "Objects" and the framework header rendered English.

Built-in items now emit their canonical bilingual labels (Objects/Objetos, Glossary/Glosario) from a single map; the framework header picks the right one by telar_language. Custom pages and external links are unchanged (genuinely monolingual). Home is intentionally not emitted — the navbar-brand links home.

Testing

  • Updated buildNavigationYml unit tests; full publish suite (236) green, typecheck clean.
  • Verified end-to-end on staging: re-published a test site → navigation.yml now writes titulo_es: "Objetos" / "Glosario".

Migration

None — no D1 schema change.

Copilot AI review requested due to automatic review settings June 23, 2026 13:39

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes incorrect English labels for built-in navigation items on Spanish (telar_language: es) Telar sites by emitting canonical bilingual labels when generating navigation.yml.

Changes:

  • Update buildNavigationYml to emit canonical bilingual labels/URLs for built-in nav items (Objects/Objetos, Glossary/Glosario) and skip home.
  • Extend unit tests for buildNavigationYml to cover canonical bilingual output and home omission.
  • Bump documented/versioned release markers to v1.3.9-beta (README, Footer, CHANGELOG).

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
app/lib/publish.server.ts Introduces a canonical builtin-nav label map and updates YAML serialization logic for built-ins.
tests/publish.server.test.ts Adds assertions ensuring Spanish labels are emitted for built-ins and home is not serialized.
README.md Updates version badges and beta release text to v1.3.9-beta.
CHANGELOG.md Adds v1.3.9-beta entry describing the Spanish navigation label fix.
app/components/layout/Footer.tsx Updates the displayed app version constant to v1.3.9-beta.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/lib/publish.server.ts
Comment on lines +2487 to +2492
} else if (item.type === "builtin") {
const builtin = BUILTIN_NAV[item.key ?? ""];
if (!builtin) continue; // home / unknown builtins are intentionally not emitted
lines.push(` - title_en: ${yamlQuote(builtin.en)}`);
lines.push(` titulo_es: ${yamlQuote(builtin.es)}`);
lines.push(` url: ${builtin.url}`);
Comment thread app/lib/publish.server.ts Outdated
Comment on lines +2473 to +2476
* Built-in items emit their canonical bilingual labels (see `BUILTIN_NAV`); a
* `home` built-in (or any unknown key) is skipped. Custom page / external items
* are genuinely monolingual, so the user's single label is written into both
* `title_en` and `titulo_es`. Hidden items (visible: false) are excluded.
@juancobo

Copy link
Copy Markdown
Member Author

Thanks — both addressed in 902b973:

  1. Built-in lookup vs inherited keys (buildNavigationYml): the lookup now uses Object.hasOwn(BUILTIN_NAV, key) before indexing, so a key like __proto__ resolves to no entry and is skipped, rather than returning Object.prototype (truthy) and crashing on the undefined label. Added a regression test — "ignores prototype-chain keys (e.g. __proto__) without crashing".

  2. Docstring: corrected — external items emit only title_en (plus the URL and the external flag); only custom page items write the single label into both title_en and titulo_es.

@juancobo juancobo merged commit 9ba6f9d into main Jun 23, 2026
1 check passed
@juancobo juancobo deleted the v1.3.9-beta branch June 23, 2026 13:58
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