Allow configuring <html lang> attribute
Nobody has claimed this yet.
- Dominant language
- Haskell
- Stars
- 95
- Forks
- 21
- PR merge metrics
- No merged PRs in 30d
Description
Problem
The Lamdera compiler injects a wrapper <html lang="en"> around the app's index.html, hardcoding the language to English regardless of the actual page language.
This is problematic for:
- SEO: Google uses the
langattribute to understand page language - Accessibility: Screen readers rely on it for pronunciation
- Multi-language apps: Apps serving content in French, Spanish, etc. are incorrectly marked as English
Current behavior
Even if public/index.html specifies <html lang="fr">, the served page contains:
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=5.0, minimum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<style>body { padding: 0; margin: 0; }</style>
<!-- then the user's index.html head content -->
The lang="en" is injected by the compiler/runtime and cannot be overridden.
Expected behavior
Either:
- Respect the
langattribute from the user'sindex.html - Omit the
langattribute entirely and let the user'sindex.htmlcontrol it
Workaround
Currently using a Cloudflare Worker with HTMLRewriter to rewrite the lang attribute for crawlers, but this shouldn't be necessary.
Environment
- Lamdera compiler: latest (March 2026)
- Affects all Lamdera apps serving non-English content
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the Lamdera compiler/runtime entry point that injects the wrapper around public/index.html, then compare it with the user's existing lang attribute. Verify the result with an app whose index.html uses a non-English lang value; done means the served document respects that value or omits the injected attribute.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- haskell
- Domain
- compilers, web-dev
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100