even more language migration/fixing

Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann
2022-04-29 10:23:45 +02:00
parent 6116dda9bb
commit 9ab185a71c
8 changed files with 11 additions and 24 deletions

View File

@@ -39,7 +39,6 @@ use Froxlor\UI\Panel\UI;
use Froxlor\UI\Request;
use Froxlor\UI\Response;
use Froxlor\Validate\Validate;
use PDO;
class Ajax
{

View File

@@ -70,6 +70,13 @@ class Language
}
}
// shortcut for identifier with => [title, description]
if (!isset(self::$lng[$identifier]) && isset(self::$lng[$identifier . '.title'])) {
return [
'title' => vsprintf(self::$lng[$identifier . '.title'] ?? $identifier, $arguments),
'description' => vsprintf(self::$lng[$identifier . '.description'] ?? $identifier, $arguments),
];
}
// search by identifier
return vsprintf(self::$lng[$identifier] ?? $identifier, $arguments);
}

View File

@@ -84,20 +84,6 @@ class User
return $returnval;
}
public static function getLanguages()
{
$result_stmt = Database::query("SELECT * FROM `" . TABLE_PANEL_LANGUAGE . "` ");
$languages_array = [];
while ($row = $result_stmt->fetch(PDO::FETCH_ASSOC)) {
if (!isset($languages_array[$row['language']]) && !in_array($row['language'], $languages_array)) {
$languages_array[$row['language']] = html_entity_decode($row['language']);
}
}
return $languages_array;
}
/**
* Function which updates all counters of used resources in panel_admins and panel_customers
*

View File

@@ -35,6 +35,7 @@ if (!file_exists('./userdata.inc.php')) {
die();
}
require_once dirname(__DIR__) . '/lib/userdata.inc.php';
require_once dirname(__DIR__) . '/lib/functions.php';
require_once dirname(__DIR__) . '/lib/tables.inc.php';
// Return response