]> git.joonet.de Git - adminer.git/commitdiff
Allow using lang() in plugin with single language Adminer version
authorJakub Vrana <jakub@vrana.cz>
Sun, 28 Apr 2013 06:36:43 +0000 (23:36 -0700)
committerJakub Vrana <jakub@vrana.cz>
Sun, 28 Apr 2013 06:36:43 +0000 (23:36 -0700)
compile.php

index e8da3b76a6a3b0276d40dbeccedbf9dc7375132c..39a2c59c392a40cb4003f44b6e08965a32569bda 100755 (executable)
@@ -50,10 +50,13 @@ function put_file($match) {
        return '$_SESSION[lang]';
 }
 
-function lang(\$translation, \$number) {
-       \$pos = $match2[2]\t\t: " . (preg_match("~\\\$LANG == '$_SESSION[lang]'.* \\? (.+)\n~U", $match2[1], $match3) ? $match3[1] : "1") . '
-       );
-       $translation = str_replace("%d", "%s", $translation[$pos]);
+function lang(\$translation, \$number = 0) {
+       if (is_array(\$translation)) {
+               \$pos = $match2[2]\t\t\t: " . (preg_match("~\\\$LANG == '$_SESSION[lang]'.* \\? (.+)\n~U", $match2[1], $match3) ? $match3[1] : "1") . '
+               );
+               $translation = $translation[$pos];
+       }
+       $translation = str_replace("%d", "%s", $translation);
        $number = number_format($number, 0, ".", lang(\',\'));
        return sprintf($translation, $number);
 }