Ticket #7689: mail_daemon-addons.patch

File 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.

  • src/add-ons/mail_daemon/inbound_protocols/pop3/ConfigView.cpp

     
    77 */
    88
    99
     10#include <Catalog.h>
    1011#include <FileConfigView.h>
    1112#include <MailAddon.h>
    1213#include <MailPrivate.h>
    1314#include <ProtocolConfigView.h>
    1415
    1516
     17#undef B_TRANSLATE_CONTEXT
     18#define B_TRANSLATE_CONTEXT "ConfigView"
     19
     20
    1621class POP3ConfigView : public BMailProtocolConfigView {
    1722public:
    1823                                POP3ConfigView(MailAddonSettings& settings,
     
    4752
    4853    SetTo(settings);
    4954
    50     fFileView =  new BMailFileConfigView("Destination:", "destination",
    51         false, BPrivate::default_mail_in_directory().Path());
     55    fFileView =  new BMailFileConfigView(B_TRANSLATE("Destination:"),
     56        "destination", false, BPrivate::default_mail_in_directory().Path());
    5257    fFileView->SetTo(&settings.Settings(), NULL);
    5358    AddChild(fFileView);
    5459    float w, h;
  • src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp

     
    3131
    3232#include <Alert.h>
    3333#include <fs_attr.h>
     34#include <Catalog.h>
    3435#include <Debug.h>
    3536#include <Directory.h>
    3637#include <Path.h>
     
    4243#include "MailSettings.h"
    4344#include "MessageIO.h"
    4445
    45 #include <MDRLanguage.h>
    4646
     47#undef B_TRANSLATE_CONTEXT
     48#define B_TRANSLATE_CONTEXT "pop3"
     49
     50
    4751#define POP3_RETRIEVAL_TIMEOUT 60000000
    4852#define CRLF    "\r\n"
    4953
     
    140144    _ReadManifest();
    141145
    142146    SetTotalItems(2);
    143     ReportProgress(0, 1, "Connect to server...");
     147    ReportProgress(0, 1, B_TRANSLATE("Connect to server" B_UTF8_ELLIPSIS));
    144148    status_t error = Connect();
    145149    if (error < B_OK) {
    146150        ResetProgress();
    147151        return error;
    148152    }
    149153
    150     ReportProgress(0, 1, MDR_DIALECT_CHOICE("Getting UniqueIDs...",
    151         "固有のIDを取得中..."));
     154    ReportProgress(0, 1, B_TRANSLATE("Getting UniqueIDs" B_UTF8_ELLIPSIS));
    152155    error = _UniqueIDs();
    153156    if (error < B_OK) {
    154157        ResetProgress();
     
    326329status_t
    327330POP3Protocol::Open(const char *server, int port, int)
    328331{
    329     ReportProgress(0, 0, MDR_DIALECT_CHOICE("Connecting to POP3 server...",
    330         "POP3サーバに接続しています..."));
     332    ReportProgress(0, 0, B_TRANSLATE("Connecting to POP3 server"
     333        B_UTF8_ELLIPSIS));
    331334
    332335    if (port <= 0) {
    333336#ifdef USE_SSL
     
    341344
    342345    // Prime the error message
    343346    BString error_msg;
    344     error_msg << MDR_DIALECT_CHOICE("Error while connecting to server ",
    345         "サーバに接続中にエラーが発生しました ") << server;
     347    error_msg << B_TRANSLATE("Error while connecting to server ") << server;
    346348    if (port != 110)
    347349        error_msg << ":" << port;
    348350
     
    354356    }
    355357
    356358    if (hostIP == 0) {
    357         error_msg << MDR_DIALECT_CHOICE(": Connection refused or host not found",
    358             ": :接続が拒否されたかサーバーが見つかりません");
     359        error_msg << B_TRANSLATE(": Connection refused or host not found");
    359360        ShowError(error_msg.String());
    360361
    361362        return B_NAME_NOT_FOUND;
     
    368369        saAddr.sin_family = AF_INET;
    369370        saAddr.sin_port = htons(port);
    370371        saAddr.sin_addr.s_addr = hostIP;
    371         int result = connect(fSocket, (struct sockaddr *) &saAddr, sizeof(saAddr));
     372        int result = connect(fSocket, (struct sockaddr *) &saAddr,
     373            sizeof(saAddr));
    372374        if (result < 0) {
    373375            close(fSocket);
    374376            fSocket = -1;
     
    377379            return errno;
    378380        }
    379381    } else {
    380         error_msg << ": Could not allocate socket.";
     382        error_msg << B_TRANSLATE(": Could not allocate socket.");
    381383        ShowError(error_msg.String());
    382384        return B_ERROR;
    383385    }
     
    424426
    425427    if (strncmp(line.String(), "+OK", 3) != 0) {
    426428        if (line.Length() > 0) {
    427             error_msg << MDR_DIALECT_CHOICE(". The server said:\n",
    428                 "サーバのメッセージです\n") << line.String();
     429            error_msg << B_TRANSLATE(". The server said:\n")
     430                << line.String();
    429431        } else
    430             error_msg << ": No reply.\n";
     432            error_msg << B_TRANSLATE(": No reply.\n");
    431433
    432434        ShowError(error_msg.String());
    433435        return B_ERROR;
     
    444446    status_t err;
    445447
    446448    BString error_msg;
    447     error_msg << MDR_DIALECT_CHOICE("Error while authenticating user ",
    448         "ユーザー認証中にエラーが発生しました ") << uid;
     449    error_msg << B_TRANSLATE("Error while authenticating user ") << uid;
    449450
    450451    if (method == 1) {  //APOP
    451452        int32 index = fLog.FindFirst("<");
    452453        if(index != B_ERROR) {
    453             ReportProgress(0, 0, MDR_DIALECT_CHOICE(
    454                 "Sending APOP authentication...", "APOP認証情報を送信中..."));
     454            ReportProgress(0, 0, B_TRANSLATE("Sending APOP authentication"
     455                B_UTF8_ELLIPSIS));
    455456            int32 end = fLog.FindFirst(">",index);
    456457            BString timestamp("");
    457458            fLog.CopyInto(timestamp, index, end - index + 1);
     
    466467
    467468            err = SendCommand(cmd.String());
    468469            if (err != B_OK) {
    469                 error_msg << MDR_DIALECT_CHOICE(". The server said:\n",
    470                     "サーバのメッセージです\n") << fLog;
     470                error_msg << B_TRANSLATE(". The server said:\n") << fLog;
    471471                ShowError(error_msg.String());
    472472                return err;
    473473            }
    474474
    475475            return B_OK;
    476476        } else {
    477             error_msg << MDR_DIALECT_CHOICE(": The server does not support APOP.",
    478                 "サーバはAPOPをサポートしていません");
     477            error_msg << B_TRANSLATE(": The server does not support APOP.");
    479478            ShowError(error_msg.String());
    480479            return B_NOT_ALLOWED;
    481480        }
    482481    }
    483     ReportProgress(0, 0, MDR_DIALECT_CHOICE("Sending username...",
    484         "ユーザーID送信中..."));
     482    ReportProgress(0, 0, B_TRANSLATE("Sending username" B_UTF8_ELLIPSIS));
    485483
    486484    BString cmd = "USER ";
    487485    cmd += uid;
     
    489487
    490488    err = SendCommand(cmd.String());
    491489    if (err != B_OK) {
    492         error_msg << MDR_DIALECT_CHOICE(". The server said:\n",
    493             "サーバのメッセージです\n") << fLog;
     490        error_msg << B_TRANSLATE(". The server said:\n") << fLog;
    494491        ShowError(error_msg.String());
    495492        return err;
    496493    }
    497494
    498     ReportProgress(0, 0, MDR_DIALECT_CHOICE("Sending password...",
    499         "パスワード送信中..."));
     495    ReportProgress(0, 0, B_TRANSLATE("Sending password" B_UTF8_ELLIPSIS));
    500496    cmd = "PASS ";
    501497    cmd += password;
    502498    cmd += CRLF;
    503499
    504500    err = SendCommand(cmd.String());
    505501    if (err != B_OK) {
    506         error_msg << MDR_DIALECT_CHOICE(". The server said:\n",
    507             "サーバのメッセージです\n") << fLog;
     502        error_msg << B_TRANSLATE(". The server said:\n") << fLog;
    508503        ShowError(error_msg.String());
    509504        return err;
    510505    }
     
    516511status_t
    517512POP3Protocol::Stat()
    518513{
    519     ReportProgress(0, 0, MDR_DIALECT_CHOICE("Getting mailbox size...",
    520         "メールボックスのサイズを取得しています..."));
     514    ReportProgress(0, 0, B_TRANSLATE("Getting mailbox size" B_UTF8_ELLIPSIS));
    521515
    522516    if (SendCommand("STAT" CRLF) < B_OK)
    523517        return B_ERROR;
  • src/add-ons/mail_daemon/inbound_protocols/pop3/Jamfile

     
    3030
    3131Addon POP3
    3232    : $(sources)
    33     : be libmail.so $(TARGET_NETWORK_LIBS) $(HAIKU_OPENSSL_LIBS)
    34         $(TARGET_LIBSUPC++)
     33    : be libmail.so $(HAIKU_LOCALE_LIBS) $(HAIKU_OPENSSL_LIBS)
     34        $(TARGET_LIBSUPC++) $(TARGET_NETWORK_LIBS)
    3535;
    3636
    3737Package haiku-maildaemon-cvs :
    3838    POP3 :
    3939    boot home config add-ons mail_daemon inbound_protocols
    4040;
     41
     42DoCatalogs POP3 :
     43    x-vnd.Haiku-POP3
     44    :
     45    ConfigView.cpp
     46    pop3.cpp
     47;
  • src/add-ons/mail_daemon/inbound_protocols/imap/Jamfile

     
    3333    :
    3434    $(sources)
    3535    :
    36     be libmail.so $(TARGET_NETWORK_LIBS) libalm.so
     36    be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_NETWORK_LIBS) libalm.so
    3737        libshared.a $(TARGET_LIBSUPC++) $(TARGET_LIBSTDC++)
    3838;
    3939
     
    4646    IMAP :
    4747    boot home config add-ons mail_daemon inbound_protocols
    4848;
     49
     50DoCatalogs IMAP :
     51    x-vnd.Haiku-IMAP
     52    :
     53    imap_config.cpp
     54    IMAPFolderConfig.cpp
     55;
  • src/add-ons/mail_daemon/inbound_protocols/imap/IMAPFolderConfig.cpp

     
    77
    88#include "IMAPFolderConfig.h"
    99
     10#include <Catalog.h>
    1011#include <ControlLook.h>
    1112#include <ListItem.h>
    1213#include <SpaceLayoutItem.h>
     
    1819#include <crypt.h>
    1920
    2021
     22#undef B_TRANSLATE_CONTEXT
     23#define B_TRANSLATE_CONTEXT "IMAPFolderConfig"
     24
     25
    2126class EditableListItem {
    2227public:
    2328                                EditableListItem();
     
    9095    BRect boxRect(0.0f, 2.0f, ceilf(3.0f + fontHeight.ascent),
    9196        ceilf(5.0f + fontHeight.ascent));
    9297
    93 
     98
    9499    fBoxRect.left = itemRect.right - boxRect.Width();
    95100    fBoxRect.top = itemRect.top + (itemRect.Height() - boxRect.Height()) / 2;
    96101    fBoxRect.right = itemRect.right;
     
    152157    BListView(name, type, flags),
    153158    fLastMouseDown(NULL)
    154159{
    155 
     160
    156161}
    157162
    158163
     
    201206public:
    202207    StatusWindow(const char* text)
    203208        :
    204         BWindow(BRect(0, 0, 10, 10), "status", B_MODAL_WINDOW_LOOK,
     209        BWindow(BRect(0, 0, 10, 10), B_TRANSLATE("status"), B_MODAL_WINDOW_LOOK,
    205210            B_MODAL_APP_WINDOW_FEEL, B_NO_WORKSPACE_ACTIVATION | B_NOT_ZOOMABLE
    206211            | B_AVOID_FRONT | B_NOT_RESIZABLE)
    207212    {
     
    230235
    231236FolderConfigWindow::FolderConfigWindow(BRect parent, const BMessage& settings)
    232237    :
    233     BWindow(BRect(0, 0, 300, 300), "IMAP Folders", B_TITLED_WINDOW_LOOK,
    234         B_MODAL_APP_WINDOW_FEEL, B_NO_WORKSPACE_ACTIVATION | B_NOT_ZOOMABLE
    235             | B_AVOID_FRONT),
     238    BWindow(BRect(0, 0, 300, 300), B_TRANSLATE("IMAP Folders"),
     239        B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, B_NO_WORKSPACE_ACTIVATION
     240        | B_NOT_ZOOMABLE | B_AVOID_FRONT),
    236241    fSettings(settings)
    237242{
    238243    BView* rootView = new BView(Bounds(), "root", B_FOLLOW_ALL, B_WILL_DRAW);
     
    244249    rootView->SetLayout(layout);
    245250    layout->SetInset(spacing);
    246251
    247     fFolderListView = new EditListView("IMAP Folders");
     252    fFolderListView = new EditListView(B_TRANSLATE("IMAP Folders"));
    248253    fFolderListView->SetExplicitPreferredSize(BSize(B_SIZE_UNLIMITED,
    249254        B_SIZE_UNLIMITED));
    250     fApplyButton = new BButton("Apply", "Apply", new BMessage(kMsgApplyButton));
     255    fApplyButton = new BButton("Apply", B_TRANSLATE("Apply"),
     256        new BMessage(kMsgApplyButton));
    251257
    252258    fQuotaView = new BStringView("quota view",
    253         "Failed to fetch available storage.");
     259        B_TRANSLATE("Failed to fetch available storage."));
    254260    fQuotaView->SetExplicitAlignment(BAlignment(B_ALIGN_LEFT,
    255261        B_ALIGN_VERTICAL_CENTER));
    256262
     
    294300void
    295301FolderConfigWindow::_LoadFolders()
    296302{
    297     StatusWindow* status = new StatusWindow("Fetching IMAP folders, have "
    298         "patience...");
     303    StatusWindow* status = new StatusWindow(B_TRANSLATE("Fetching IMAP "
     304        "folders, have patience" B_UTF8_ELLIPSIS));
    299305    status->Show();
    300306
    301307    BString server;
     
    356362    if (!haveChanges)
    357363        return;
    358364
    359     StatusWindow* status = new StatusWindow("Subcribe / Unsuscribe IMAP "
    360         "folders, have patience...");
     365    StatusWindow* status = new StatusWindow(B_TRANSLATE("Subcribe / Unsuscribe "
     366        "IMAP folders, have patience" B_UTF8_ELLIPSIS));
    361367    status->Show();
    362368
    363369    for (unsigned int i = 0; i < fFolderList.size(); i++) {
  • src/add-ons/mail_daemon/inbound_protocols/imap/imap_config.cpp

     
    88
    99
    1010#include <Button.h>
     11#include <Catalog.h>
    1112#include <TextControl.h>
    1213
    1314#include <MailAddon.h>
     
    1617#include <FileConfigView.h>
    1718#include <ProtocolConfigView.h>
    1819#include <MailPrivate.h>
    19 #include <MDRLanguage.h>
    2020
    2121#include "IMAPFolderConfig.h"
    2222
    2323
     24#undef B_TRANSLATE_CONTEXT
     25#define B_TRANSLATE_CONTEXT "imap_config"
     26
     27
    2428const uint32 kMsgOpenIMAPFolder = '&OIF';
    2529
    2630
     
    7074    ((BControl *)(FindView("delete_remote_when_local")))->SetEnabled(true);
    7175    ((BControl *)(FindView("delete_remote_when_local")))->MoveBy(0, -25);
    7276
    73     fIMAPFolderButton = new BButton(frame, "IMAP Folders", "IMAP Folders",
    74         new BMessage(kMsgOpenIMAPFolder));
     77    fIMAPFolderButton = new BButton(frame, "IMAP Folders", B_TRANSLATE(
     78        "IMAP Folders"), new BMessage(kMsgOpenIMAPFolder));
    7579    AddChild(fIMAPFolderButton);
    7680
    7781    frame.right -= 10;
     
    7983    BPath defaultFolder = BPrivate::default_mail_directory();
    8084    defaultFolder.Append(accountSettings.Name());
    8185
    82     fFileView =  new BMailFileConfigView("Destination:", "destination",
    83         false, defaultFolder.Path());
     86    fFileView =  new BMailFileConfigView(B_TRANSLATE("Destination:"),
     87        "destination", false, defaultFolder.Path());
    8488    fFileView->SetTo(&settings.Settings(), NULL);
    8589    AddChild(fFileView);
    8690    fFileView->MoveBy(0, frame.bottom + 5);
  • src/add-ons/mail_daemon/outbound_protocols/smtp/ConfigView.cpp

     
    99
    1010#include <TextControl.h>
    1111
     12#include <Catalog.h>
    1213#include <FileConfigView.h>
    1314#include <MailAddon.h>
    14 #include <MDRLanguage.h>
    1515#include <MenuField.h>
    1616#include <MailPrivate.h>
    1717#include <ProtocolConfigView.h>
    1818
    1919
     20#undef B_TRANSLATE_CONTEXT
     21#define B_TRANSLATE_CONTEXT "ConfigView"
     22
     23
    2024class SMTPConfigView : public BMailProtocolConfigView {
    2125public:
    2226                                SMTPConfigView(MailAddonSettings& settings,
     
    4549    AddFlavor("STARTTLS");
    4650#endif
    4751
    48     AddAuthMethod(MDR_DIALECT_CHOICE("None","無し"), false);
    49     AddAuthMethod(MDR_DIALECT_CHOICE("ESMTP","ESMTP"));
    50     AddAuthMethod(MDR_DIALECT_CHOICE("POP3 before SMTP","送信前に受信する"), false);
     52    AddAuthMethod(B_TRANSLATE("None"), false);
     53    AddAuthMethod(B_TRANSLATE("ESMTP"));
     54    AddAuthMethod(B_TRANSLATE("POP3 before SMTP"), false);
    5155
    5256    BTextControl *control = (BTextControl *)(FindView("host"));
    53     control->SetLabel(MDR_DIALECT_CHOICE("SMTP server: ","SMTPサーバ: "));
     57    control->SetLabel(B_TRANSLATE("SMTP server: "));
    5458
    5559    // Reset the dividers after changing one
    5660    float widestLabel = 0;
     
    6872
    6973    SetTo(settings);
    7074
    71     fFileView = new BMailFileConfigView("Destination:", "path", false,
    72         BPrivate::default_mail_out_directory().Path());
     75    fFileView = new BMailFileConfigView(B_TRANSLATE("Destination:"), "path",
     76        false, BPrivate::default_mail_out_directory().Path());
    7377    fFileView->SetTo(&settings.Settings(), NULL);
    7478    AddChild(fFileView);
    7579    float w, h;
  • src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp

     
    2626#include <unistd.h>
    2727
    2828#include <Alert.h>
     29#include <Catalog.h>
    2930#include <DataIO.h>
    3031#include <Entry.h>
    3132#include <File.h>
     
    4647#   include "md5.h"
    4748#endif
    4849
    49 #include <MDRLanguage.h>
    5050
     51#undef B_TRANSLATE_CONTEXT
     52#define B_TRANSLATE_CONTEXT "smtp"
    5153
     54
    5255#define CRLF "\r\n"
    5356#define SMTP_RESPONSE_SIZE 8192
    5457
     
    268271        // to the SMTP server first...
    269272        status_t status = _POP3Authentication();
    270273        if (status < B_OK) {
    271             error_msg << MDR_DIALECT_CHOICE ("POP3 authentication failed. The server said:\n","POP3認証に失敗しました\n") << fLog;
     274            error_msg << B_TRANSLATE("POP3 authentication failed. The server "
     275                "said:\n") << fLog;
    272276            ShowError(error_msg.String());
    273277            return status;
    274278        }
     
    277281    status = Open(fSettingsMessage.FindString("server"),
    278282        fSettingsMessage.FindInt32("port"), authMethod == 1);
    279283    if (status < B_OK) {
    280         error_msg << MDR_DIALECT_CHOICE ("Error while opening connection to ","接続中にエラーが発生しました") << fSettingsMessage.FindString("server");
     284        error_msg << B_TRANSLATE("Error while opening connection to ")
     285            << fSettingsMessage.FindString("server");
    281286
    282287        if (fSettingsMessage.FindInt32("port") > 0)
    283288            error_msg << ":" << fSettingsMessage.FindInt32("port");
    284289
    285290        // << strerror(err) - BNetEndpoint sucks, we can't use this;
    286291        if (fLog.Length() > 0)
    287             error_msg << ". The server says:\n" << fLog;
     292            error_msg << B_TRANSLATE(". The server says:\n") << fLog;
    288293        else
    289             error_msg << MDR_DIALECT_CHOICE (": Connection refused or host not found.",";接続が拒否されたかサーバーが見つかりません");
     294            error_msg << B_TRANSLATE(": Connection refused or host not found.");
    290295
    291296        ShowError(error_msg.String());
    292297
     
    299304
    300305    if (status != B_OK) {
    301306        //-----This is a really cool kind of error message. How can we make it work for POP3?
    302         error_msg << MDR_DIALECT_CHOICE ("Error while logging in to ","ログイン中にエラーが発生しました\n") << fSettingsMessage.FindString("server")
    303             << MDR_DIALECT_CHOICE (". The server said:\n","サーバーエラー\n") << fLog;
     307        error_msg << B_TRANSLATE("Error while logging in to ")
     308            << fSettingsMessage.FindString("server")
     309            << B_TRANSLATE(". The server said:\n") << fLog;
    304310        ShowError(error_msg.String());
    305311    }
    306312    return B_OK;
     
    350356status_t
    351357SMTPProtocol::Open(const char *address, int port, bool esmtp)
    352358{
    353     ReportProgress(0, 0, MDR_DIALECT_CHOICE ("Connecting to server...","接続中..."));
     359    ReportProgress(0, 0, B_TRANSLATE("Connecting to server" B_UTF8_ELLIPSIS));
    354360
    355361    #ifdef USE_SSL
    356362        use_ssl = (fSettingsMessage.FindInt32("flavor") == 1);
     
    408414
    409415        if (SSL_connect(ssl) <= 0) {
    410416            BString error;
    411             error << "Could not connect to SMTP server " << fSettingsMessage.FindString("server");
     417            error << "Could not connect to SMTP server "
     418                << fSettingsMessage.FindString("server");
    412419            if (port != 465)
    413420                error << ":" << port;
    414421            error << ". (SSL connection error)";
  • src/add-ons/mail_daemon/outbound_protocols/smtp/Jamfile

     
    2727Addon SMTP
    2828    : $(sources)
    2929    : be libmail.so $(TARGET_NETWORK_LIBS) $(TARGET_LIBSTDC++)
    30         $(HAIKU_OPENSSL_LIBS)
     30        $(HAIKU_LOCALE_LIBS) $(HAIKU_OPENSSL_LIBS)
    3131;
     32
     33DoCatalogs SMTP :
     34    x-vnd.Haiku-SMTP
     35    :
     36    ConfigView.cpp
     37    smtp.cpp
     38;
  • src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.cpp

     
    66
    77#include "ConfigView.h"
    88
     9#include <Catalog.h>
    910#include <CheckBox.h>
    1011#include <PopUpMenu.h>
    1112#include <MenuItem.h>
     
    1314#include <String.h>
    1415#include <Message.h>
    1516
    16 #include <MDRLanguage.h>
    17 
    1817#include <MailAddon.h>
    1918#include <MailSettings.h>
    2019
     20
     21#undef B_TRANSLATE_CONTEXT
     22#define B_TRANSLATE_CONTEXT "ConfigView"
     23
     24
    2125const uint32 kMsgNotifyMethod = 'nomt';
    2226
    2327
     
    2933    // determine font height
    3034    font_height fontHeight;
    3135    GetFontHeight(&fontHeight);
    32     float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent + fontHeight.leading) + 6;
    33 
     36    float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent
     37        + fontHeight.leading) + 6;
     38
    3439    BRect frame(5,2,250,itemHeight + 2);
    3540    BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING,false,false);
    3641
    3742    const char *notifyMethods[] = {
    38         MDR_DIALECT_CHOICE ("Beep","音"),
    39         MDR_DIALECT_CHOICE ("Alert","窓(メール毎)"),
    40         MDR_DIALECT_CHOICE ("Keyboard LEDs","キーボードLED"),
    41         MDR_DIALECT_CHOICE ("Central alert","窓(一括)"),
    42         "Central beep","Log window"};
    43     for (int32 i = 0,j = 1;i < 6;i++,j *= 2)
    44         menu->AddItem(new BMenuItem(notifyMethods[i],new BMessage(kMsgNotifyMethod)));
     43        B_TRANSLATE("Beep"),
     44        B_TRANSLATE("Alert"),
     45        B_TRANSLATE("Keyboard LEDs"),
     46        B_TRANSLATE("Central alert"),
     47        B_TRANSLATE("Central beep"),
     48        B_TRANSLATE("Log window")};
     49    for (int32 i = 0,j = 1; i < 6; i++, j *= 2)
     50        menu->AddItem(new BMenuItem(notifyMethods[i],
     51            new BMessage(kMsgNotifyMethod)));
    4552
    46     BMenuField *field = new BMenuField(frame,"notify",
    47         MDR_DIALECT_CHOICE ("Method:","方法:"),menu);
     53    BMenuField *field = new BMenuField(frame,"notify", B_TRANSLATE("Method:"),
     54        menu);
    4855    field->ResizeToPreferred();
    49     field->SetDivider(field->StringWidth(
    50         MDR_DIALECT_CHOICE ("Method:","方法:")) + 6);
     56    field->SetDivider(field->StringWidth(B_TRANSLATE("Method:")) + 6);
    5157    AddChild(field);
    5258
    5359    ResizeToPreferred();
    54 }
     60}
    5561
    5662
    5763void ConfigView::AttachedToWindow()
     
    112118            BMenuItem *item;
    113119            if (msg->FindPointer("source",(void **)&item) < B_OK)
    114120                break;
    115 
     121
    116122            item->SetMarked(!item->IsMarked());
    117123            UpdateNotifyText();
    118124            break;
     
    144150    return B_OK;
    145151}
    146152
    147 
     153
    148154void ConfigView::GetPreferredSize(float *width, float *height)
    149155{
    150156    *width = 258;
  • src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp

     
    55*/
    66
    77
    8 #include <Message.h>
    9 #include <String.h>
    108#include <Alert.h>
     9#include <Application.h>
    1110#include <Beep.h>
     11#include <Catalog.h>
     12#include <Message.h>
    1213#include <Path.h>
    13 #include <Application.h>
     14#include <String.h>
    1415
    1516#include <MailAddon.h>
    16 #include <MDRLanguage.h>
    1717
    1818#include "ConfigView.h"
    1919
    2020
     21#undef B_TRANSLATE_CONTEXT
     22#define B_TRANSLATE_CONTEXT "filter"
     23
     24
    2125class NotifyFilter : public MailFilter
    2226{
    2327public:
     
    6468
    6569    if (fStrategy & alert) {
    6670        BString text;
    67         MDR_DIALECT_CHOICE (
    68         text << "You have " << fNNewMessages << " new message" << ((fNNewMessages != 1) ? "s" : "")
    69         << " for " << fMailProtocol.AccountSettings().Name() << ".",
     71        if (fNNewMessages != 1)
     72            text << B_TRANSLATE("You have ") << fNNewMessages << B_TRANSLATE(
     73                " new messages") << B_TRANSLATE(" for ")
     74                << fMailProtocol.AccountSettings().Name() << ".";
     75        else
     76            text << B_TRANSLATE("You have ") << fNNewMessages << B_TRANSLATE(
     77                " new message") << B_TRANSLATE(" for ")
     78                << fMailProtocol.AccountSettings().Name() << ".";
    7079
    71         text << fMailProtocol.AccountSettings().Name() << "より\n" << fNNewMessages << " 通のメッセージが届きました");
    72 
    73         BAlert *alert = new BAlert(MDR_DIALECT_CHOICE ("New messages","新着メッセージ"), text.String(), "OK", NULL, NULL, B_WIDTH_AS_USUAL);
     80        BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(),
     81            "OK", NULL, NULL, B_WIDTH_AS_USUAL);
    7482        alert->SetFeel(B_NORMAL_WINDOW_FEEL);
    7583        alert->Go(NULL);
    7684    }
     
    9199
    92100    if (fStrategy & log_window) {
    93101        BString message;
    94         message << fNNewMessages << " new message" << ((fNNewMessages != 1) ? "s" : "");
     102        if (fNNewMessages != 1)
     103            message << fNNewMessages << B_TRANSLATE(" new messages");
     104        else
     105            message << fNNewMessages << B_TRANSLATE(" new message");
    95106        fMailProtocol.ShowMessage(message.String());
    96107    }
    97108
  • src/add-ons/mail_daemon/inbound_filters/notifier/Jamfile

     
    99    filter.cpp
    1010    ConfigView.cpp
    1111    :
    12     be libmail.so $(TARGET_LIBSUPC++)
     12    be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
    1313    ;
     14
     15DoCatalogs NewMailNotification :
     16    x-vnd.Haiku-NewMailNotification
     17    :
     18    ConfigView.cpp
     19    filter.cpp
     20;
  • src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp

     
    44*/
    55
    66
     7#include <stdio.h>
     8
     9#include <Catalog.h>
    710#include <MenuField.h>
    811#include <PopUpMenu.h>
    912#include <Message.h>
     
    1417#include <FileConfigView.h>
    1518#include <MailSettings.h>
    1619
    17 #include <MDRLanguage.h>
    1820
     21#undef B_TRANSLATE_CONTEXT
     22#define B_TRANSLATE_CONTEXT "ConfigView"
     23
     24
    1925const uint32 kMsgActionMoveTo = 'argm';
    2026const uint32 kMsgActionDelete = 'argd';
    2127const uint32 kMsgActionSetTo = 'args';
     
    4046        int32 chain;
    4147};
    4248
    43 #include <stdio.h>
    4449
    4550RuleFilterConfig::RuleFilterConfig(const BMessage *settings)
    4651    :
     
    4853        0), menu(NULL)
    4954{
    5055    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    51     attr = new BTextControl(BRect(5,5,100,20),"attr",MDR_DIALECT_CHOICE ("If","条件:"),MDR_DIALECT_CHOICE ("header (e.g. Subject)","ヘッダ(例えばSubject)"),NULL);
    52     attr->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE ("If ","条件: "))+ 4);
     56    attr = new BTextControl(BRect(5,5,100,20),"attr", B_TRANSLATE("If"),
     57        B_TRANSLATE("header (e.g. Subject)"),NULL);
     58    attr->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("If "))+ 4);
    5359    if (settings->HasString("attribute"))
    5460        attr->SetText(settings->FindString("attribute"));
    5561    AddChild(attr);
    5662
    57     regex = new BTextControl(BRect(104,5,255,20),"attr",MDR_DIALECT_CHOICE (" has "," が "),MDR_DIALECT_CHOICE ("value (use REGEX: in from of regular expressions like *spam*)","値(正規表現対応)"),NULL);
    58     regex->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE (" has "," が ")) + 4);
     63    regex = new BTextControl(BRect(104,5,255,20),"attr", B_TRANSLATE(" has "),
     64        B_TRANSLATE("value (use REGEX: in from of regular expressions like "
     65        "*spam*)"), NULL);
     66    regex->SetDivider(be_plain_font->StringWidth(B_TRANSLATE(" has ")) + 4);
    5967    if (settings->HasString("regex"))
    6068        regex->SetText(settings->FindString("regex"));
    6169    AddChild(regex);
    6270
    63     arg = new BFileControl(BRect(5,55,255,80),"arg",NULL,MDR_DIALECT_CHOICE ("this field is based on the action","ここは動作によって意味が変わります"));
     71    arg = new BFileControl(BRect(5,55,255,80),"arg", NULL,
     72        B_TRANSLATE("this field is based on the action"));
    6473    if (BControl *control = (BControl *)arg->FindView("select_file"))
    6574        control->SetEnabled(false);
    6675    if (settings->HasString("argument"))
    6776        arg->SetText(settings->FindString("argument"));
    6877
    69     outbound = new BPopUpMenu(MDR_DIALECT_CHOICE ("<Choose account>","<アカウントを選択>"));
     78    outbound = new BPopUpMenu(B_TRANSLATE("<Choose account>"));
    7079
    7180    if (settings->HasInt32("do_what"))
    7281        staging = settings->FindInt32("do_what");
     
    96105    if (menu != NULL)
    97106        return; // We switched back from another tab
    98107
    99     menu = new BPopUpMenu(MDR_DIALECT_CHOICE ("<Choose action>","<動作を選択>"));
    100     menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Move to","移動する"), new BMessage(kMsgActionMoveTo)));
    101     menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Set flags to","フラグを指定する"), new BMessage(kMsgActionSetTo)));
    102     menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Delete message","削除する"), new BMessage(kMsgActionDelete)));
    103     menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply with","返事を書く"), new BMessage(kMsgActionReplyWith)));
    104     menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Set as read","既読にする"), new BMessage(kMsgActionSetRead)));
     108    menu = new BPopUpMenu(B_TRANSLATE("<Choose action>"));
     109    menu->AddItem(new BMenuItem(B_TRANSLATE("Move to"),
     110        new BMessage(kMsgActionMoveTo)));
     111    menu->AddItem(new BMenuItem(B_TRANSLATE("Set flags to"),
     112        new BMessage(kMsgActionSetTo)));
     113    menu->AddItem(new BMenuItem(B_TRANSLATE("Delete message"),
     114        new BMessage(kMsgActionDelete)));
     115    menu->AddItem(new BMenuItem(B_TRANSLATE("Reply with"),
     116        new BMessage(kMsgActionReplyWith)));
     117    menu->AddItem(new BMenuItem(B_TRANSLATE("Set as read"),
     118        new BMessage(kMsgActionSetRead)));
    105119    menu->SetTargetForItems(this);
    106120
    107     BMenuField *field = new BMenuField(BRect(5,30,210,50),"do_what",MDR_DIALECT_CHOICE ("Then","ならば"),menu);
     121    BMenuField *field = new BMenuField(BRect(5,30,210,50),"do_what",
     122        B_TRANSLATE("Then"), menu);
    108123    field->ResizeToPreferred();
    109     field->SetDivider(be_plain_font->StringWidth(MDR_DIALECT_CHOICE ("Then","ならば")) + 8);
     124    field->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("Then")) + 8);
    110125    AddChild(field);
    111126
    112127    outbound_field = new BMenuField(BRect(5,55,255,80),"reply","Foo",outbound);
  • src/add-ons/mail_daemon/inbound_filters/match_header/Jamfile

     
    55
    66SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
    77
    8 Addon MatchHeader :
     8Addon MatchHeader :
    99    ConfigView.cpp
    1010    RuleFilter.cpp
    1111    StringMatcher.cpp ;
    1212
    1313LinkAgainst MatchHeader :
    14      be libmail.so $(TARGET_LIBSUPC++) ;
     14     be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++) ;
     15
     16DoCatalogs MatchHeader :
     17    x-vnd.Haiku-MatchHeader
     18    :
     19    ConfigView.cpp
     20;
  • src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.cpp

     
    66
    77#include "ConfigView.h"
    88
     9#include <Catalog.h>
    910#include <TextControl.h>
    1011#include <String.h>
    1112#include <Message.h>
    1213
    1314#include <FileConfigView.h>
    1415
    15 #include <MDRLanguage.h>
    1616
     17#undef B_TRANSLATE_CONTEXT
     18#define B_TRANSLATE_CONTEXT "ConfigView"
    1719
     20
    1821ConfigView::ConfigView()
    19     :   BView(BRect(0,0,20,20),"fortune_filter",B_FOLLOW_LEFT | B_FOLLOW_TOP,0)
     22    :   BView(BRect(0,0,20,20),"fortune_filter", B_FOLLOW_LEFT | B_FOLLOW_TOP
     23        , 0)
    2024{
    2125    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    2226
    2327    // determine font height
    2428    font_height fontHeight;
    2529    GetFontHeight(&fontHeight);
    26     float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent + fontHeight.leading) + 13;
     30    float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent
     31        + fontHeight.leading) + 13;
    2732
    2833    BRect rect(5,4,250,25);
    2934    rect.bottom = rect.top - 2 + itemHeight;
    30     BMailFileConfigView *fview = new BMailFileConfigView(MDR_DIALECT_CHOICE ("Fortune file:","予言ファイル:"),"fortune_file",false,"",B_FILE_NODE);
     35    BMailFileConfigView *fview = new BMailFileConfigView(B_TRANSLATE(
     36        "Fortune file:"), "fortune_file", false, "", B_FILE_NODE);
    3137    AddChild(fview);
    3238
    3339    rect.top = rect.bottom + 8;
    3440    rect.bottom = rect.top - 2 + itemHeight;
    35     BTextControl * control = new BTextControl(rect,"tag_line",MDR_DIALECT_CHOICE ("Tag line:","見出し:"),NULL,NULL);
     41    BTextControl * control = new BTextControl(rect, "tag_line",
     42        B_TRANSLATE("Tag line:"), NULL, NULL);
    3643    control->SetDivider(control->StringWidth(control->Label()) + 6);
    3744    AddChild(control);
    3845
     
    4249
    4350void ConfigView::SetTo(const BMessage *archive)
    4451{
    45     if (BMailFileConfigView *control = (BMailFileConfigView *)FindView("fortune_file"))
    46         control->SetTo(archive,NULL);
     52    if (BMailFileConfigView *control = (BMailFileConfigView
     53        *)FindView("fortune_file"))
     54        control->SetTo(archive, NULL);
    4755
    4856    BString path = archive->FindString("tag_line");
    4957    if (!archive->HasString("tag_line"))
     
    5765
    5866status_t ConfigView::Archive(BMessage *into,bool) const
    5967{
    60     if (BMailFileConfigView *control = (BMailFileConfigView *)FindView("fortune_file"))
     68    if (BMailFileConfigView *control = (BMailFileConfigView
     69        *)FindView("fortune_file"))
    6170    {
    6271        control->Archive(into);
    6372    }
     
    6776        BString line = control->Text();
    6877        if (line != B_EMPTY_STRING)
    6978            line << "\n\n";
    70         if (into->ReplaceString("tag_line",line.String()) != B_OK)
    71             into->AddString("tag_line",line.String());
     79        if (into->ReplaceString("tag_line", line.String()) != B_OK)
     80            into->AddString("tag_line", line.String());
    7281    }
    7382    return B_OK;
    7483}
  • src/add-ons/mail_daemon/outbound_filters/fortune/Jamfile

     
    88
    99Addon Fortune :
    1010    ConfigView.cpp
    11     filter.cpp ;
     11    filter.cpp
     12    :
     13    be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
     14;
    1215
    13 LinkAgainst Fortune :
    14      be libmail.so $(TARGET_LIBSUPC++) ;
     16DoCatalogs Fortune :
     17    x-vnd.Haiku-Fortune
     18    :
     19    ConfigView.cpp
     20;