Browse Source

Prevent langauge translation issues with acronym.

Should not be more than 2chars.
MOODLE_37_STABLE
Dan Marsden 4 years ago
parent
commit
e027c1f6cd
  1. 4
      db/install.php

4
db/install.php

@ -36,6 +36,10 @@ function xmldb_attendance_install() {
$rec = new stdClass; $rec = new stdClass;
$rec->attendanceid = 0; $rec->attendanceid = 0;
$rec->acronym = get_string($k.'acronym', 'attendance'); $rec->acronym = get_string($k.'acronym', 'attendance');
// Sanity check - if language translation uses more than the allowed 2 chars.
if (mb_strlen($rec->acronym) > 2) {
$rec->acronym = $k;
}
$rec->description = get_string($k.'full', 'attendance'); $rec->description = get_string($k.'full', 'attendance');
$rec->grade = $v; $rec->grade = $v;
$rec->visible = 1; $rec->visible = 1;

Loading…
Cancel
Save