Opened 13 years ago

Closed 13 years ago

#7689 closed bug (fixed)

[mail_daemon] Mail menu in deskbar is not localized

Reported by: taos Owned by: czeidler
Priority: normal Milestone: R1
Component: Servers/mail_daemon Version: R1/Development
Keywords: localization Cc:
Blocked By: Blocking:
Platform: All

Description

Using r1a3-rc-hrev42159.

There's no localization of mail menu in deskbar:

Non-localized mail menu in deskbar.

Not sure, but I think it is trunk/src/servers/mail/DeskbarView.cpp that should be localized. So far, MDR_DIALECT_CHOICE has been used. Is it possible to simply replace it by B_TRANSLATE?

Attachments (7)

Mail_Deskbar.png (24.5 KB ) - added by taos 13 years ago.
Non-localized mail menu in deskbar.
mail_daemon.patch (10.5 KB ) - added by taos 13 years ago.
Patch to get rid of MDRLanguage.h.
Old_Japanese_translation.txt (3.9 KB ) - added by taos 13 years ago.
Old Japanese translation from source code (used with MDR_DIALECT_CHOICE).
libmail.so.patch (4.7 KB ) - added by taos 13 years ago.
Patch to get rid of MDRLanguage.h for libmail.so.
mail_daemon-addons.patch (32.2 KB ) - added by taos 13 years ago.
Patch to get rid of MDRLanguage.h for mail_daemon add-ons, protocols, and filters.Patch to get rid of MDRLanguage.h for mail_daemon add-ons, protocols, and filters.
MailDaemon.diff (883 bytes ) - added by mt 13 years ago.
notifier.diff (1.2 KB ) - added by mt 13 years ago.

Download all attachments as: .zip

Change History (25)

by taos, 13 years ago

Attachment: Mail_Deskbar.png added

Non-localized mail menu in deskbar.

comment:1 by czeidler, 13 years ago

Yes exactly just replace the the MDR_DIALECT_CHOICE, to be sure to get all of them just remove this file: http://haiku.it.su.se:8180/source/xref/headers/private/mail/MDRLanguage.h

Would be cool to safe the Japanese translation at the same time.

Would really appreciate if you could do the switch to the haiku localization system!

comment:2 by taos, 13 years ago

Okay, so I tried to get rid of MDR_DIALECT_CHOICE. Here is a patch ("mail_daemon.patch") that replaces it with B_TRANSLATE and adds DoCatalogs to the Jamfile. The old Japanese translation from the source code is attached ("Old_Japanese_translation.txt").

Mail_daemon can be compiled without errors or warnings and works - as far as I can tell - as expected.

However, to make things easier for translators on HTA, I would like to use more complete strings (e.g. B_TRANSLATE("%d new messages for %s\n") instead of fAlertString << numMessages << B_TRANSLATE(" new messages"); and fAlertString << B_TRANSLATE(" for ") << msg->FindString("name") << '\n';. Unfortunately, I'm new to programming and don't know (yet) how to implement this correctly (more research needed).

comment:3 by taos, 13 years ago

patch: 01

by taos, 13 years ago

Attachment: mail_daemon.patch added

Patch to get rid of MDRLanguage.h.

comment:4 by czeidler, 13 years ago

Cool thanks the patch looks very good! Could you also localize the libmail.so and the add-ons/filters? Just delete the MDRLanguage.h file and you will see that there are some more places where the old macro is used.

comment:5 by taos, 13 years ago

Patches for libmail.so ("libmail.so.patch") and for mail_daemon add-ons and filters ("mail_daemon-addons.patch") added. MDRLanguage,h should no longer be needed.

EDIT: I uploaded the patches again. There was something wrong.

Last edited 13 years ago by taos (previous) (diff)

by taos, 13 years ago

Old Japanese translation from source code (used with MDR_DIALECT_CHOICE).

by taos, 13 years ago

Attachment: libmail.so.patch added

Patch to get rid of MDRLanguage.h for libmail.so.

comment:6 by taos, 13 years ago

Hmmm, after deleting MDRLanguage.h I can compile mail_daemon, libmail.so, and Mail separately with my patches. Unfortunately I get the following error when building the complete ggc2hybrid raw image:

...failed C++ /SVN/trunk/generated/objects/haiku/x86/release/add-ons/mail_daemon
/inbound_protocols/pop3/ssl/pop3.o ...

What did I destroy???

comment:7 by axeld, 13 years ago

Thanks for all your work so far! You can't compile the image anymore, since the mail_daemon has some add-ons which are also using the header. See src/add-ons/mail_daemon.

When I grep for MDRLang I get the following list:

./inbound_filters/match_header/ConfigView.cpp:#include <MDRLanguage.h>
./inbound_filters/notifier/ConfigView.cpp:#include <MDRLanguage.h>
./inbound_filters/notifier/filter.cpp:#include <MDRLanguage.h>
./inbound_protocols/imap/imap_config.cpp:#include <MDRLanguage.h>
./inbound_protocols/pop3/pop3.cpp:#include <MDRLanguage.h>
./outbound_filters/fortune/ConfigView.cpp:#include <MDRLanguage.h>
./outbound_protocols/smtp/ConfigView.cpp:#include <MDRLanguage.h>
./outbound_protocols/smtp/smtp.cpp:#include <MDRLanguage.h>

If you are interested in changing those, too, that would be really great!

comment:8 by czeidler, 13 years ago

Think thats fixed in the second bunch of patches. There have been also just some other smaller issues but it seems to compile now (still going on). will commit it soon...

comment:9 by taos, 13 years ago

I found a few typos (superfluous ", missing brackets...). I've uploaded the new version.

by taos, 13 years ago

Attachment: mail_daemon-addons.patch added

Patch to get rid of MDRLanguage.h for mail_daemon add-ons, protocols, and filters.Patch to get rid of MDRLanguage.h for mail_daemon add-ons, protocols, and filters.

comment:10 by czeidler, 13 years ago

Ok thanks, but fixed it already by myself. Do you take care that the Japanese translation gets into HTA? thanks a lot!

comment:11 by taos, 13 years ago

I've already seen that I was too late with my updated patch. BTW, is it a problem that in src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolderConfig.cpp "..." is used instead of B_UTF8_ELLIPSIS)? I only noticed it when I was looking for typos for the updated patch.

I could try to put the Japanese translation into HTA. Unfortunately, I absolutely don't understand Japanese, so the results could get quite entertaining;-)

comment:12 by czeidler, 13 years ago

:) the Japanese guys should fix it then...

According to http://api.haiku-os.org/HIG/ch06s02.html B_UTF8_ELLIPSIS are only used when the button/menu item open another window.

in reply to:  12 comment:13 by taos, 13 years ago

Replying to czeidler:

According to http://api.haiku-os.org/HIG/ch06s02.html B_UTF8_ELLIPSIS are only used when the button/menu item open another window.

I would interpret the mentioned paragraph as: Only use … when and where appropriate but then make sure to use B_UTF8_ELLIPSIS instead of three single dots. Can't remember if HTA replaces three single dots (...) by the one-character UTF-8 symbol (…) when exporting catkeys.

in reply to:  11 ; comment:14 by mt, 13 years ago

Replying to taos:

I could try to put the Japanese translation into HTA. Unfortunately, I absolutely don't understand Japanese, so the results could get quite entertaining;-)

Hi, I will put Japanese translation to HTA, but HTA has not mail_daemon entry yet.

in reply to:  14 comment:15 by taos, 13 years ago

Replying to mt:

Hi, I will put Japanese translation to HTA, but HTA has not mail_daemon entry yet.

That would be great! Thanks. My attempts would probably end in disaster (maybe very amusing disaster - think of early attempts of automatic translation from Japanese to English and back)... It could take some time till the translation strings show up in HTA, however.

comment:16 by mt, 13 years ago

Hi, I have almost finished Japanese translation on HTA, but I can't translate some messages. so please apply these patches.

by mt, 13 years ago

Attachment: MailDaemon.diff added

by mt, 13 years ago

Attachment: notifier.diff added

in reply to:  16 comment:17 by taos, 13 years ago

Replying to mt:

Hi, I have almost finished Japanese translation on HTA, but I can't translate some messages. so please apply these patches.

That's what I was afraid of when I couldn't get rid of those separate translation chunks in favor of a more complete translation string. Now that I've had a little inspiration of how to do it, I'll have another look at those - I'm not sure if the spaces that are removed by HTA are re-added again when the catkeys are exported to SVN.

BTW, are there modern languages that still use a dual in addition to singular and plural forms (ancient Greek won't be a problem) or that use different cases when combined with numbers 2, 3, 4 etc (some Slavic languages maybe)? Then we would have to add entries for "2 new messages" or "3 new messages", d'oh, grammar...

comment:18 by czeidler, 13 years ago

Resolution: fixed
Status: newclosed

thanks guys! anybody keen to make the mail preferences layout aware? The preferences alone should be quite easy, when this is done one can take a look at the add-ons...

@taos: don't know maybe ask Oliver or Adrien...

Last edited 13 years ago by czeidler (previous) (diff)
Note: See TracTickets for help on using tickets.