Ticket #7689: mail_daemon.patch

File mail_daemon.patch, 10.5 KB (added by taos, 13 years ago)

Patch to get rid of MDRLanguage.h.

  • src/preferences/mail/ConfigViews.cpp

     
    2828
    2929#include <MailSettings.h>
    3030
    31 #include <MDRLanguage.h>
    32 
    3331#include "FilterConfigView.h"
    3432
    3533
  • src/servers/mail/DeskbarView.cpp

     
    1010#include <malloc.h>
    1111
    1212#include <Bitmap.h>
     13#include <Catalog.h>
    1314#include <Deskbar.h>
    1415#include <Directory.h>
    1516#include <Entry.h>
     
    3637#include <E-mail.h>
    3738#include <MailDaemon.h>
    3839#include <MailSettings.h>
    39 #include <MDRLanguage.h>
    4040
    4141#include "DeskbarViewIcons.h"
    4242
     43
     44#undef B_TRANSLATE_CONTEXT
     45#define B_TRANSLATE_CONTEXT "DeskbarView"
     46
     47
    4348const char* kTrackerSignature = "application/x-vnd.Be-TRAK";
    4449
    4550
     
    462467    BPopUpMenu* menu = new BPopUpMenu(B_EMPTY_STRING, false, false);
    463468    menu->SetFont(be_plain_font);
    464469
    465     menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE (
    466         "Create new message", "N) 新規メッセージ作成")B_UTF8_ELLIPSIS,
    467         new BMessage(MD_OPEN_NEW)));
     470    menu->AddItem(new BMenuItem(B_TRANSLATE("Create new message"
     471        B_UTF8_ELLIPSIS), new BMessage(MD_OPEN_NEW)));
    468472    menu->AddSeparatorItem();
    469473
    470474    BMessenger tracker(kTrackerSignature);
     
    530534
    531535    // Hack for R5's buggy Query Notification
    532536    #ifdef HAIKU_TARGET_PLATFORM_BEOS
    533         menu->AddItem(new BMenuItem(
    534             MDR_DIALECT_CHOICE("Refresh New Mail Count",
    535                 "未読メールカウントを更新"),
     537        menu->AddItem(new BMenuItem(B_TRANSLATE("Refresh New Mail Count"),
    536538            new BMessage(MD_REFRESH_QUERY)));
    537539    #endif
    538540
     
    540542
    541543    if (fNewMessages > 0) {
    542544        BString string;
    543         MDR_DIALECT_CHOICE(
    544             string << fNewMessages << " new message"
    545                 << (fNewMessages != 1 ? "s" : B_EMPTY_STRING),
    546             string << fNewMessages << " 通の未読メッセージ");
     545        if (fNewMessages != 1)
     546            string << fNewMessages << B_TRANSLATE(" new messages");
     547        else
     548            string << fNewMessages << B_TRANSLATE(" new message");
    547549
    548550        _GetNewQueryRef(ref);
    549551
     
    554556        navMenu->SetNavDir(&ref);
    555557
    556558        menu->AddItem(item);
    557     } else {
    558         menu->AddItem(item = new BMenuItem(
    559             MDR_DIALECT_CHOICE ("No new messages","未読メッセージなし"), NULL));
     559    }
     560    else {
     561        menu->AddItem(item = new BMenuItem(B_TRANSLATE("No new messages"),
     562            NULL));
    560563        item->SetEnabled(false);
    561564    }
    562565
    563566    BMailAccounts accounts;
    564567    if (modifiers() & B_SHIFT_KEY) {
    565         BMenu *accountMenu = new BMenu(
    566             MDR_DIALECT_CHOICE ("Check for mails only","R) メール受信のみ"));
     568        BMenu *accountMenu = new BMenu(B_TRANSLATE("Check for mails only"));
    567569        BFont font;
    568570        menu->GetFont(&font);
    569571        accountMenu->SetFont(&font);
     
    577579            accountMenu->AddItem(new BMenuItem(account->Name(), message));
    578580        }
    579581        if (accounts.CountAccounts() == 0) {
    580             item = new BMenuItem("<no accounts>", NULL);
     582            item = new BMenuItem(B_TRANSLATE("<no accounts>"), NULL);
    581583            item->SetEnabled(false);
    582584            accountMenu->AddItem(item);
    583585        }
     
    586588            new BMessage(MD_CHECK_FOR_MAILS)));
    587589
    588590        // Not used:
    589         // menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE (
    590         // "Check For Mails Only","メール受信のみ"), new BMessage(MD_CHECK_FOR_MAILS)));
    591         menu->AddItem(new BMenuItem(
    592             MDR_DIALECT_CHOICE ("Send pending mails", "M) 保留メールを送信"),
    593         new BMessage(MD_SEND_MAILS)));
     591        // menu->AddItem(new BMenuItem(B_TRANSLATE("Check For Mails Only"),
     592        // new BMessage(MD_CHECK_FOR_MAILS)));
     593        menu->AddItem(new BMenuItem(B_TRANSLATE("Send pending mails"),
     594            new BMessage(MD_SEND_MAILS)));
    594595    } else {
    595         menu->AddItem(item = new BMenuItem(
    596             MDR_DIALECT_CHOICE ("Check for mail now", "C) メールチェック"),
     596        menu->AddItem(item = new BMenuItem(B_TRANSLATE("Check for mail now"),
    597597            new BMessage(MD_CHECK_SEND_NOW)));
    598598        if (accounts.CountAccounts() == 0)
    599599            item->SetEnabled(false);
    600600    }
    601601
    602602    menu->AddSeparatorItem();
    603     menu->AddItem(new BMenuItem(
    604         MDR_DIALECT_CHOICE ("Preferences", "P) メール環境設定") B_UTF8_ELLIPSIS,
     603    menu->AddItem(new BMenuItem(B_TRANSLATE("Preferences" B_UTF8_ELLIPSIS),
    605604        new BMessage(MD_OPEN_PREFS)));
    606605
    607606    if (modifiers() & B_SHIFT_KEY) {
    608         menu->AddItem(new BMenuItem(
    609             MDR_DIALECT_CHOICE ("Shutdown mail services", "Q) 終了"),
     607        menu->AddItem(new BMenuItem(B_TRANSLATE("Shutdown mail services"),
    610608            new BMessage(B_QUIT_REQUESTED)));
    611609    }
    612610
  • src/servers/mail/MailDaemon.cpp

     
    1313#include <vector>
    1414
    1515#include <Beep.h>
     16#include <Catalog.h>
    1617#include <Deskbar.h>
    1718#include <Directory.h>
    1819#include <Entry.h>
     
    2829#include <MailDaemon.h>
    2930#include <MailMessage.h>
    3031#include <MailSettings.h>
    31 #include <MDRLanguage.h>
    3232
    3333
     34#undef B_TRANSLATE_CONTEXT
     35#define B_TRANSLATE_CONTEXT "MailDaemon"
     36
     37
    3438void
    3539makeIndices()
    3640{
     
    159163    }
    160164
    161165    BString string;
    162     MDR_DIALECT_CHOICE(
    163         if (fNewMessages > 0)
    164             string << fNewMessages;
    165         else
    166             string << "No";
     166    if (fNewMessages > 0) {
    167167        if (fNewMessages != 1)
    168             string << " new messages.";
     168            string << fNewMessages << B_TRANSLATE(" new messages.");
    169169        else
    170             string << " new message.";,
    171         if (fNewMessages > 0)
    172             string << fNewMessages << " 通の未読メッセージがあります ";
    173         else
    174             string << "未読メッセージはありません";
    175     );
     170            string << fNewMessages << B_TRANSLATE(" new message.");
     171    }
     172    else
     173        string = B_TRANSLATE("No new messages.");
     174
    176175    fCentralBeep = false;
    177176    fMailStatusWindow->SetDefaultMessage(string);
    178177
     
    473472
    474473            if (fAlertString != B_EMPTY_STRING) {
    475474                fAlertString.Truncate(fAlertString.Length() - 1);
    476                 BAlert* alert = new BAlert(MDR_DIALECT_CHOICE("New Messages",
    477                     "新着メッセージ"), fAlertString.String(), "OK", NULL, NULL,
    478                     B_WIDTH_AS_USUAL);
     475                BAlert* alert = new BAlert(B_TRANSLATE("New Messages"),
     476                    fAlertString.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL);
    479477                alert->SetFeel(B_NORMAL_WINDOW_FEEL);
    480478                alert->Go(NULL);
    481479                fAlertString = B_EMPTY_STRING;
     
    519517        case 'numg':
    520518        {
    521519            int32 numMessages = msg->FindInt32("num_messages");
    522             MDR_DIALECT_CHOICE(
    523                 fAlertString << numMessages << " new message";
    524                 if (numMessages > 1)
    525                     fAlertString << 's';
     520            if (numMessages > 1)
     521                fAlertString << numMessages << B_TRANSLATE(" new messages");
     522            else
     523                fAlertString << numMessages << B_TRANSLATE(" new message");
    526524
    527                 fAlertString << " for " << msg->FindString("name")
    528                     << '\n';,
    529 
    530                 fAlertString << msg->FindString("name") << "より\n"
    531                     << numMessages << " 通のメッセージが届きました  ";
    532             );
     525            fAlertString << B_TRANSLATE(" for ") << msg->FindString("name")
     526                << '\n';
    533527            break;
    534528        }
    535529
     
    548542
    549543            BString string;
    550544
    551             MDR_DIALECT_CHOICE(
    552                 if (fNewMessages > 0)
    553                     string << fNewMessages;
    554                 else
    555                     string << "No";
     545            if (fNewMessages > 0) {
    556546                if (fNewMessages != 1)
    557                     string << " new messages.";
     547                    string << fNewMessages << B_TRANSLATE(" new messages.");
    558548                else
    559                     string << " new message.";,
     549                    string << fNewMessages << B_TRANSLATE(" new message.");
     550            }
     551            else
     552                string << B_TRANSLATE("No new messages.");
    560553
    561                 if (fNewMessages > 0)
    562                     string << fNewMessages << " 通の未読メッセージがあります";
    563                 else
    564                     string << "未読メッセージはありません";
    565             );
    566 
    567554            fMailStatusWindow->SetDefaultMessage(string.String());
    568555            break;
    569556        }
     
    715702    BVolume volume;
    716703
    717704    map<int32, send_mails_info> messages;
    718 
    719705
     706
    720707    int32 account = -1;
    721708    if (msg->FindInt32("account", &account) != B_OK)
    722709        account = -1;
  • src/servers/mail/StatusWindow.cpp

     
    11/*
    22 * Copyright 2001-2003 Dr. Zoidberg Enterprises. All rights reserved.
    3  * Copyright 2004-2009, Haiku Inc. All rights reserved.
     3 * Copyright 2004-2011, Haiku Inc. All rights reserved.
    44 *
    55 * Distributed under the terms of the MIT License.
    66 */
     
    1313
    1414#include "MailSettings.h"
    1515
    16 #include <MDRLanguage.h>
    17 
    1816#include <Application.h>
    1917#include <Box.h>
    2018#include <Button.h>
     19#include <Catalog.h>
    2120#include <Directory.h>
    2221#include <E-mail.h>
    2322#include <FindDirectory.h>
     
    3433#include <assert.h>
    3534
    3635
     36#undef B_TRANSLATE_CONTEXT
     37#define B_TRANSLATE_CONTEXT "StatusWindow"
     38
     39
    3740static BLocker sLock;
    3841
    3942
     
    5053    frame.InsetBy(90.0 + 5.0, 5.0);
    5154
    5255    fCheckNowButton = new BButton(frame, "check_mail",
    53         MDR_DIALECT_CHOICE ("Check mail now","メールチェック"),
     56        B_TRANSLATE("Check mail now"),
    5457        new BMessage('mbth'), B_FOLLOW_LEFT_RIGHT,
    5558        B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_NAVIGABLE);
    5659    fCheckNowButton->ResizeToPreferred();
     
    6265    frame.InsetBy(-90.0, 0.0);
    6366
    6467    fMessageView = new BStringView(frame, "message_view", "",
    65                                    B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE);
     68        B_FOLLOW_LEFT_RIGHT, B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE);
    6669    fMessageView->SetAlignment(B_ALIGN_CENTER);
    67     fMessageView->SetText(MDR_DIALECT_CHOICE ("No new messages.","未読メッセージはありません"));
     70    fMessageView->SetText(B_TRANSLATE("No new messages."));
    6871    float framewidth = frame.Width();
    6972    fMessageView->ResizeToPreferred();
    7073    fMessageView->ResizeTo(framewidth, fMessageView->Bounds().Height());
  • src/servers/mail/Jamfile

     
    1212
    1313SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
    1414
    15 AddResources mail_daemon : mail_daemon.rdef DeskbarViewIcons.rdef ;
    16 
    1715Server mail_daemon :
    1816    DeskbarView.cpp
    1917    ErrorLogWindow.cpp
     
    2220    main.cpp
    2321    Notifier.cpp
    2422    StatusWindow.cpp
     23    : be libmail.so tracker $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSTDC++)
     24        $(TARGET_NETWORK_LIBS)
     25    : mail_daemon.rdef DeskbarViewIcons.rdef
    2526;
    2627
    27 LinkAgainst mail_daemon : be libmail.so tracker $(TARGET_LIBSTDC++) $(TARGET_NETWORK_LIBS) ;
    28 
    2928Package haiku-maildaemon-cvs :
    3029    mail_daemon :
    3130    boot beos system servers ;
    3231
    3332Packages haiku-maildaemon-cvs :
    3433    README LICENSE HISTORY install.sh ;
     34
     35DoCatalogs mail_daemon :
     36    x-vnd.Haiku-mail_daemon
     37    :
     38    DeskbarView.cpp
     39    MailDaemon.cpp
     40    StatusWindow.cpp
     41;