Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-80185

Invalid language attribute on html tag for languages such as en_wp and de_kids

XMLWordPrintable

    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MOODLE_401_STABLE, MOODLE_402_STABLE, MOODLE_403_STABLE
    • MDL-80185-401
    • MDL-80185-403
    • Hide
      1. Log in as admin
      2. Navigate to General > Language > Language packs in site administration
      3. Install the following language packs:
        • German (kids) de_kids
        • English (United States) en_us
      4. Log out
      5. Navigate to login page
      6. Select English (United States) from the language menu
      7. Run WAVE accessibility tool on the page
      8. Confirm there are no warnings about invalid langs
      9. Inspect page DOM, confirm presence of <html ... lang="en"
      10. Select Deutsch (kids) from the language menu
      11. Run WAVE accessibility tool on the page
      12. Confirm there are no warnings about invalid langs
      13. Inspect page DOM, confirm presence of <html ... lang="de"
      Show
      Log in as admin Navigate to General > Language > Language packs in site administration Install the following language packs: German (kids) de_kids English (United States) en_us Log out Navigate to login page Select English (United States) from the language menu Run WAVE accessibility tool on the page Confirm there are no warnings about invalid langs Inspect page DOM, confirm presence of <html ... lang="en" Select Deutsch (kids) from the language menu Run WAVE accessibility tool on the page Confirm there are no warnings about invalid langs Inspect page DOM, confirm presence of <html ... lang="de"
    • WP Sprint 2023-I4.2 (Clones)

      This issue was detected during accessibility audit on learner-facing pages in Workplace performed in August-September 2023 by AbleDocs.

      Invalid Language attribute

      The LANG attribute "en-wp" is not valid as "wp" is not a valid ISO country code

      By setting the appropriate language attribute it allows screen readers to pronounce words correctly

      Recommendation from AbleDocs:
      Set to a valid English subtype, en-AU or en-CA for example. If this website may be used in multiple countries either set the LANG to just "en" or have it determine the country code per organization

      List of valid languages: https://www.w3docs.com/learn-html/html-language-codes.html

      Example failures

      WAVE

      Nu Validator

      Error: Bad value de-kids for attribute lang on element html: Bad script subtag.
       
      From line 1, column 16; to line 3, column 51
       
      TYPE html>↩↩<html  dir="ltr" lang="de-kids" xml:lang="de-kids">↩<head
       
      Error: Bad value de_du for attribute lang on element a: The language subtag de_du is not a valid language subtag.
       
      From line 113, column 97; to line 113, column 287
       
                <a href="http://localhost:8000/login/index.php?lang=de_du" class="dropdown-item menu-action" data-lang="de_du" lang="de_du" role="menuitem" tabindex="-1" aria-labelledby="actionmenuaction-2">
      

            pholden Paul Holden
            marina Marina Glancy
            Pedro Jordao Pedro Jordao
            Sara Arjona (@sarjona) Sara Arjona (@sarjona)
            Ron Carl Alfon Yu Ron Carl Alfon Yu
            Votes:
            0 Vote for this issue
            Watchers:
            17 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - 0 minutes
                0m
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours, 35 minutes
                3h 35m

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.