Skip to content
Browse files

MDL-31040 Correct LTR language issue and inconsistency in display

  • Loading branch information...
1 parent 6d768d0 commit 37b9827f341c4d0f9c2f82a40c4aae946d65dbe9 @andrewnicols andrewnicols committed
Showing with 23 additions and 18 deletions.
  1. +12 −8 course/lib.php
  2. +2 −0 lang/en/moodle.php
  3. +3 −4 lib/ajax/ajaxlib.php
  4. +6 −6 lib/ajax/section_classes.js
View
20 course/lib.php
@@ -3065,11 +3065,12 @@ function make_editing_buttons($mod, $absolute=false, $moveselect=true, $indent=-
$str->duplicate = get_string("duplicate");
$str->hide = get_string("hide");
$str->show = get_string("show");
- $str->clicktochange = get_string("clicktochange");
- $str->forcedmode = get_string("forcedmode");
- $str->groupsnone = get_string("groupsnone");
- $str->groupsseparate = get_string("groupsseparate");
- $str->groupsvisible = get_string("groupsvisible");
+ $str->groupsnone = get_string('clicktochangeinbrackets', 'moodle', get_string("groupsnone"));
+ $str->groupsseparate = get_string('clicktochangeinbrackets', 'moodle', get_string("groupsseparate"));
+ $str->groupsvisible = get_string('clicktochangeinbrackets', 'moodle', get_string("groupsvisible"));
+ $str->forcedgroupsnone = get_string('forcedmodeinbrackets', 'moodle', get_string("groupsnone"));
+ $str->forcedgroupsseparate = get_string('forcedmodeinbrackets', 'moodle', get_string("groupsseparate"));
+ $str->forcedgroupsvisible = get_string('forcedmodeinbrackets', 'moodle', get_string("groupsvisible"));
$sesskey = sesskey();
}
@@ -3103,28 +3104,31 @@ function make_editing_buttons($mod, $absolute=false, $moveselect=true, $indent=-
if ($mod->groupmode !== false) {
if ($mod->groupmode == SEPARATEGROUPS) {
$grouptitle = $str->groupsseparate;
+ $forcedgrouptitle = $str->forcedgroupsseparate;
$groupclass = 'editing_groupsseparate';
$groupimage = $OUTPUT->pix_url('t/groups') . '';
$grouplink = $path.'/mod.php?id='.$mod->id.'&groupmode=0&sesskey='.$sesskey;
} else if ($mod->groupmode == VISIBLEGROUPS) {
$grouptitle = $str->groupsvisible;
+ $forcedgrouptitle = $str->forcedgroupsvisible;
$groupclass = 'editing_groupsvisible';
$groupimage = $OUTPUT->pix_url('t/groupv') . '';
$grouplink = $path.'/mod.php?id='.$mod->id.'&groupmode=1&sesskey='.$sesskey;
} else {
$grouptitle = $str->groupsnone;
+ $forcedgrouptitle = $str->forcedgroupsnone;
$groupclass = 'editing_groupsnone';
$groupimage = $OUTPUT->pix_url('t/groupn') . '';
$grouplink = $path.'/mod.php?id='.$mod->id.'&groupmode=2&sesskey='.$sesskey;
}
if ($mod->groupmodelink) {
- $groupmode = '<a class="'.$groupclass.'" title="'.$grouptitle.' ('.$str->clicktochange.')" href="'.$grouplink.'">'.
+ $groupmode = '<a class="'.$groupclass.'" title="'.$grouptitle.'" href="'.$grouplink.'">'.
'<img src="'.$groupimage.'" class="iconsmall" '.
'alt="'.$grouptitle.'" /></a>';
} else {
- $groupmode = '<img title="'.$grouptitle.' ('.$str->forcedmode.')" '.
+ $groupmode = '<img title="'.$forcedgrouptitle.'"'.
' src="'.$groupimage.'" class="iconsmall" '.
- 'alt="'.$grouptitle.'" />';
+ 'alt="'.$forcedgrouptitle.'" />';
}
} else {
$groupmode = "";
View
2 lang/en/moodle.php
@@ -236,6 +236,7 @@
$string['clickhere'] = 'Click here ...';
$string['clicktohideshow'] = 'Click to expand or collapse';
$string['clicktochange'] = 'Click to change';
+$string['clicktochangeinbrackets'] = '{$a} (Click to change)';
$string['closewindow'] = 'Close this window';
$string['collapseall'] = 'Collapse all';
$string['commentincontext'] = 'Find this comment in context';
@@ -673,6 +674,7 @@
$string['followingrequired'] = 'The following items are required';
$string['force'] = 'Force';
$string['forcedmode'] = 'forced mode';
+$string['forcedmodeinbrackets'] = '{$a} (forced mode)';
$string['forcelanguage'] = 'Force language';
$string['forceno'] = 'Do not force';
$string['forcepasswordchange'] = 'Force password change';
View
7 lib/ajax/ajaxlib.php
@@ -149,10 +149,9 @@ function print_javascript($courseid, $return=false) {
$output .= " main.portal.strings['moveleft']='".addslashes_js(get_string('moveleft'))."';\n";
$output .= " main.portal.strings['moveright']='".addslashes_js(get_string('moveright'))."';\n";
$output .= " main.portal.strings['update']='".addslashes_js(get_string('update'))."';\n";
- $output .= " main.portal.strings['groupsnone']='".addslashes_js(get_string('groupsnone'))."';\n";
- $output .= " main.portal.strings['groupsseparate']='".addslashes_js(get_string('groupsseparate'))."';\n";
- $output .= " main.portal.strings['groupsvisible']='".addslashes_js(get_string('groupsvisible'))."';\n";
- $output .= " main.portal.strings['clicktochange']='".addslashes_js(get_string('clicktochange'))."';\n";
+ $output .= " main.portal.strings['groupsnone']='".addslashes_js(get_string('clicktochangeinbrackets', 'moodle', get_string('groupsnone')))."';\n";
+ $output .= " main.portal.strings['groupsseparate']='".addslashes_js(get_string('clicktochangeinbrackets', 'moodle', get_string('groupsseparate')))."';\n";
+ $output .= " main.portal.strings['groupsvisible']='".addslashes_js(get_string('clicktochangeinbrackets', 'moodle', get_string('groupsvisible')))."';\n";
$output .= " main.portal.strings['deletecheck']='".addslashes_js(get_string('deletecheckfull','','_var_'))."';\n";
$output .= " main.portal.strings['resource']='".addslashes_js(get_string('resource'))."';\n";
$output .= " main.portal.strings['activity']='".addslashes_js(get_string('activity'))."';\n";
View
12 lib/ajax/section_classes.js
@@ -620,9 +620,9 @@ resource_class.prototype.init_buttons = function() {
}
// Language strings.
- var strgroupsnone = main.portal.strings['groupsnone']+' ('+main.portal.strings['clicktochange']+')';
- var strgroupsseparate = main.portal.strings['groupsseparate']+' ('+main.portal.strings['clicktochange']+')';
- var strgroupsvisible = main.portal.strings['groupsvisible']+' ('+main.portal.strings['clicktochange']+')';
+ var strgroupsnone = main.portal.strings['groupsnone'];
+ var strgroupsseparate = main.portal.strings['groupsseparate'];
+ var strgroupsvisible = main.portal.strings['groupsvisible'];
this.commandContainer = commandContainer;
var buttons = commandContainer.getElementsByTagName('a');
@@ -846,13 +846,13 @@ resource_class.prototype.toggle_groupmode = function() {
switch (this.groupmode) {
case 0:
- newtitle = main.portal.strings['groupsnone']+' ('+main.portal.strings['clicktochange']+')';
+ newtitle = main.portal.strings['groupsnone'];
break;
case 1:
- newtitle = main.portal.strings['groupsseparate']+' ('+main.portal.strings['clicktochange']+')';
+ newtitle = main.portal.strings['groupsseparate'];
break;
case 2:
- newtitle = main.portal.strings['groupsvisible']+' ('+main.portal.strings['clicktochange']+')';
+ newtitle = main.portal.strings['groupsvisible'];
break;
}

0 comments on commit 37b9827

Please sign in to comment.
Something went wrong with that request. Please try again.