diff --git a/admin/lang.php b/admin/lang.php index 1c737dac33b..78c45952498 100644 --- a/admin/lang.php +++ b/admin/lang.php @@ -46,8 +46,12 @@ $strfilecreated = get_string('filecreated', 'admin'); $strprev = get_string('previous'); $strnext = get_string('next'); - $strlocalstringcustomization = 'Local string customization'; // TODO / FIXME - $strlangpackmaintaining = 'Language pack maintaining'; // TODO / FIXME + $strlocalstringcustomization = 'Local string customization'; // TODO / FIXME + $strlangpackmaintaining = 'Language pack maintaining'; // TODO / FIXME + $strnomissingstrings = 'No missing strings'; // TODO / FIXME + // TODO/FIXME add into en_utf8/admin.php: + // $string['numberofmissingstrings'] = 'Number of missing strings: $a'; + $currentlang = current_language(); switch ($mode) { @@ -343,11 +347,7 @@ } error_reporting($CFG->debug); - print_heading("$currentfile", "", 4); - if (LANG_DISPLAY_MISSING_LINKS && $editable) { - print_heading(''.$strgotofirst.'', "", 4); - } - + $o = ''; // stores the HTML output to be echo-ed unset($string); include("$enlangdir/$currentfile"); $enstring = $string; @@ -368,36 +368,36 @@ @include("$langdir/$currentfile"); if ($editable) { - echo "
"; - echo '
'; + $o .= ""; + $o .= '
'; } - echo ""; + $o .= "
"; $linescounter = 0; $missingcounter = 0; foreach ($enstring as $key => $envalue) { $linescounter++ ; if (LANG_SUBMIT_REPEAT && $editable && $linescounter % LANG_SUBMIT_REPEAT_EVERY == 0) { - echo ''; + $o .= ''; } $envalue = nl2br(htmlspecialchars($envalue)); $envalue = preg_replace('/(\$a\-\>[a-zA-Z0-9]*|\$a)/', '$0', $envalue); // Make variables bold. $envalue = str_replace("%%","%",$envalue); $envalue = str_replace("\\","",$envalue); // Delete all slashes - echo "\n\n".''; - echo ''."\n"; + $o .= '">'; + $o .= ''."\n"; // Missing array keys are not bugs here but missing strings error_reporting(E_ALL ^ E_NOTICE); @@ -447,7 +447,7 @@ } if ($editable) { - echo ''; + $o .= $missingnext . ''; } else { - echo ''; + $o .= ''; } - echo ''."\n"; + $o .= ''."\n"; } if ($editable) { - echo ''; + $o .= ''; } - echo '
 
'; - echo ' '; - echo '
 
 
'; + $o .= ''; + $o .= '
 
'; - echo ''.$envalue.''; - echo '
'."\n"; - echo ''.$key.''; - echo '
'; + $o .= ''.$envalue.''; + $o .= '
'."\n"; + $o .= ''.$key.''; + $o .= '
'. $missingprev . $missingtarget."\n"; + $o .= ''. $missingprev . $missingtarget."\n"; if (isset($string[$key])) { $valuelen = strlen($value); } else { @@ -456,37 +456,49 @@ $cols=40; if (strstr($value, "\r") or strstr($value, "\n") or $valuelen > $cols) { $rows = ceil($valuelen / $cols); - echo ''."\n"; + $o .= ''."\n"; } else { if ($valuelen) { $cols = $valuelen + 5; } - echo ''; + $o .= ''; } if ($value2 <> '' && $value <> $value2) { - echo '
'.$value2.''; + $o .= '
'.$value2.''; } - echo $missingnext . '
'.$value.''.$value.'
 
'; - echo ''; - echo ' '; - echo ' '; - echo ' '; - echo '
 
'; + $o .= ''; + $o .= ''; + $o .= ''; + $o .= ''; + $o .= '
'; + $o .= ''; if ($editable) { - echo '
'; - echo ''; + $o .= '
'; + $o .= ''; } + if (LANG_DISPLAY_MISSING_LINKS) { + if ($missingcounter > 0) { + print_heading(get_string('numberofmissingstrings', 'admin', $missingcounter), '', 4); + if ($editable) { + print_heading(''.$strgotofirst.'', "", 4); + } + } else { + print_heading($strnomissingstrings, '', 4, 'notifysuccess'); + } + } + echo $o; + } else { // no $currentfile specified // no useful information to display - maybe some help? instructions?