From 9ceb2841d81ef23067a9cac75f45c5e9fed480a3 Mon Sep 17 00:00:00 2001 From: Dan Cryer Date: Thu, 4 Dec 2014 10:23:10 +0000 Subject: [PATCH] Initial commit --- PHPCI/Helper/Lang.php | 64 +++++++++++++++++++++++++++++++++++++ PHPCI/Languages/lang.en.php | 14 ++++++++ PHPCI/View/layout.phtml | 11 +++++-- bootstrap.php | 2 ++ public/assets/js/sprintf.js | 4 +++ 5 files changed, 93 insertions(+), 2 deletions(-) create mode 100644 PHPCI/Helper/Lang.php create mode 100644 PHPCI/Languages/lang.en.php create mode 100644 public/assets/js/sprintf.js diff --git a/PHPCI/Helper/Lang.php b/PHPCI/Helper/Lang.php new file mode 100644 index 00000000..44017ae6 --- /dev/null +++ b/PHPCI/Helper/Lang.php @@ -0,0 +1,64 @@ +get('phpci.default_language', 'en'); + self::$strings = self::loadLanguage(); + + if (is_null(self::$strings)) { + self::$language = 'en'; + self::$strings = self::loadLanguage(); + } + } + + protected static function loadLanguage() + { + $langFile = PHPCI_DIR . 'PHPCI/Languages/lang.' . self::$language . '.php'; + + if (!file_exists($langFile)) { + return null; + } + + require_once($langFile); + + if (is_null($strings) || !is_array($strings) || !count($strings)) { + return null; + } + + return $strings; + } +} \ No newline at end of file diff --git a/PHPCI/Languages/lang.en.php b/PHPCI/Languages/lang.en.php new file mode 100644 index 00000000..4dc96d09 --- /dev/null +++ b/PHPCI/Languages/lang.en.php @@ -0,0 +1,14 @@ + 'Toggle Navigation', + 'n_builds_pending' => '%d builds pending', + 'n_builds_running' => '%d builds running', +); \ No newline at end of file diff --git a/PHPCI/View/layout.phtml b/PHPCI/View/layout.phtml index dac44274..dfcea870 100644 --- a/PHPCI/View/layout.phtml +++ b/PHPCI/View/layout.phtml @@ -1,3 +1,6 @@ + @@ -18,6 +21,7 @@ + @@ -26,7 +30,10 @@ - +