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

Help Issues with non-English languahepacks

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Duplicate
    • Affects Version/s: 1.8
    • Fix Version/s: None
    • Component/s: Language
    • Labels:
      None
    • Affected Branches:
      MOODLE_18_STABLE

      Description

      In Moodle 1.8. many help icons add 'forcelang' with current language of the user. So if you language pack hasn't appropriate file you can't get any help at all!

      To retain old functionality I suggest adding en_utf8 languagepack to search even with 'forcelang' paramater setted, changing line 38 in help.php to
      ===
      $langs = array($forcelang,'en_utf8');
      ===
      Otherwise you need to correct many newly created forms.

      There is also other important issue: non-english help files is often obsolete while english help files usually covers new functionality. I suggest adding button or link to english help files at the end offile in local languagepack, so the users can get extended help in english if they want without changing their preferred language to englis. To do so you need to add lines to the help.php
      ===
      if($helpfound && $lang!='en_utf8')
      print_english_help_button($file,$module);
      ===
      on the line 130 before line "close_window_button();" and add this function to the end of file^
      ===
      //print button to get original version of the help
      function print_english_help_button($file,$module){
      global $CFG;
      //ugly hack to get centered button
      echo '<div class="closewindow">' . "\n";
      $options=array();
      $options['module']=$module;
      $options['file']=$file;
      $options['forcelang']='en_utf8';
      print_single_button($CFG->wwwroot.'/help.php',$options, 'Original Help');
      echo '</div>' . "\n";
      }
      ===
      Because button always shows you English text I see no reason to use language packs to get translation to the caption of the button, but you can put it in the strings if you want.

      I attach modified help.php file with any changes marked as ///////////////////modified
      Please check this in into the cvs to help other peoples.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              poltawski Dan Poltawski
              Reporter:
              oa_sychev Oleg Sychev
              Tester:
              Nobody Nobody
              Participants:
              Component watchers:
              David Mudrák (@mudrd8mz), Helen Foster, Víctor Déniz Falcón
              Votes:
              4 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: