Skip to content

Application language and browser language don't match #12486

@mzner

Description

@mzner

Describe the bug

When a user’s browser is set to a language that is not supported by our web application, the application correctly falls back to English for displayed content. However, the <html lang=""> attribute remains set to the unsupported browser language instead of updating to reflect the fallback language (English).

Rationale:
The lang attribute is critical for accessibility, as it informs assistive technologies (e.g., screen readers) about the language of the content. When the lang attribute is incorrect:

  • Screen readers may mispronounce text, leading to a poor experience for visually impaired users.
  • Language-specific features like spell-checking or font rendering may behave incorrectly.

To ensure accessibility and proper functionality, the lang attribute should always reflect the actual language of the content displayed to the user.

Steps to reproduce

  1. Set your browser’s preferred language to a language not supported by the application (e.g., Luxembourgish lb).
  2. Navigate to the web application.
  3. Observe that the UI is displayed in English.
  4. Inspect the <html> tag and note that the lang attribute is still set to the unsupported language (e.g., lang="lb").

Expected behavior

lang attribute is set to English/en

Actual behavior

lang attribute stays Luxembourgish/'lb'

Setup

- Web version:
- oCIS version:
- browser:

OCIS_XXX=somevalue
OCIS_YYY=somevalue
PROXY_XXX=somevalue

Additional context

No response

Metadata

Metadata

Assignees

Type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions