From: Antoine Musso Date: Sun, 14 Aug 2005 15:31:50 +0000 (+0000) Subject: work in progress X-Git-Tag: 1.6.0~1978 X-Git-Url: http://git.cyclocoop.org/%7B%7B%20url_for%28%27admin_vote_add%27%29%20%7D%7D?a=commitdiff_plain;h=25e910153c68c819b9efbaa5e9b0f800313e4fd8;p=lhc%2Fweb%2Fwiklou.git work in progress --- diff --git a/maintenance/languages.inc b/maintenance/languages.inc new file mode 100644 index 0000000000..0fcbc6fd1f --- /dev/null +++ b/maintenance/languages.inc @@ -0,0 +1,61 @@ +clear; + $this->loadList(); + } + + function clear() { + $this->list = array(); + $this->messages = array(); + } + + function loadList() { + global $IP; + $this->list = array(); + + // available language files + $dir = opendir("$IP/languages"); + while ($file = readdir($dir)) { + if (preg_match("/Language(.*?)\.php$/", $file, $m)) { + $this->list[] = $m[1]; + } + } + sort($this->list); + + // Cleanup file list + foreach($this->list as $key => $lang) { + if ($lang == 'Utf8' || $lang == '' || $lang == 'Converter') + unset($this->list[$key]); + } + } + + function getList() { return $this->list; } +} + +function getMessages($langcode) { + global $wgAllMessagesEn, $wgSkinNamesEn, $wgNamespaceNamesEn, $wgBookstoreListEn,$wgMagicWordsEn,$wgUserTogglesEn; + + $arr = 'wgAllMessages'.$langcode; + global $$arr; + + if(!isset($$arr)) { + require_once( 'languages/Language'.$langcode.'.php' ); + } + return $$arr; +} + +?>