Skip to content

fix(build): static site hardcodes <html lang="en"> ignoring --lang #470

Closed

Description

@sripwoud

cook build --lang fr-FR renders UI strings in French (Recettes, Rechercher, Ingrédients) and emits the sitemap under /fr/, but every generated page hardcodes lang="en" on the <html> element.

Impact

  • Screen readers select the wrong pronunciation voice for a fully French page.
  • Search engines get a contradictory language signal: lang="en" vs French content and /fr/ sitemap URLs.

Repro

cook build --lang fr-FR
grep -o '<html[^>]*lang="[^"]*"' dist/fr/index.html dist/fr/recipe/carbonara.html
# → lang="en" on both, while the build log reports "language: fr-FR"

Reproduced on cookcli 0.34.0.

Fix location

templates/base.html:2 hardcodes <html lang="en">. It should be wired to the same LanguageIdentifier that --lang already resolves (parse_lang_arg in src/build/mod.rs), e.g. <html lang="{{ lang }}">.

Done when

  • Generated pages carry the resolved language on <html lang>.

Happy to file a PR for this.

Activity

  1. added a commit that references this issue on Sep 1, 2026
    1c13d44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions