From b3bde618c1c24f3591f4a638b32aed3f7fd2829d Mon Sep 17 00:00:00 2001 From: Manuel Hiebel Date: Sun, 8 Jun 2014 15:17:54 +0000 Subject: sync nav --- lib.php | 60 ++++++++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 18 deletions(-) (limited to 'lib.php') diff --git a/lib.php b/lib.php index 064435c..c3377d3 100644 --- a/lib.php +++ b/lib.php @@ -18,6 +18,41 @@ */ // definition +require_once('php-mo.php'); + +// languages for home +$langs = array( + 'ast' => 'Asturianu', + 'ca' => 'Català', + 'cs' => 'Čeština', + 'de' => 'Deutsch', + 'el' => 'Ελληνικά', + 'en' => 'English', + 'eo' => 'Esperanto', + 'es' => 'Español', + 'et' => 'Eesti', + 'fi' => 'Suomeksi', + 'fr' => 'Français', + 'id' => 'Bahasa Indonesia', + 'it' => 'Italiano', + 'lv' => 'Latviešu', + 'nb' => 'Bokmål', + 'nl' => 'Nederlands', + 'pl' => 'Polski', + 'pt' => 'Português', + 'pt-br' => 'Português do Brasil', + 'ro' => 'Română', + 'ru' => 'Русский', + 'sl' => 'Slovenščina', + 'sq' => 'Gjuha shqipe', + 'sv' => 'Svenska', + 'tr' => 'Türkçe', + 'uk' => 'Українська', + 'ur' => 'اردو', + 'zh-cn' => '简体中文', + 'zh-tw' => '正體中文' +); + class NCache { function __construct() { } @@ -154,7 +189,6 @@ class l10n } if (file_exists($po_file)) { - require_once('langs/php-mo.php'); $dictionary = phpmo_parse_po_file($po_file); foreach ($dictionary as $key => $value) { @@ -282,7 +316,11 @@ function _mgnav_html($wrap = false, $lang = 'en', $inject = null, $vhost = 'www. */ function _mgnav_style() { - return ''; + if ( defined('ALIGNMENT') && constant('ALIGNMENT') == 'Center' ){ + return ''; + } else { + return ''; + } } /** @@ -294,22 +332,8 @@ function _lang_check($s = null) return 'en'; } - $supported = array( - 'ast', - 'cs', - 'de', - 'el', 'en', 'eo', 'es', 'et', - 'fi', 'fr', - 'id', 'it', - 'lv', - 'nb', 'nl', - 'pl', 'pt', 'pt-br', - 'ro', 'ru', - 'sl', 'sv', - 'tr', - 'uk', 'ur', - 'zh-cn', 'zh-tw' - ); + global $langs; + $supported = array_keys($langs); if (in_array($s, $supported)) return $s; -- cgit v1.2.1