$lang) { if(strpos($_AL, $K)===0) return file_exists( _EXT_PATH.'/languages/'.$lang.'.php' ) ? $lang : $default; } // Try to detect any language if not yet detected', foreach($GLOBALS['_LANG'] as $K => $lang) { if(strpos($_AL, $K)!==false) return file_exists( _EXT_PATH.'/languages/'.$lang.'.php' ) ? $lang : $default; } foreach($GLOBALS['_LANG'] as $K => $lang) { if(preg_match("/[\[\( ]{$K}[;,_\-\)]/",$_UA)) return file_exists( _EXT_PATH.'/languages/'.$lang.'.php' ) ? $lang : $default; } // Return default language if language is not yet detected', return $default; } } // Define all available languages', // WARNING: uncomment all available languages $GLOBALS['_LANG'] = array( 'af' => 'afrikaans', 'ar' => 'arabic', 'bg' => 'bulgarian', 'ca' => 'catalan', 'cs' => 'czech', 'da' => 'danish', 'de' => 'german', 'el' => 'greek', 'en' => 'english', 'es' => 'spanish', 'et' => 'estonian', 'fi' => 'finnish', 'fr' => 'french', 'gl' => 'galician', 'he' => 'hebrew', 'hi' => 'hindi', 'hr' => 'croatian', 'hu' => 'hungarian', 'id' => 'indonesian', 'it' => 'italian', 'ja' => 'japanese', 'ko' => 'korean', 'ka' => 'georgian', 'lt' => 'lithuanian', 'lv' => 'latvian', 'ms' => 'malay', 'nl' => 'dutch', 'no' => 'norwegian', 'pl' => 'polish', 'pt' => 'portuguese', 'ro' => 'romanian', 'ru' => 'russian', 'sk' => 'slovak', 'sl' => 'slovenian', 'sq' => 'albanian', 'sr' => 'serbian', 'sv' => 'swedish', 'th' => 'thai', 'tr' => 'turkish', 'uk' => 'ukrainian', 'zh-tw' => 'traditional_chinese', 'zh-cn' => 'simplified_chinese' );