Summary | IMP should (correctly) support special folder name translation |
Queue | IMP |
Queue Version | 4.3 |
Type | Enhancement |
State | Duplicate |
Priority | 1. Low |
Owners | |
Requester | thomas (at) gelf (dot) net |
Created | 12/05/2008 (6057 days ago) |
Due | |
Updated | 12/08/2008 (6054 days ago) |
Assigned | |
Resolved | 12/08/2008 (6054 days ago) |
Milestone | |
Patch | No |
thoughts I've written before reading Jan's hint to
#7545:IMO the real mess here is forcing translators into using
IMAP_UTF7-encodings - and not using special folder translations as
"real" IMAP folders instead of labels. On (IMAP) server side there
should be a consistent naming, unfortunately there is no standard
prescribing such names. However, as of my researches most vendors
agree on Drafts, Sent and Trash - and also IMP is using them as a
default setting.
Instead of using as real folder names and translating just their
labels, IMP is setting them to _('Drafts') etc. After testing IMP in
four different languages (the ones being used by our customers) I had
12 special folders in my mailbox.
User (or administrative) preferences should set drafts_folder,
sent_mail_folder and trash_folder corresponding to real IMAP folder
names. Labels for these folders have always to be shown as
_('Drafts'), _('Sent') and _('Trash'), regardless of what IMAP folder
they are bound to. If a user has to change it's special folder
location for some reason (mostly "Sent Items", "SENT" etc, as of
compatibility reasons) he will continue to read _('Sent') in (D)IMP -
in his very own language. This is how Thunderbird and other IMAP
clients are behaving, and in my eyes this would be the correct
approach for IMP too.
A "correct" patch should not happen where I applied it, but earlier in
IMAP tree creating (Note: exactly as done by Massimiliano). It should
substitute labels for this special folders (INBOX is a similar case
and already handled correctly in some hardcoded way) with translated
labels - so even 'SENT' and 'Sent Items' would show up as _('Sent').
That's enough spam for now - as I've had already written down this
(and even more), so I didn't want to throw it away ;-)
Regards,
Thomas
#7545is great!State ⇒ Duplicate
request #7545.State ⇒ Feedback
mess. I'll defer to some extent to Jan, but is there some reason you
started this as a discussion here, instead of hashing it out on the
mailing list and then filing an enhancement (if necessary) for the
agreed-upon solution?
Priority ⇒ 1. Low
Type ⇒ Enhancement
Summary ⇒ IMP should (correctly) support special folder name translation
Queue ⇒ IMP
Milestone ⇒
Patch ⇒ No
State ⇒ New
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 #7759for an example fix of label usage in DIMP.Regards,
Thomas Gelf