Good morning,
I am currently trying to set up a classified site which has one domain name per language.
Unfortunately, I can't find a way to have it working properly.
The language switch href links have différents domain names, it refuses to change the page domain.
Goal :domain.com -> en_US
domain.fr -> fr_FR
and the language switcher should redirect to the related domain.
So far :- Two domains (.com and .fr) pointing to the server.
- Setup the native osclass permalink option (Htaccess amended)
- Modified "/oc-includes/osclass/helpers/hpreference.php" to set language according to domain:
function osc_language() { //mecene language domain name
if($_SERVER['HTTP_HOST'] == 'domain.fr'){
return('fr_FR');
}else{
return(getPreference('language')); // default en_US if .com
}
}- Modified "/oc-includes/osclass/helpers/hDefine.php" to change urls of the language switcher :
function osc_change_language_url($locale) {
$baseUrlEn = 'http://domain.com/';
$baseUrlFr = 'http://domain.fr/';
if ( osc_rewrite_enabled() ) {
switch ($locale) {
case 'en_US':
return $baseUrlEn . osc_get_preference('rewrite_language') . '/' . $locale;
break;
case 'fr_FR':
return $baseUrlFr . osc_get_preference('rewrite_language') . '/' . $locale;
break;
default:
return osc_base_url() . osc_get_preference('rewrite_language') . '/' . $locale;
break;
}
//return osc_base_url() . osc_get_preference('rewrite_language') . '/' . $locale;
} else {
return osc_base_url(true) . '?page=language&locale=' . $locale;
}
}This last code gives me the right links Url on the language switch but when I clic it nothing happens.
Could anyone help me with this issue or at least guide me to the right path or let me know that i am doomed with this crazy idea.
Kind regards