aboutsummaryrefslogtreecommitdiffstats
path: root/lib.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib.php')
-rw-r--r--lib.php60
1 files changed, 42 insertions, 18 deletions
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 '<style>' . file_get_contents(__DIR__ . '/css/source.css') . '</style>';
+ if ( defined('ALIGNMENT') && constant('ALIGNMENT') == 'Center' ){
+ return '<style>' . file_get_contents(__DIR__ . '/css/source.css') . '</style><style>' . file_get_contents(__DIR__ . '/css/center.css') . '</style>';
+ } else {
+ return '<style>' . file_get_contents(__DIR__ . '/css/source.css') . '</style>';
+ }
}
/**
@@ -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;