Daily Archives: 2012年02月6日

squirrelmail汉化

[root@server ~]# cd /var/www/html/squirrelmail-1.4.22/config
[root@server config]# ./conf.pl
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Main Menu --
1. Organization Preferences
2. Server Settings
3. Folder Defaults
4. General Options
5. Themes
6. Address Books
7. Message of the Day (MOTD)
8. Plugins
9. Database
10. Languages
D. Set pre-defined settings for specific IMAP servers
C Turn color on
S Save data
Q Quit
Command >> 10
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : en_US
2. Default Charset : iso-8859-1
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 1
SquirrelMail attempts to set the language in many ways. If it
can not figure it out in another way, it will default to this
language. Please use the code for the desired language.
[en_US]: zh_CN
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : iso-8859-1
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> 2
This option controls what character set is used when sending
mail and when sending HTML to the browser.
This option is used only when default language is 'en_US'.
[iso-8859-1]: gb2312
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : gb2312
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> s
Data saved in config.php
Press enter to continue...
SquirrelMail Configuration : Read: config.php (1.4.0)
---------------------------------------------------------
Language preferences
1. Default Language : zh_CN
2. Default Charset : gb2312
3. Enable lossy encoding : false
R Return to Main Menu
C Turn color on
S Save data
Q Quit
Command >> q
Exiting conf.pl.
You might want to test your configuration by browsing to
http://your-squirrelmail-location/src/configtest.php
Happy SquirrelMailing!

 

cd /var/www/html/squirrelmail/config
./conf.pl
选择10 设置语言为zh_CN
默认字符集为gb2312
保存退出,重新刷新webmail页面,就成中文了
但是登录进入后,左边的Drafts,sent,trash还是英文
修改/var/www/html/squirrelmail/local/zh_CN/LC_MESSAGES/squirrelmail.po,
增加msgid和msgstr,
修改完毕后,用 msgfmt -o squirrelmail.mo squirrelmail.po 来格式化一下。

vtiger CRM 5.3截取中文字符串出现乱码的解决方法

打开文件/include/utils/ListViewUtils.php

找到第4283行,红色部分为新增代码,修改如下:

}elseif(strlen($field_val) > $listview_max_textlength) {
 if($default_charset == 'UTF-8'){
 $temp_val = mb_substr($field_val, 0, $listview_max_textlength, $default_charset).'...';
 }else{
 $temp_val = substr(preg_replace("/(<\/?)(\w+)([^>]*>)/i","",$field_val),0,$listview_max_textlength).'...';
 }
 }
 } else {

注意:请确保php开启了mb_substr函数支持。

在php.ini中找到“;extension=php_mbstring.dll”去掉前面的分号“;”,然后重启服务即可