1
as title says, im building a chinese site for chinese in australia, ofcourse most of my users are from australia, but are chinese, and most likely they will have location set to australia, so they will get english as the auto detection in xlanguage
but i'll like to have default language of chinese to emphasis this is a chinese community
[edit]
dont worry, fixed, this is extreemly difficult to detect, i have to clean my cookie to see the effect
change i made was
xlanguage/include/functions.php
function xlanguage_detectLang()
{
/*global $available_languages,$_SERVER;
if (!empty($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$HTTP_ACCEPT_LANGUAGE = $_SERVER['HTTP_ACCEPT_LANGUAGE'];
}
if (!empty($_SERVER['HTTP_USER_AGENT'])) {
$HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT'];
}
$lang = '';
$xoops_lang ='';
// 1. try to findout user's language by checking its HTTP_ACCEPT_LANGUAGE
// variable
if (empty($lang) && !empty($HTTP_ACCEPT_LANGUAGE)) {
$accepted = explode(',', $HTTP_ACCEPT_LANGUAGE);
$acceptedCnt = count($accepted);
reset($accepted);
for ($i = 0; $i < $acceptedCnt; $i++) {
$lang = xlanguage_lang_detect($accepted[$i], 1);
if(strncasecmp($lang,'en',2)){
break;
}
}
}
// 2. try to findout user's language by checking its HTTP_USER_AGENT variable
if (empty($lang) && !empty($HTTP_USER_AGENT)) {
$lang = xlanguage_lang_detect($HTTP_USER_AGENT, 2);
}
// 3. If we catch a valid language, configure it
if (!empty($lang)) {
$xoops_lang = $available_languages[$lang][1];
}*/
return "schinese";
}