Skip to content

Standalone-page <title> keys exist but document.title is never translated (hardcoded English) #49

@kgNatx

Description

@kgNatx

Severity: P3 | Subsystem: i18n-sw | Category: i18n

Location: /home/kyleg/containers/atxfpv.org/skwad/static/changelog.html:6

What

changelog.html:6 (<title>What's New — Skwad</title>), freq-guide.html:6, and usage.html:7 hardcode English <title> text. Matching locale keys CHANGELOG_TITLE, FREQ_GUIDE_TITLE, and USAGE_BROWSER_TITLE exist in all locales but are never applied — translateDOM() only handles data-i18n / placeholder / aria / title (element title attr) / label, and there is no code that sets document.title from a key. So the browser tab/title stays English even when the page body is translated (these pages do load i18n.js and use data-i18n on body elements). Low impact (tab title only; freq-guide/changelog content is largely English regardless), but it is the untranslated-dynamic-string class the review asked about.

Suggested fix

If translated titles are wanted, add a small hook (e.g., a data-i18n-doctitle attribute on a meta/element, or an explicit document.title = t('CHANGELOG_TITLE') in each page after onI18nReady). Otherwise delete the unused *_TITLE keys to remove the false impression they're wired up.

Verification

Confirmed by tracing the full path. (1) changelog.html:6 hardcodes <title>What's New — Skwad</title> with no data-i18n attribute; freq-guide.html:6 and usage.html:7 likewise hardcode English titles. (2) All three pages load /i18n.js (changelog.html:459, freq-guide.html:670, usage.html:318) and use data-i18n on body elements (e.g. CHANGELOG_H1, FREQ_GUIDE_H1, USAGE_TITLE), so the body translates but the tab title does not. (3) translateDOM() in i18n.js (lines 48-65) only iterates [data-i18n], [data-i18n-placeholder], [data-i18n-aria], [data-i18n-title] (element title attr, not document.title), and [data-i18n-label]. There is no data-i18n-doctitle hook. (4) grep across all .html/.js found ZERO assignments to document.title. (5) The keys CHANGELOG_TITLE, FREQ_GUIDE_TITLE, USAGE_BROWSER_TITLE exist in every locale (en.json:323/325/265 plus all 13 other locales) but are never referenced by any code — they are dead keys. So the browser tab stays English even when the page body is translated. Severity P3 is appropriate and not overstated: impact is limited to the browser tab/title text, page content still translates, and changelog/freq-guide body content is largely English regardless. Not a functional or correctness bug.

Filed from the 2026-05-30 multi-agent codebase review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priorityenhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions