'afrikaans', // ISO-8859-1 'sq' => 'albanian', // ISO-8859-1 'ar' => 'arabic', // 1256 'ar-dz' => 'arabic', // algeria 'ar-bh' => 'arabic', // bahrain 'ar-eg' => 'arabic', // egypt 'ar-iq' => 'arabic', // iraq 'ar-jo' => 'arabic', // jordan 'ar-kw' => 'arabic', // kuwait 'ar-lb' => 'arabic', // lebanon 'ar-ly' => 'arabic', // libya 'ar-ma' => 'arabic', // morocco 'ar-om' => 'arabic', // oman 'ar-qa' => 'arabic', // qatar 'ar-sa' => 'arabic', // Saudi Arabia 'ar-sy' => 'arabic', // syria 'ar-tn' => 'arabic', // tunisia 'ar-ae' => 'arabic', // U.A.E 'ar-ye' => 'arabic', // yemen 'hy' => 'armenian', 'ast' => 'asturian', 'eu' => 'basque', 'be' => 'belarusian', 'bs' => 'bosanski',//bosnian -bosanski is nuke lang name 'bg' => 'bulgarian', 'ca' => 'catala',//catalan- catala is nuke lang name // ISO-8859-1 'zh' => 'chinese', 'zh-cn' => 'chinese', // China 'zh-hk' => 'chinese', // Hong Kong 'zh-sg' => 'chinese', // Singapore 'zh-tw' => 'chinese', // Taiwan 'hr' => 'croatian', // 1250 'cs' => 'czech', 'da' => 'danish', // ISO-8859-1 'nl' => 'dutch', // ISO-8859-1 'nl-be' => 'dutch', // Belgium 'en' => 'english', 'en-au' => 'english', // Australia 'en-bz' => 'english', // Belize 'en-ca' => 'english', // Canada 'en-ie' => 'english', // Ireland 'en-jm' => 'english', // Jamaica 'en-nz' => 'english', // New Zealand 'en-ph' => 'english', // Philippines 'en-za' => 'english', // South Africa 'en-tt' => 'english', // Trinidad 'en-gb' => 'english', // United Kingdom 'en-us' => 'english', // United States 'en-zw' => 'english', // Zimbabwe 'eo' => 'esperanto', 'et' => 'estonian', 'eu' => 'euraska', // ISO-8859-1 'fo' => 'faeroese', 'fi' => 'finnish', // ISO-8859-1 'fr' => 'french', // ISO-8859-1 'fr-be' => 'french', // Belgium 'fr-ca' => 'french', // Canada 'fr-fr' => 'french', // France 'fr-lu' => 'french', // Luxembourg 'fr-mc' => 'french', // Monaco 'fr-ch' => 'french', // Switzerland 'gl' => 'galego', //galician- galego is nuke lang name // ISO-8859-1 'ka' => 'georgian', 'de' => 'german', // ISO-8859-1 'de-at' => 'german', // Austria 'de-de' => 'german', // Germany 'de-li' => 'german', // Liechtenstein 'de-lu' => 'german', // Luxembourg 'de-ch' => 'german', // Switzerland 'el' => 'greek', // ISO-8859-7 'he' => 'hebrew', 'hu' => 'hungarian', // ISO-8859-2 'is' => 'icelandic', // ISO-8859-1 'id' => 'indonesian', // ISO-8859-1 'ga' => 'irish', 'it' => 'italian', // ISO-8859-1 'it-ch' => 'italian', // Switzerland 'ja' => 'japan', 'ko' => 'korean', 'ko-kp' => 'korean', // North Korea 'ko-kr' => 'korean', // South Korea 'ku' => 'kurdish', // 1254 'lv' => 'latavian', 'lt' => 'lithuanian', // 1257 'mk' => 'macedonian', // 1251 'ms' => 'malay', 'no' => 'norwegian', // ISO-8859-1 'nb' => 'norwegian', //norwegian bokmal 'nn' => 'norwegian nynorsk', 'pl' => 'polish', // ISO-8859-2 'pt-br' => 'brazilian', // Brazil 'pt' => 'portuguese', // 28591, Latin-I, iso-8859-1 'ro' => 'romanian', // 28592, Central Europe, iso-8859-2 'ru' => 'russian', // 1251 ANSI 'gd' => 'scots gealic', 'sr' => 'serbian', 'sk' => 'slovak', // 1250 ANSI 'sl' => 'slovenian', // 28592, Central Europe, iso-8859-2 'es' => 'spanish', // 28591, Latin-I, iso-8859-1 'es-ar' => 'spanish', // Argentina 'es-bo' => 'spanish', // Bolivia 'es-cl' => 'spanish', // Chile 'es-co' => 'spanish', // Colombia 'es-cr' => 'spanish', // Costa Rica 'es-do' => 'spanish', // Dominican Republic 'es-ec' => 'spanish', // Ecuador 'es-sv' => 'spanish', // El Salvador 'es-gt' => 'spanish', // Guatemala 'es-hn' => 'spanish', // Honduras 'es-mx' => 'spanish', // Mexico 'es-ni' => 'spanish', // Nicaragua 'es-pa' => 'spanish', // Panama 'es-py' => 'spanish', // Paraguay 'es-pe' => 'spanish', // Peru 'es-pr' => 'spanish', // Puerto Rico 'es-es' => 'spanish', // Spain 'es-uy' => 'spanish', // Uruguay 'es-ve' => 'spanish', // Venezuela 'sv' => 'swedish', 'sv-fi' => 'swedish', // Finland 'sw' => 'swahili', 'th' => 'thai', // 874 'tr' => 'turkish', // 1254 'ug' => 'uighur', // ISO-8859-1, 28591 'uk' => 'ukrainian', 'vi' => 'vietnamese', 'cy' => 'welsh', 'xh' => 'xhosa', 'yi' => 'yiddish', 'zu' => 'zulu' ); /* $char_accept= 0; $accepted_charsets = explode(',', strtolower(getenv('HTTP_ACCEPT_CHARSET'))); foreach ($accepted_charsets as $browser_charset) { echo $browser_charset.'== '._CHARSET.' '."\t"; if (($browser_charset == _CHARSET)||($browser_charset == '*')){ $char_accept= true; echo $browser_charset.'== '._CHARSET.' '."\t"; } } if(!strstr($_SERVER["HTTP_USER_AGENT"],"MSIE")) { // IE doesn't send HTTP_ACCEPT_CHARSET $char_accept = 0; $accepted_charsets = explode(',', strtolower(getenv('HTTP_ACCEPT_CHARSET'))); foreach ($accepted_charsets as $browser_charset) { if ((strtolower($browser_charset) == strtolower(_CHARSET))||($browser_charset == '*')){ $char_accept = 1; break; } } } //end if not IE */ /************************************************************************************/ /* */ /* string get_langcode(string language_name,[bool]) */ /* */ /* When optional boolean is true sets a define for html tag */ /* otherwise returns language code to be used in any html tag based */ /* on the browsers language code. NEW(c) Akamu NLI */ /* */ /************************************************************************************/ function get_langcode($thislang,$set_define=0){ /* NEW Akamu */ global $languages; foreach ($languages as $shortlang => $longlang) { if ($longlang == $thislang) { if ($set_define) { define('_LANGCODE', $shortlang); } return $shortlang; } } } /************************************************************************************/ /* */ /* string detect_lang(string language_name) */ /* */ /* returns by reference the language of choice */ /* based on their browser language setting. NEW(c) Akamu NLI */ /* */ /************************************************************************************/ function detect_lang(&$language) { global $languages; $accepted_languages = explode(',', strtolower(getenv('HTTP_ACCEPT_LANGUAGE'))); foreach ($accepted_languages as $browser_lang) { if ($browser_lang[2] == '-') { $langcode = substr($browser_lang, 0, 5); } else { $langcode = substr($browser_lang, 0, 2); } $tmplang = $languages[$langcode]; if (file_exists("language/lang-$tmplang.php")) { $language = $tmplang; break; } } } /************************************************************************************/ /* */ /* string get_lang(string module_directory_name) */ /* */ /* Includes the language file for the module, if not available is users language */ /* the language from config is selected from the modules directory NLI */ /* */ /************************************************************************************/ function get_lang($module) { global $currentlang, $language; if ($module == 'admin') { $path = "admin/language"; } else { $path = "modules/$module/language"; } if (file_exists("$path/lang-$currentlang.php")) { include_once("$path/lang-$currentlang.php"); } else if (file_exists("$path/lang-$language.php")) { include_once("$path/lang-$language.php"); } else if (file_exists("$path/lang-english.php")) { include_once("$path/lang-english.php"); } } /*********************************************************************************** string lang_selectbox($current, $fieldname='alanguage', $all=1) Creates a language selection dropdown $current = current language for example: english $fieldname = the name for the '; $handle=opendir('language'); while ($file = readdir($handle)) { if (preg_match("#lang-(.*)\.php#", $file, $matches)) { $languageslist[] = $matches[1]; } } closedir($handle); sort($languageslist); for ($i=0; $i < sizeof($languageslist); $i++) { if($languageslist[$i]!="") { $content .= '\r\n"; } } if ($all) { $sellang = ($current == '') ? ' selected="selected"' : ''; $content .= ''; } return $content.''; } ?>