This is the default head of forward mail in KMail: -------------------------------------------------- Subject: xxx Date: 2014年11月18日 星期二 From: 10:24:08 To: Aalto-yliopisto <no-reply@aalto.fi> To: Yunhe Guo <yunhe.guo@aalto.fi> ---------------------------------------------------- I checked the template of forward email, the head part is: Subject: %OFULLSUBJECT Date: %ODATE From: %OTIMELONG To: %OFROMADDR %OADDRESSEESADDR %TEXT ------------------------------------------------------- I think this is a template error. Reproducible: Always Steps to Reproduce: 1. Open a email. 2. Right click -> Forward -> Inline... 3. You can see the mail body.
So what is the error ? What is the expected result ?
(In reply to Laurent Montel from comment #1) > So what is the error ? > What is the expected result ? Error: This is the default head of forward mail in KMail: -------------------------------------------------- Subject: XXXXX Date: Tuesday 18 November 2014 From: 10:24:08 To: A <someonea@example.com> To: B <someoneb@example.com> ---------------------------------------------------- 1. "From" should not be time but an email address. 2. There are two "To" entries. The first is the address of sender, and the second is the address of receiver. There should only be one "To" entry with receiver's email. I think the expected result should be: -------------------------------------------------- Subject: XXXXX Date: Tuesday 18 November 2014 10:24:08 From: A <someonea@example.com> To: B <someoneb@example.com> ----------------------------------------------------
Are you reset default template ? But default it"s %REM="Default forward template"%- ---------- Forwarded Message ---------- Subject: %OFULLSUBJECT Date: %ODATE, %OTIMELONG From: %OFROMADDR %OADDRESSEESADDR %TEXT ----------------------------------------- I don't see the error in source code.
Perhaps you can send me a test email in private message. Perhaps in japonese characters creates a problem
No I didn't change it. This is the default settings in openSUSE 13.2. Maybe it is only a problem of packaging in openSUSE 13.2. The default template is (in Chinese): ---------- 转发的信件 ---------- 主题:%OFULLSUBJECT 日期:%ODATE 发件人:%OTIMELONG 收件人:%OFROMADDR %OADDRESSEESADDR %TEXT ------------------------------------------------------- I guess it might be a translation error of Chinese. When translating, translator changed several lines' orders by mistakes.
Yes indeed you're right it's in i18n(...) We need to ask to translator to fix it. QString DefaultTemplates::defaultForward() { return QLatin1String("%REM=\"") + i18n("Default forward template") + QLatin1String("\"%-\n") + i18nc("Default forward template: %1: subject of original message, " "%2: date of original message, " "%3: time of original message, " "%4: mail address of original sender, " "%5: original message text", "\n" "---------- Forwarded Message ----------\n" "\n" "Subject: %1\n" "Date: %2, %3\n" "From: %4\n" "%OADDRESSEESADDR\n" "\n" "%5\n" "-----------------------------------------", QLatin1String("%OFULLSUBJECT"), QLatin1String("%ODATE"), QLatin1String("%OTIMELONG"), QLatin1String("%OFROMADDR"), QLatin1String("%TEXT")); } it'es translated so translator make an error I think.
Hi kde-i18n :) I think this bug is a translate problem. Could you verify chinese version please ? Thanks. Le Wednesday 19 November 2014 08:49:25 guoyunhebrave a écrit : > https://bugs.kde.org/show_bug.cgi?id=341085 > > --- Comment #5 from guoyunhebrave <guoyunhebrave@gmail.com> --- > No I didn't change it. This is the default settings in openSUSE 13.2. Maybe > it is only a problem of packaging in openSUSE 13.2. > > The default template is (in Chinese): > > ---------- 转发的信件 ---------- > > 主题:%OFULLSUBJECT > 日期:%ODATE > 发件人:%OTIMELONG > 收件人:%OFROMADDR > %OADDRESSEESADDR > > %TEXT > ------------------------------------------------------- > > I guess it might be a translation error of Chinese. When translating, > translator changed several lines' orders by mistakes.
I have found the translation message and submitted a patch. But there is still a problem. The program source code use "%OADDRESSEESADDR" to represent all email receivers: -------------------------------------------- "From: %4\n" "%OADDRESSEESADDR\n" -------------------------------------------- This will output following text in Chinese: ---------------------------------------------------------------------------------------- 发件人:User C<userc@example.com> To: User A<usera@example.com>, User B<userb@example.com> ---------------------------------------------------------------------------------------- It is a mixture of Chinese and English. The reason is %OADDRESSEESADDR output "To: " before all receiver addresses. I hope that %OADDRESSEESADDR only output email addresses without "To: " at the beginning. And then program source code should be: "---------- Forwarded Message ----------\n" "\n" "Subject: %1\n" "Date: %2, %3\n" "From: %4\n" "To: %5\n" "\n" "%6\n" "-----------------------------------------"
} else if (cmd.startsWith(QLatin1String("OADDRESSEESADDR"))) { qDebug() << "Command: OADDRESSEESADDR"; i += strlen("OADDRESSEESADDR"); if (mOrigMsg) { const QString to = mOrigMsg->to()->asUnicodeString(); const QString cc = mOrigMsg->cc()->asUnicodeString(); if (!to.isEmpty()) { QString toLine = i18nc("@item:intext email To", "To:") + QLatin1Char(' ') + to; plainBody.append(toLine); const QString body = plainToHtml(toLine); htmlBody.append(body); } if (!to.isEmpty() && !cc.isEmpty()) { plainBody.append(QLatin1Char('\n')); const QString str = plainToHtml(QString(QLatin1Char('\n'))); htmlBody.append(str); } if (!cc.isEmpty()) { QString ccLine = i18nc("@item:intext email CC", "CC:") + QLatin1Char(' ') + cc; plainBody.append(ccLine); const QString str = plainToHtml(ccLine); htmlBody.append(str); } } " QString toLine = i18nc("@item:intext email To", "To:") + QLatin1Char(' ') + to;" => it's translated so it's not a probem.
OK, I understand. Thank you!
But I tried to use "%OADDRESSEESADDR" in my customized template. (Program language is Chinese) It displays English "To:" not Chinese "收件人:". i18nc("@item:intext email To", "To:") is defined in Chinese translation indeed. That is strange.
I tested Finnish language, it works well. So it is only a Chinese translation problem. But I still suggest my solution that "%OADDRESSEESADDR" only outputs email addresses. i18n defined in "%OADDRESSEESADDR" always use the translation of current application language. But non-English users may have two language templates: English and their mother tongue. They usually have to define customized template of reply, reply and forward. If my KMail UI is in Chinese, "%OADDRESSEESADDR" always shows "发件人:XXX". When I want to make an English template to communicate with foreign friends, I cannot change the translation of "%OADDRESSEESADDR" in my customized template, because it is totally decided by application language.
indeed but I can't change it. Otherwise I will break all template for all users.
Yes, I fully understand your consideration. How about providing another parser "OTOALLADDR" for those who want to use customized templates? This solution does not affect old users' template settings. parser name: OTOALLADDR description: All recipients without "To:" label. example output: Jon Larry<jon.larry@example.com>, Thomas Whel <thomas.whel@example.com>
Another problem is that this variable allows to add "CC" too. But you can use "OTOLIST" no ?
Yes. I can use OTOLIST. If I need CC I can customize my template as: ----------------------------------------- From: %OFROMADDR To: %OTOLIST Cc: %OCCADDR ----------------------------------------- But %OCCADDR only output one address, isn't it? There is not %OCCLIST parser.
} else if (cmd.startsWith(QLatin1String("OADDRESSEESADDR"))) { qDebug() << "Command: OADDRESSEESADDR"; i += strlen("OADDRESSEESADDR"); if (mOrigMsg) { const QString to = mOrigMsg->to()->asUnicodeString(); const QString cc = mOrigMsg->cc()->asUnicodeString(); and } else if (cmd.startsWith(QLatin1String("OCCADDR"))) { qDebug() << "Command: OCCADDR"; i += strlen("OCCADDR"); if (mOrigMsg) { const QString str = mOrigMsg->cc()->asUnicodeString(); plainBody.append(str); const QString body = plainToHtml(str); htmlBody.append(body); } => for me it's the same code for cc => it's ok
After test, I found %OTOADDR and %OCCADDR both outputs all email addresses. So I can use: ----------------------------------------- From: %OFROMADDR To: %OTOADDR Cc: %OCCADDR ----------------------------------------- So, what is the difference between %OTOADDR and %OTOLIST? They seem output the same email list of the same format.
There is not difference when I look at source code. I think that it was old variable which was never removed. I can't remove it for compatibility but indeed you can use %OTOADDR or %OTOLIST
Thanks for your patient answer. Every question is clearly explained. I will work with KDE China i18n team to solve the translation error.
Please close this bug when i18n is fixed. Thanks
SVN commit 1407013 by xuetianweng: Fix forward template translation. M +36 -66 libtemplateparser.po WebSVN link: http://websvn.kde.org/?view=rev&revision=1407013