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 @@ - +