How can I automate spanish default usage in Roundcube?

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,354
79
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Is it posible? is there any main conf file being used as template for any new account? and how can I change this setting massively for existing accounts?
Thanks
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
The language stipulated in the cPanel interface has zero affect on the language used in the webmail program.

However, to effect change in Roundcube:

Modify:
/usr/local/cpanel/base/3rdparty/roundcube/config/main.inc.php

Change the entry:
Code:
$rcmail_config['locale_string'] = 'en';
To the locale you want, for example:
Code:
$rcmail_config['locale_string'] = 'es_AR';
All users that never used RoundCube will now have their locale set to Spanish (Argentina).

For users that have already logged into RoundCube the first time, you can update their locales in MySQL:
Code:
# mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 71786
Server version: 5.0.51a-community MySQL Community Edition (GPL)

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

mysql> use roundcube;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
mysql> show tables;
+---------------------+
| Tables_in_roundcube |
+---------------------+
| cache               | 
| contacts            | 
| identities          | 
| messages            | 
| session             | 
| users               | 
+---------------------+
6 rows in set (0.00 sec)

mysql> select * from users;
+---------+------------+-----------+-------+---------------------+---------------------+----------+--------------------------------------------------------------------------------+
| user_id | username   | mail_host | alias | created             | last_login          | language | preferences                                                                    |
+---------+------------+-----------+-------+---------------------+---------------------+----------+--------------------------------------------------------------------------------+
|       1 | timtest    | localhost |       | 2008-05-08 11:17:37 | 2008-05-08 11:17:37 | en_US    | NULL                                                                           | 
|       2 | tramel     | localhost |       | 2008-05-29 15:07:37 | 2008-05-29 15:07:37 | en_US    | a:2:{s:16:"message_sort_col";s:4:"date";s:18:"message_sort_order";s:4:"DESC";} | 
|       3 | [email protected] | localhost |       | 2008-06-17 11:45:48 | 2008-07-01 08:27:59 | en_US    | a:2:{s:16:"message_sort_col";s:4:"date";s:18:"message_sort_order";s:4:"DESC";} | 
+---------+------------+-----------+-------+---------------------+---------------------+----------+--------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

mysql> update users set language='es_ES' where username = '[email protected]';
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from users;
+---------+------------+-----------+-------+---------------------+---------------------+----------+--------------------------------------------------------------------------------+
| user_id | username   | mail_host | alias | created             | last_login          | language | preferences                                                                    |
+---------+------------+-----------+-------+---------------------+---------------------+----------+--------------------------------------------------------------------------------+
|       1 | timtest    | localhost |       | 2008-05-08 11:17:37 | 2008-05-08 11:17:37 | en_US    | NULL                                                                           | 
|       2 | tramel     | localhost |       | 2008-05-29 15:07:37 | 2008-05-29 15:07:37 | en_US    | a:2:{s:16:"message_sort_col";s:4:"date";s:18:"message_sort_order";s:4:"DESC";} | 
|       3 | [email protected] | localhost |       | 2008-06-17 11:45:48 | 2008-07-01 08:27:59 | es_ES    | a:2:{s:16:"message_sort_col";s:4:"date";s:18:"message_sort_order";s:4:"DESC";} | 
+---------+------------+-----------+-------+---------------------+---------------------+----------+--------------------------------------------------------------------------------+
3 rows in set (0.01 sec)
As shown above, I updated a single user to the es_ES locale, which is verifiable by logging into RoundCube.
 

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,354
79
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
It worked ok!

For users that have already logged into RoundCube, I edited massively that cols via phpmyadmin ad everything is ok.


I renamed the message folders to it spanish versions and I noticed something that is surely off the scope of cpanel staff. By some reason, even if you delete the old english named folders in order to leave only the spanish versions, when you send or delete any mail, Rouncube automatically generate the Sent or Trash folder to move that messages, ignoring what is stated in the config. I didn't found any other reference in the mysql db. Also, there are folder naming compatibility quirks between Horde and Roundcube that may indeed generate duplicate folders. :eek:
 

Kent Brockman

Well-Known Member
PartnerNOC
Jan 20, 2008
1,354
79
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
Roundcube was setup to auto create those directories.
Yep, and that may collide with default folders name of Squirrel Mail and/or Horde. By that reason we recommended our clients that because may occur any compatibility issue try to use always their same favorite webmail system.