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

Help links get accidentally translated and become broken

XMLWordPrintable

    • MOODLE_402_STABLE, MOODLE_403_STABLE
    • Hide
      1. First do it in English so you know where the UI elements are (unless you speak Estonian)
      2. Install Estonian (et) language and switch to it
      3. Open a course in edit mode
      4. Click "Add an activity or resource"
      5. Click on information icon next to the "Book" module
      6. Make sure the link "More help" leads to an existing page in the documentation
      7. Click on the button to create "Book" module
      8. On the module settings form click on the help icon next to the header
      9. Make sure the link "More help" in the help text leads to an existing page in the documentation
      Show
      First do it in English so you know where the UI elements are (unless you speak Estonian) Install Estonian (et) language and switch to it Open a course in edit mode Click "Add an activity or resource" Click on information icon next to the "Book" module Make sure the link "More help" leads to an existing page in the documentation Click on the button to create "Book" module On the module settings form click on the help icon next to the header Make sure the link "More help" in the help text leads to an existing page in the documentation

      Since I did a big research already while triaging MDL-80579 , I'm going to summarise it and create a new issue for it.

      Moodle has this ancient API displaying help with links that is invoked something like this:

      $OUTPUT->heading_with_help($pageheading, 'modulename', $module->name, 'monologo');
      

      If you look at the source code, it looks for the string ending with '_link' and if it is present, adds a docs link to the end of the help text.

      For example, for mod_book the language file looks like this:

      string['modulename'] = 'Book';
      $string['modulename_help'] = 'The book module enables a teacher to create a multi-page resource in a book-like format, with chapters and subchapters. Books can contain media files as well as text and are useful for displaying lengthy passages of information which can be broken down into sections.
       
      A book may be used
       
      * To display reading material for individual modules of study
      * As a staff departmental handbook
      * As a showcase portfolio of student work';
      $string['modulename_link'] = 'mod/book/view';
      

      and the help looks like this:

      The docs link is formed as:

      "https://docs.moodle.org/" + current_version + "/" + current_language + "/" + string_value
      

      and for the mod_book it will be https://docs.moodle.org/404/en/mod/book/view which has redirection to the correct docs page. There is no need to translate the link value, because the language is already included in the URL. For example, URL in Spanish will be https://docs.moodle.org/404/es/mod/book/view and it has the correct redirection to the documentation page in Spanish.

      Translators can accidentally translate the strings like 'modulename_link' and not notice that they can be broken. It looks like these strings were once excluded from AMOS but not anymore.

      Reproduction instructions:

      • Install Estonian (et) language (where this string is translated)
      • In a course add an instance of "Book" module and on the module settings form click on the help icon next to the activity name
      • You will see a link to https://docs.moodle.org/404/et/moodul/raamat/vaade that does not exist

            Unassigned Unassigned
            marina Marina Glancy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

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