Fix SettingsController for new translations table structure

This commit is contained in:
infosave2007
2025-11-08 18:16:44 +03:00
parent 86620c6307
commit 94e13b82e9
+3 -3
View File
@@ -301,15 +301,15 @@ class SettingsController {
$stmt = $this->pdo->query("SELECT * FROM languages ORDER BY code");
$languages = $stmt->fetchAll();
// Get total translation keys count
$stmt = $this->pdo->query("SELECT COUNT(DISTINCT translation_key) as count FROM translations WHERE language_code = 'en'");
// Get total translation keys count (distinct category + key_name combinations)
$stmt = $this->pdo->query("SELECT COUNT(DISTINCT CONCAT(category, '.', key_name)) as count FROM translations WHERE locale = 'en'");
$totalKeys = $stmt->fetch();
$totalCount = $totalKeys['count'];
$stats = [];
foreach ($languages as $lang) {
$stmt = $this->pdo->prepare(
"SELECT COUNT(*) as count FROM translations WHERE language_code = ? AND translation_value IS NOT NULL AND translation_value != ''"
"SELECT COUNT(*) as count FROM translations WHERE locale = ? AND translation IS NOT NULL AND translation != ''"
);
$stmt->execute([$lang['code']]);
$translated = $stmt->fetch();