Moodle

Help Issues with non-English languahepacks

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor 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.

Issue Links

Activity

Hide
Koen Roggemans added a comment -

It works for me - I get English if a help file is missing in a language pack.
Which language are you talking about?

Show
Koen Roggemans added a comment - It works for me - I get English if a help file is missing in a language pack. Which language are you talking about?
Hide
Oleg Sychev added a comment -

Personally I use Russian language, but this issue isn't language specific.

As far as I can tell, help buttons change it's behavour under 'Force language' course settings.
In Moodle 1.6. it doesn't affect help (help buttons hasn't 'force_lang' parameter), which make sense: help system already known very well how to react to the current language.
In Moodle 1.8. help buttons use 'force_lang' if course has forced language which, considering current state of the help.php, effectively preventing user (even teacher or admin)from getting any help but from this languagepack.

So you must modify either help system or interface library to retain old behavour. I consider remove 'force_lang' parameter from help.php at all: in current state it doing nothing useful, only harm: it doesn't even show help from the local languagepack of this language.

Show
Oleg Sychev added a comment - Personally I use Russian language, but this issue isn't language specific. As far as I can tell, help buttons change it's behavour under 'Force language' course settings. In Moodle 1.6. it doesn't affect help (help buttons hasn't 'force_lang' parameter), which make sense: help system already known very well how to react to the current language. In Moodle 1.8. help buttons use 'force_lang' if course has forced language which, considering current state of the help.php, effectively preventing user (even teacher or admin)from getting any help but from this languagepack. So you must modify either help system or interface library to retain old behavour. I consider remove 'force_lang' parameter from help.php at all: in current state it doing nothing useful, only harm: it doesn't even show help from the local languagepack of this language.
Hide
Artem Andreev added a comment -

What about fixes in CVS?

Show
Artem Andreev added a comment - What about fixes in CVS?
Hide
Koen Roggemans added a comment -

Apparently the behaviour of help files is changed in force_lang environment, which prevents the system to fallback to English to fail.

Show
Koen Roggemans added a comment - Apparently the behaviour of help files is changed in force_lang environment, which prevents the system to fallback to English to fail.
Hide
Artem Andreev added a comment -

Hmmm, may be, but for help files it sounds some strange. And strings have been searched in en_utf8 with force_lang=<non_en_lang>...
What about button or link to original english help files?

Show
Artem Andreev added a comment - Hmmm, may be, but for help files it sounds some strange. And strings have been searched in en_utf8 with force_lang=<non_en_lang>... What about button or link to original english help files?
Hide
Oleg Sychev added a comment -

Please, someone who has rights, mark this issue as 1.9beta too, so it can be fixed in Bugathon!

Show
Oleg Sychev added a comment - Please, someone who has rights, mark this issue as 1.9beta too, so it can be fixed in Bugathon!
Hide
Dan Poltawski added a comment -

Hi, I'm closing this issue. It was fixed in MDL-8853 in 1.7 and above.

Show
Dan Poltawski added a comment - Hi, I'm closing this issue. It was fixed in MDL-8853 in 1.7 and above.

People

Vote (4)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: