Moodle
  1. Moodle
  2. MDL-8507

Local language pack-name can appear in language code

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.4, 1.7.1, 1.7.2, 1.8
    • Fix Version/s: 1.7.2, 1.8
    • Component/s: Accessibility, Language
    • Labels:
      None
    • Affected Branches:
      MOODLE_16_STABLE, MOODLE_17_STABLE, MOODLE_18_STABLE
    • Fixed Branches:
      MOODLE_17_STABLE, MOODLE_18_STABLE
    • Rank:
      29169

      Description

      If you have a customised language pack, for example, cvs:/lang/en_local_utf8 the HTML tag becomes <html lang="en_local" ..> where it should just be lang="en".

        Activity

        Hide
        Nick Freear added a comment -

        Fixed cvs:/lib/weblib.php function print_header - 1 liner.

        Fixed on HEAD and MOODLE_17_STABLE. Tested for 'en_local_utf8' TO lang="en" (above) and 'zh_cn_utf8' TO lang="zh-cn" (Chinese simplified), as per HTML 4,
        http://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1

        Show
        Nick Freear added a comment - Fixed cvs:/lib/weblib.php function print_header - 1 liner. Fixed on HEAD and MOODLE_17_STABLE. Tested for 'en_local_utf8' TO lang="en" (above) and 'zh_cn_utf8' TO lang="zh-cn" (Chinese simplified), as per HTML 4, http://www.w3.org/TR/html401/struct/dirlang.html#h-8.1.1
        Hide
        Nick Freear added a comment -

        Followup fix (contained in patch) committed to HEAD and 1.8 branches.

        Introduces new function 'get_html_lang', and affects 2 files:
        cvs:/backup/restorelib.php
        cvs:/lib/weblib.php

        Show
        Nick Freear added a comment - Followup fix (contained in patch) committed to HEAD and 1.8 branches. Introduces new function 'get_html_lang', and affects 2 files: cvs:/backup/restorelib.php cvs:/lib/weblib.php
        Hide
        Nick Freear added a comment -

        I've committed another follow-up fix to weblib--get_html_lang to add the "Content-Language" HTTP header - indicates "intended audience" (whereas LANG attribute indicates text-processing language).

        Relevant link, http://www.w3.org/TR/i18n-html-tech-lang/

        Show
        Nick Freear added a comment - I've committed another follow-up fix to weblib--get_html_lang to add the "Content-Language" HTTP header - indicates "intended audience" (whereas LANG attribute indicates text-processing language). Relevant link, http://www.w3.org/TR/i18n-html-tech-lang/

          People

          • Assignee:
            Nick Freear
            Reporter:
            Nick Freear
            Tester:
            Nobody
            Participants:
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: