Skip to content

document lang attribute stays at template value instead of following UI language #53

Description

@EurFelux

Symptom

With the UI running in English (i18next initialized with lng: "en", English strings rendered), document.documentElement.lang is still "zh" — the static template value from index.html:2.

Expected

applyHtmlDir(initial) (src/renderer/i18n/index.ts:29) runs at module evaluation and should set <html lang> to the resolved UI language ("en" / "zh-CN"). Observed value "zh" matches neither possible output, so the call either never ran or was overwritten afterwards — needs investigation (probed via CDP on a fresh-userData dev instance, 2026-06-07).

Impact

Small but real: lang drives screen-reader pronunciation and CJK glyph selection (Han unification — lang="zh" biases Chinese glyph forms even when the UI is English). Also a correctness smell: the i18n module's DOM side effect silently not taking effect may hint at an evaluation-order issue worth understanding.

Source: side-finding during #52 investigation (2026-06-07)

Activity

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

    area:uiUI components & design systembugSomething isn't working

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions