lamdera / lamdera/compiler

Allow configuring <html lang> attribute

Open
#84 1 comment 2 reactions 0 assignees View on GitHub

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 lang attribute 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:

  1. Respect the lang attribute from the user's index.html
  2. Omit the lang attribute entirely and let the user's index.html control 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.