Skip to content
Permalink
Browse files

translator.php -> keys do matter, no array_shift...

  • Loading branch information...
NB-Core committed Jul 15, 2019
1 parent e335627 commit 43bcd0718ffb97e9c42e82db06371d75812dd1f1
Showing with 10 additions and 5 deletions.
  1. +9 −4 lib/translator.php
  2. +1 −1 modules.php
@@ -94,9 +94,13 @@ function sprintf_translate(){
tlschema();
}
}
$translate_array = $args;
array_shift($translate_array);//skip the first entry which is the output text
foreach ($translate_array as $key=>$val) {
//skip the first entry which is the output text
$skipped = false;
foreach ($args as $key=>$val) {
if (!$skipped) {
$skipped = true;
continue;
}
if (is_array($val)){
//When passed a sub-array this represents an independant
//translation to happen then be inserted in the master string.
@@ -106,8 +110,9 @@ function sprintf_translate(){
ob_start();
if (is_array($args) && count($args)>0) {
//if it is an array
//which it should be
$return = call_user_func_array("sprintf",$args);
} else $return = $args;
} else $return=$args;
$err = ob_get_contents();
ob_end_clean();
if ($err > ""){
@@ -258,7 +258,7 @@
for ($a=0;$a<count($moduleinfo);$a++) {
$i=$numberarray[$a];
rawoutput("<tr class='".($i%2?"trlight":"trdark")."'>");
if ($moduleinfo[$i]['invalid']===true) {
if (isset($moduleinfo[$i]['invalid']) && $moduleinfo[$i]['invalid']===true) {
rawoutput("<td></td><td nowrap valign='top'>");
output("Not installable");
rawoutput("</td>");

0 comments on commit 43bcd07

Please sign in to comment.
You can’t perform that action at this time.