From 23c06fd694752d52a88d1a9621ac25fed6323c84 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Sun, 16 Dec 2012 02:31:28 +0100 Subject: [PATCH] Grab error message titles from locale file instead of hardcoding them --- frontend/locales/english.lng | 4 +++- frontend/rewrite.php | 6 ++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/frontend/locales/english.lng b/frontend/locales/english.lng index e6328e8..fc922a6 100644 --- a/frontend/locales/english.lng +++ b/frontend/locales/english.lng @@ -70,12 +70,14 @@ menu-admin-users; Users menu-admin-containers; VPSes menu-admin-nodes; Nodes -## Global warnings +## Global warnings and errors error-form; One or more problems occurred. warning-suspended-title; This VPS is suspended warning-suspended-text; You cannot change any configuration or perform any actions on this VPS. If you feel this should not be the case, please contact support. warning-terminated-title; This VPS has been terminated warning-terminated-text; You cannot change any configuration or perform any actions on this VPS, as it is terminated. +error-suspended-title; This VPS is suspended +error-terminated-title; This VPS has been terminated ## VPS overview page title-overview; Overview diff --git a/frontend/rewrite.php b/frontend/rewrite.php index d2636e2..afa4b60 100644 --- a/frontend/rewrite.php +++ b/frontend/rewrite.php @@ -203,17 +203,15 @@ try } catch (ContainerSuspendedException $e) { - /* TODO: Grab error title from locale file? */ $sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array( - 'title' => "Container is suspended", + 'title' => $locale->strings['error-suspended-title'], 'message' => $e->getMessage() )); } catch (ContainerTerminatedException $e) { - /* TODO: Grab error title from locale file? */ $sError .= NewTemplater::Render("{$sTheme}/shared/error/error", $locale->strings, array( - 'title' => "Container is terminated", + 'title' => $locale->strings['error-terminated-title'], 'message' => $e->getMessage() )); }