Repository navigation
fix(build): wire resolved --lang to <html lang> attribute - #472
Merged
Merged
Conversation
base.html hardcoded lang="en", contradicting French/German content and the /fr/ sitemap: screen readers picked the wrong voice and search engines got a conflicting language signal. Bind <html lang> to the Tr locale already threaded through every template. Ungate Tr::lang_string so the static-site build (no server feature) can read it; the server build already used it in preferences.html. Closes cooklang#470
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
cook build --lang fr-FRrenders French UI (Recettes, Rechercher) and a/fr/sitemap, but every page shippedlang="en"on<html>— screen readers picked the wrong voice and search engines got a contradictory language signal.Fix
templates/base.htmlnow binds<html lang="{{ tr.lang_string() }}">to theTrlocale already threaded through every template — the sameLanguageIdentifier--langresolves.Tr::lang_stringwas#[cfg(feature = "server")]; ungated so the static-site build (noserverfeature) reads it too. The server build already used it inpreferences.html.Verify
Test plan
build_lang_arg_sets_html_lang_attribute— assertslang="fr-FR"on index + recipe pages, absence of hardcodedlang="en"cargo test),cargo clippyclean,cargo fmtCloses #470