[Tickets #7760] IMP should (correctly) support special folder name translation

bugs at horde.org bugs at horde.org
Fri Dec 5 17:40:33 UTC 2008


DO NOT REPLY TO THIS MESSAGE. THIS EMAIL ADDRESS IS NOT MONITORED.

Ticket URL: http://bugs.horde.org/ticket/7760
------------------------------------------------------------------------------
  Ticket             | 7760
  Created By         | thomas at gelf.net
  Summary            | IMP should (correctly) support special folder name
                     | translation
  Queue              | IMP
  Version            | 4.3
  Type               | Enhancement
  State              | New
  Priority           | 1. Low
  Milestone          |
  Patch              |
  Owners             |
------------------------------------------------------------------------------


thomas at gelf.net (2008-12-05 12:40) wrote:

IMP's way of handling translated special folders doesn't really excite  
me, here some thoughts:

Current default preferences
---------------------------
$_prefs['drafts_folder']    = array('value' => _("Drafts"), ...
$_prefs['trash_folder']     = array('value' => _("Trash"), ...
$_prefs['sent_mail_folder'] = array('value' => _("Sent"), ...

This way users using their webmail with different languages (YES,  
there are users doing so) will get many differently named special  
folders. But even if just using German (just as an example) they will  
have trouble when also using Thunderbird or another IMAP-Client. TB's  
default setting for example are exactly the same as IMP ones: Drafts,  
Trash, Sent. But a German user would have to either reconfigure IMP or  
TB as IMP will create Entwürfe, Papierkorb and Gesendet. And after  
that he'll see every folder name twice in TB, but the one with the  
special folder symbol will not be the same as in DIMP.

I also mislike the idea to force translators to use IMAP_UTF7-encoded  
strings - if they're using poedit they will not know which one of the  
texts containing "Entwürfe" will have to be encoded. Example from  
German translation:

#: config/prefs.php.dist:301
msgid "Drafts"
msgstr "Entw&APw-rfe"

I temporarily solved this for myself by setting prefs to 'Drafts',  
'Sent' and 'Trash' (without _()) and adding a new foreach-loop to  
DIMP::getFolderResponse(), hardcoding my folder names:

         foreach ($result['a'] as $k => $v) {
             if (! isset($v->s)) continue;
             if ($v->s != 1) continue;
             if (in_array($v->l, array('Trash', 'Sent', 'Drafts'))) {
                 $result['a'][$k]->l = mb_convert_encoding(_($v->l),  
'UTF-8', 'UTF7-IMAP');
             }
         }

Obviously this is a quick & dirty hack and not a solution to be  
applied generically - it should be solved in a clean way in more than  
one location:
- suggesting Trash, Sent and Drafts as default special folder names
- doing translation in (D)IMP's folder tree creation functions and to  
be applied to labels only
- removing IMAP_UTF7-nonsense from translation files

Please also see bug #7759 for an example fix of label usage in DIMP.

Regards,
Thomas Gelf





More information about the bugs mailing list