From 2af587476d8509ddb4d119f61424d82c49b0695e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Tue, 29 Sep 2015 15:22:36 +0200 Subject: [systemstatus] i18n of storage mount error strings --- lang/de/templates/systemstatus/diskstat.json | 4 ++++ lang/en/templates/systemstatus/diskstat.json | 4 ++++ modules/systemstatus.inc.php | 28 ++++++++++++++-------------- templates/systemstatus/diskstat.html | 11 ++++++++++- 4 files changed, 32 insertions(+), 15 deletions(-) diff --git a/lang/de/templates/systemstatus/diskstat.json b/lang/de/templates/systemstatus/diskstat.json index 2f61fd58..59706e26 100644 --- a/lang/de/templates/systemstatus/diskstat.json +++ b/lang/de/templates/systemstatus/diskstat.json @@ -1,6 +1,10 @@ { "lang_capacity": "Kapazit\u00e4t", + "lang_foundStore": "Vorgefunden:", "lang_free": "Frei", + "lang_goToStoreConf": "Zur VM-Store-Konfiguration wechseln", + "lang_storeMissingExpected": "VM-Store nicht eingebunden. Erwartet:", + "lang_storeNotConfigured": "Kein VM-Store konfiguriert!", "lang_systemPartition": "Systempartition", "lang_vmStore": "VM-Speicher", "lang_vmStoreError": "Fehler beim Ermitteln des verf\u00fcgbaren Speicherplatzes am VM-Speicherort. Bitte \u00fcberpr\u00fcfen Sie die Konfiguration." diff --git a/lang/en/templates/systemstatus/diskstat.json b/lang/en/templates/systemstatus/diskstat.json index fafb9187..d7bedfe5 100644 --- a/lang/en/templates/systemstatus/diskstat.json +++ b/lang/en/templates/systemstatus/diskstat.json @@ -1,6 +1,10 @@ { "lang_capacity": "Capacity", + "lang_foundStore": "Found:", "lang_free": "Free", + "lang_goToStoreConf": "Go to VM store configuration", + "lang_storeMissingExpected": "VM store not mounted. Expected:", + "lang_storeNotConfigured": "No VM store configured!", "lang_systemPartition": "System Partition", "lang_vmStore": "VM Store", "lang_vmStoreError": "Error when determining the available disk space on the VM location. Please check the configuration." diff --git a/modules/systemstatus.inc.php b/modules/systemstatus.inc.php index 0106ab9d..253b0849 100644 --- a/modules/systemstatus.inc.php +++ b/modules/systemstatus.inc.php @@ -104,27 +104,27 @@ class Page_SystemStatus extends Page ); } } + $data = array( + 'store' => $storeUsage, + 'system' => $systemUsage + ); // Determine if proper vm store is being used - if ($store === '') - $storeError = false; - else - $storeError = 'VM-Store nicht eingebunden! Erwartet: ' . $store; + if ($store !== '') { + $data['storeMissing'] = $store; + } foreach ($task['data']['list'] as $entry) { - if ($entry['mountPoint'] === CONFIG_VMSTORE_DIR && $store !== $entry['fileSystem']) { - $storeError = 'Falscher VM-Store eingebunden! Erwartet: ' . $store . ' vorgefunden: ' . $entry['fileSystem']; + if ($entry['mountPoint'] !== CONFIG_VMSTORE_DIR) + continue; + if ($store !== $entry['fileSystem']) { + $data['wrongStore'] = $entry['fileSystem']; break; - } elseif ($entry['mountPoint'] === CONFIG_VMSTORE_DIR) { - $storeError = false; } + $data['storeMissing'] = false; } } else { - $storeError = 'Storage not configured'; + $data['notConfigured'] = true; } - echo Render::parse('systemstatus/diskstat', array( - 'store' => $storeUsage, - 'system' => $systemUsage, - 'storeError' => $storeError - )); + echo Render::parse('systemstatus/diskstat', $data); } protected function ajaxAddressList() diff --git a/templates/systemstatus/diskstat.html b/templates/systemstatus/diskstat.html index 019dda1a..218ed8f1 100644 --- a/templates/systemstatus/diskstat.html +++ b/templates/systemstatus/diskstat.html @@ -21,7 +21,16 @@ {{/store}}
-
{{storeError}}
+{{#notConfigured}} +
{{lang_storeNotConfigured}}
+{{/notConfigured}} +{{#storeMissing}} +
{{lang_storeMissingExpected}} {{storeMissing}}
+{{/storeMissing}} +{{#wrongStore}} +
{{lang_foundStore}} {{wrongStore}}
+{{/wrongStore}} +{{lang_goToStoreConf}}