Skip to content

Flutter Web: Identify any changes in language on a page by using the lang attribute (Accessibility) #162324

Closed

Description

@jcollins-disney

Use case

The lang attribute is used to identify any changes in language on a page to ensure that user agents can correctly present phrases, passages, and in some cases words written in multiple languages.

Proposal

Add the lang attribute to the list of semantics flags on all Flutter component types/widgets. The first two characters of a language code defines the language of the Web page, and the last two characters define the country. For example English and United States are entered as "en-US".

Valid values for language and country codes can be found at ISO 639-1 Language Codes and ISO Country Codes.

Example on a page where <html lang="en-US">:
<div>The weather is perfect today, <span lang="es-MX">¡qué bueno!</span></div>

Activity

  1. added
    in triagePresently being triaged by the triage team
    c: new featureNothing broken; request for a new capability
    a: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)
    platform-webWeb applications specifically
    c: proposalA detailed proposal for a change to Flutter
    team-webOwned by Web platform team
    fyi-accessibilityFor the attention of Framework Accessibility team
    and removed
    in triagePresently being triaged by the triage team
    on Jan 29, 2025
  2. yjbanov commented on Feb 5, 2025

    @yjbanov
    Contributor

    The Text widget does have a locale field. However, it's not wired up to semantics. We'll need to investigate this.

  3. added
    P2Important issues not at the top of the work list
    triaged-webTriaged by Web platform team
    on Feb 5, 2025
  4. chunhtai commented on Feb 5, 2025

    @chunhtai
    Contributor

    TextSpan can provide locale to it, and it will be translate into SemanticsProperties.attributedLabel

  5. github-actions commented on Aug 7, 2025

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  6. locked as resolved and limited conversation to collaborators on Aug 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: accessibilityAccessibility, e.g. VoiceOver or TalkBack. (aka a11y)c: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Fluttercustomer: castawayplatform-webWeb applications specificallyteam-webOwned by Web platform teamtriaged-webTriaged by Web platform team

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions