开发者

How to change language of UI for current user in Roundcube using a script

开发者 https://www.devze.com 2023-04-04 16:08 出处:网络
I am using Roundcube as a webmail client an开发者_如何学Pythond need to write a script in order to change language of UI for current user.

I am using Roundcube as a webmail client an开发者_如何学Pythond need to write a script in order to change language of UI for current user.

Does anybody have any idea of how to do that? I know that there is a table users which has a field language. The problem consists on how to get current username using a script.


To change the language:

// Define $customLanguage as the result of a SQL query or session
// A valid value looks like "en_GB"
$customLanguage = $_SESSION["language"]

$rcmail = rcmail::get_instance();
$rcmail->config->set('language', $customLanguage);
$rcmail->load_language($customLanguage);
$rcmail->user->save_prefs(array("language"=>$customLanguage));
//...rest of script...
0

精彩评论

暂无评论...
验证码 换一张
取 消