Roundcube Community Forum

 

problem with localizing roundcube

Started by rorypickering, January 15, 2011, 11:01:27 AM

Previous topic - Next topic

rorypickering

on my site i allow users to change the language and it stores their language choice in a cookie, but i pass this to roundcube and it doesnt change the language here is my code

original code was: (within main.inc.php)

$rcmail_config['language'] = null;

i changed it to

if(isset($_COOKIE['language'])){
switch($_COOKIE['language']){
case 'fr':
$rcmail_config['language'] = 'fr_FR';
break;
default:
$rcmail_config['language'] = 'en_GB';
break;
}
}else{
$rcmail_config['language'] = 'en_GB';
}
die($rcmail_config['language']);


when i put that it does return what i want it to (ie if the user has chosen french it returns 'fr_FR'. but when i remove the die function, so the rest of the code runs,  it doesnt localize roundcube? im confused? please help!!

rorypickering

even when i just put
$rcmail_config['language'] = 'fr_FR';


it doesnt load the french

rosali

This won't work.

If you do it somewhere in the CORE files you have to overwrite
$CONFIG['language']  which holds the configuration globally.

Within a plugin it is recommended to use:
$rcmail = rcmail::get_instance();
$rcmail->config->set('language','fr_FR');
Regards,
Rosali