diff --git a/headers/private/mail/MDRLanguage.h b/headers/private/mail/MDRLanguage.h deleted file mode 100644 index 823cd52a0e..0000000000 --- a/headers/private/mail/MDRLanguage.h +++ /dev/null @@ -1,51 +0,0 @@ -#ifndef ZOIDBERG_MDR_LANGUAGE_H -#define ZOIDBERG_MDR_LANGUAGE_H -/* -** Mail Daemon Replacement interim International Language Macros. -** -** Copyright 2003 Dr. Zoidberg Enterprises. All rights reserved. -** -** The input for the language macro system is the MDR_DIALECT define which is -** set by the makefile (you compile a version for the desired language, it -** can't change at run-time using this temporary internationalization system). -** MDR_DIALECT was set to 0 for English-USA, 1 for Japanese, and other numbers -** for other language dialects. If it's not present, we use English-USA. -** -** $Log: MDRLanguage.h,v $ -** Revision 1.1 2004/09/20 22:31:42 nwhitehorn -** Imported MDR. Some code still not entirely functional -- I haven't been able to figure out how to detect SSL, so IMAP and POP have it turned off. PPP auto-detect is also not functional at the moment. Other than that, it seems to work beautifully. Packaging will come later. -** -** Revision 1.3 2003/02/05 22:43:17 agmsmith -** Default language (judging by the use of "color" in the bemail -** preferences) changed to be English-USA. -** -** Revision 1.2 2003/01/30 23:52:12 agmsmith -** Initial simple language system macros done. -** -** Revision 1.1 2003/01/30 23:26:07 agmsmith -** Starting to add a simplistic internationalization system for "Koki", -** who wants to use BeMail in Japanese. It should later be replaced by -** a more comprehensive system, but at least this one will mark out the -** spots where translated text is needed. -*/ - -#define MDR_DIALECT_ENGLISH_USA 0 -#define MDR_DIALECT_JAPANESE 1 - -#ifndef MDR_DIALECT - #define MDR_DIALECT MDR_DIALECT_ENGLISH_USA -#endif - -#if (MDR_DIALECT == MDR_DIALECT_ENGLISH_USA) - #define MDR_DIALECT_CHOICE(EnglishUSA,Japanese) EnglishUSA - #define MDR_COUNTRY "United States of America" - #define MDR_LANGUAGE "English" -#elif (MDR_DIALECT == MDR_DIALECT_JAPANESE) - #define MDR_DIALECT_CHOICE(EnglishUSA,Japanese) Japanese - #define MDR_COUNTRY "Japan" - #define MDR_LANGUAGE "Japanese" -#else - #error "Unrecognized value specified for MDR_DIALECT macro constant." -#endif - -#endif /* ZOIDBERG_MDR_LANGUAGE_H */ diff --git a/src/preferences/mail/ConfigViews.cpp b/src/preferences/mail/ConfigViews.cpp index fd34d622c1..95570dec39 100644 --- a/src/preferences/mail/ConfigViews.cpp +++ b/src/preferences/mail/ConfigViews.cpp @@ -28,8 +28,6 @@ #include -#include - #include "FilterConfigView.h" diff --git a/src/servers/mail/DeskbarView.cpp b/src/servers/mail/DeskbarView.cpp index 27ce43191b..aaa6c47799 100644 --- a/src/servers/mail/DeskbarView.cpp +++ b/src/servers/mail/DeskbarView.cpp @@ -10,6 +10,7 @@ #include #include +#include #include #include #include @@ -36,10 +37,14 @@ #include #include #include -#include #include "DeskbarViewIcons.h" + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "DeskbarView" + + const char* kTrackerSignature = "application/x-vnd.Be-TRAK"; @@ -462,9 +467,8 @@ DeskbarView::_BuildMenu() BPopUpMenu* menu = new BPopUpMenu(B_EMPTY_STRING, false, false); menu->SetFont(be_plain_font); - menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ( - "Create new message", "N) 新規メッセージ作成")B_UTF8_ELLIPSIS, - new BMessage(MD_OPEN_NEW))); + menu->AddItem(new BMenuItem(B_TRANSLATE("Create new message" + B_UTF8_ELLIPSIS), new BMessage(MD_OPEN_NEW))); menu->AddSeparatorItem(); BMessenger tracker(kTrackerSignature); @@ -530,9 +534,7 @@ DeskbarView::_BuildMenu() // Hack for R5's buggy Query Notification #ifdef HAIKU_TARGET_PLATFORM_BEOS - menu->AddItem(new BMenuItem( - MDR_DIALECT_CHOICE("Refresh New Mail Count", - "未読メールカウントを更新"), + menu->AddItem(new BMenuItem(B_TRANSLATE("Refresh New Mail Count"), new BMessage(MD_REFRESH_QUERY))); #endif @@ -540,10 +542,10 @@ DeskbarView::_BuildMenu() if (fNewMessages > 0) { BString string; - MDR_DIALECT_CHOICE( - string << fNewMessages << " new message" - << (fNewMessages != 1 ? "s" : B_EMPTY_STRING), - string << fNewMessages << " 通の未読メッセージ"); + if (fNewMessages != 1) + string << fNewMessages << B_TRANSLATE(" new messages"); + else + string << fNewMessages << B_TRANSLATE(" new message"); _GetNewQueryRef(ref); @@ -554,16 +556,16 @@ DeskbarView::_BuildMenu() navMenu->SetNavDir(&ref); menu->AddItem(item); - } else { - menu->AddItem(item = new BMenuItem( - MDR_DIALECT_CHOICE ("No new messages","未読メッセージなし"), NULL)); + } + else { + menu->AddItem(item = new BMenuItem(B_TRANSLATE("No new messages"), + NULL)); item->SetEnabled(false); } BMailAccounts accounts; if (modifiers() & B_SHIFT_KEY) { - BMenu *accountMenu = new BMenu( - MDR_DIALECT_CHOICE ("Check for mails only","R) メール受信のみ")); + BMenu *accountMenu = new BMenu(B_TRANSLATE("Check for mails only")); BFont font; menu->GetFont(&font); accountMenu->SetFont(&font); @@ -577,7 +579,7 @@ DeskbarView::_BuildMenu() accountMenu->AddItem(new BMenuItem(account->Name(), message)); } if (accounts.CountAccounts() == 0) { - item = new BMenuItem("", NULL); + item = new BMenuItem(B_TRANSLATE(""), NULL); item->SetEnabled(false); accountMenu->AddItem(item); } @@ -586,27 +588,23 @@ DeskbarView::_BuildMenu() new BMessage(MD_CHECK_FOR_MAILS))); // Not used: - // menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ( - // "Check For Mails Only","メール受信のみ"), new BMessage(MD_CHECK_FOR_MAILS))); - menu->AddItem(new BMenuItem( - MDR_DIALECT_CHOICE ("Send pending mails", "M) 保留メールを送信"), - new BMessage(MD_SEND_MAILS))); + // menu->AddItem(new BMenuItem(B_TRANSLATE("Check For Mails Only"), + // new BMessage(MD_CHECK_FOR_MAILS))); + menu->AddItem(new BMenuItem(B_TRANSLATE("Send pending mails"), + new BMessage(MD_SEND_MAILS))); } else { - menu->AddItem(item = new BMenuItem( - MDR_DIALECT_CHOICE ("Check for mail now", "C) メールチェック"), + menu->AddItem(item = new BMenuItem(B_TRANSLATE("Check for mail now"), new BMessage(MD_CHECK_SEND_NOW))); if (accounts.CountAccounts() == 0) item->SetEnabled(false); } menu->AddSeparatorItem(); - menu->AddItem(new BMenuItem( - MDR_DIALECT_CHOICE ("Preferences", "P) メール環境設定") B_UTF8_ELLIPSIS, + menu->AddItem(new BMenuItem(B_TRANSLATE("Preferences" B_UTF8_ELLIPSIS), new BMessage(MD_OPEN_PREFS))); if (modifiers() & B_SHIFT_KEY) { - menu->AddItem(new BMenuItem( - MDR_DIALECT_CHOICE ("Shutdown mail services", "Q) 終了"), + menu->AddItem(new BMenuItem(B_TRANSLATE("Shutdown mail services"), new BMessage(B_QUIT_REQUESTED))); } diff --git a/src/servers/mail/Jamfile b/src/servers/mail/Jamfile index b555a2a5ce..43bd115b90 100644 --- a/src/servers/mail/Jamfile +++ b/src/servers/mail/Jamfile @@ -12,8 +12,6 @@ UsePrivateHeaders shared ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; -AddResources mail_daemon : mail_daemon.rdef DeskbarViewIcons.rdef ; - Server mail_daemon : DeskbarView.cpp ErrorLogWindow.cpp @@ -22,13 +20,22 @@ Server mail_daemon : main.cpp Notifier.cpp StatusWindow.cpp + : be libmail.so tracker $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSTDC++) + $(TARGET_NETWORK_LIBS) + : mail_daemon.rdef DeskbarViewIcons.rdef ; -LinkAgainst mail_daemon : be libmail.so tracker $(TARGET_LIBSTDC++) $(TARGET_NETWORK_LIBS) ; - Package haiku-maildaemon-cvs : mail_daemon : boot beos system servers ; Packages haiku-maildaemon-cvs : README LICENSE HISTORY install.sh ; + +DoCatalogs mail_daemon : + x-vnd.Haiku-mail_daemon + : + DeskbarView.cpp + MailDaemon.cpp + StatusWindow.cpp +; diff --git a/src/servers/mail/MailDaemon.cpp b/src/servers/mail/MailDaemon.cpp index e3c78f489e..ff86af53c7 100644 --- a/src/servers/mail/MailDaemon.cpp +++ b/src/servers/mail/MailDaemon.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include #include @@ -28,7 +29,10 @@ #include #include #include -#include + + +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "MailDaemon" void @@ -159,20 +163,15 @@ MailDaemonApp::ReadyToRun() } BString string; - MDR_DIALECT_CHOICE( - if (fNewMessages > 0) - string << fNewMessages; - else - string << "No"; + if (fNewMessages > 0) { if (fNewMessages != 1) - string << " new messages."; + string << fNewMessages << B_TRANSLATE(" new messages."); else - string << " new message.";, - if (fNewMessages > 0) - string << fNewMessages << " 通の未読メッセージがあります "; - else - string << "未読メッセージはありません"; - ); + string << fNewMessages << B_TRANSLATE(" new message."); + } + else + string = B_TRANSLATE("No new messages"); + fCentralBeep = false; fMailStatusWindow->SetDefaultMessage(string); @@ -473,9 +472,8 @@ MailDaemonApp::MessageReceived(BMessage* msg) if (fAlertString != B_EMPTY_STRING) { fAlertString.Truncate(fAlertString.Length() - 1); - BAlert* alert = new BAlert(MDR_DIALECT_CHOICE("New Messages", - "新着メッセージ"), fAlertString.String(), "OK", NULL, NULL, - B_WIDTH_AS_USUAL); + BAlert* alert = new BAlert(B_TRANSLATE("New Messages"), + fAlertString.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL); alert->SetFeel(B_NORMAL_WINDOW_FEEL); alert->Go(NULL); fAlertString = B_EMPTY_STRING; @@ -519,17 +517,13 @@ MailDaemonApp::MessageReceived(BMessage* msg) case 'numg': { int32 numMessages = msg->FindInt32("num_messages"); - MDR_DIALECT_CHOICE( - fAlertString << numMessages << " new message"; - if (numMessages > 1) - fAlertString << 's'; + if (numMessages > 1) + fAlertString << numMessages << B_TRANSLATE(" new messages"); + else + fAlertString << numMessages << B_TRANSLATE(" new message"); - fAlertString << " for " << msg->FindString("name") - << '\n';, - - fAlertString << msg->FindString("name") << "より\n" - << numMessages << " 通のメッセージが届きました  "; - ); + fAlertString << B_TRANSLATE(" for ") << msg->FindString("name") + << '\n'; break; } @@ -548,21 +542,14 @@ MailDaemonApp::MessageReceived(BMessage* msg) BString string; - MDR_DIALECT_CHOICE( - if (fNewMessages > 0) - string << fNewMessages; - else - string << "No"; + if (fNewMessages > 0) { if (fNewMessages != 1) - string << " new messages."; + string << fNewMessages << B_TRANSLATE(" new messages."); else - string << " new message.";, - - if (fNewMessages > 0) - string << fNewMessages << " 通の未読メッセージがあります"; - else - string << "未読メッセージはありません"; - ); + string << fNewMessages << B_TRANSLATE(" new message."); + } + else + string << B_TRANSLATE("No new messages."); fMailStatusWindow->SetDefaultMessage(string.String()); break; @@ -715,7 +702,7 @@ MailDaemonApp::SendPendingMessages(BMessage* msg) BVolume volume; map messages; - + int32 account = -1; if (msg->FindInt32("account", &account) != B_OK) diff --git a/src/servers/mail/StatusWindow.cpp b/src/servers/mail/StatusWindow.cpp index 1cb9362c7f..f18575012f 100644 --- a/src/servers/mail/StatusWindow.cpp +++ b/src/servers/mail/StatusWindow.cpp @@ -1,6 +1,6 @@ /* * Copyright 2001-2003 Dr. Zoidberg Enterprises. All rights reserved. - * Copyright 2004-2009, Haiku Inc. All rights reserved. + * Copyright 2004-2011, Haiku Inc. All rights reserved. * * Distributed under the terms of the MIT License. */ @@ -13,11 +13,10 @@ #include "MailSettings.h" -#include - #include #include #include +#include #include #include #include @@ -34,6 +33,10 @@ #include +#undef B_TRANSLATE_CONTEXT +#define B_TRANSLATE_CONTEXT "StatusWindow" + + static BLocker sLock; @@ -50,7 +53,7 @@ MailStatusWindow::MailStatusWindow(BRect rect, const char *name, frame.InsetBy(90.0 + 5.0, 5.0); fCheckNowButton = new BButton(frame, "check_mail", - MDR_DIALECT_CHOICE ("Check mail now","メールチェック"), + B_TRANSLATE("Check mail now"), new BMessage('mbth'), B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_NAVIGABLE); fCheckNowButton->ResizeToPreferred(); @@ -62,9 +65,9 @@ MailStatusWindow::MailStatusWindow(BRect rect, const char *name, frame.InsetBy(-90.0, 0.0); fMessageView = new BStringView(frame, "message_view", "", - B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE); + B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE); fMessageView->SetAlignment(B_ALIGN_CENTER); - fMessageView->SetText(MDR_DIALECT_CHOICE ("No new messages.","未読メッセージはありません")); + fMessageView->SetText(B_TRANSLATE("No new messages.")); float framewidth = frame.Width(); fMessageView->ResizeToPreferred(); fMessageView->ResizeTo(framewidth, fMessageView->Bounds().Height());