Ticket #7480: Mail_localization.patch

File Mail_localization.patch, 23.8 KB (added by taos, 13 years ago)

Adds localization for spam filter, removes space characters from translation strings (updated).

  • src/preferences/mail/AutoConfigWindow.cpp

     
    2929
    3030AutoConfigWindow::AutoConfigWindow(BRect rect, ConfigWindow *parent)
    3131    :
    32     BWindow(rect, "Create new account", B_TITLED_WINDOW_LOOK,
     32    BWindow(rect, B_TRANSLATE("Create new account"), B_TITLED_WINDOW_LOOK,
    3333        B_MODAL_APP_WINDOW_FEEL,
    3434        B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AVOID_FRONT, B_ALL_WORKSPACES),
    3535    fParentWindow(parent),
     
    9393                fMainView->GetBasicAccountInfo(fAccountInfo);
    9494                if (!fMainView->IsValidMailAddress(fAccountInfo.email)) {
    9595                    invalidMailAlert = new BAlert("invalidMailAlert",
    96                         "Enter a valid e-mail address.", "OK");
     96                        B_TRANSLATE("Enter a valid e-mail address."),
     97                        B_TRANSLATE("OK"));
    9798                    invalidMailAlert->Go();
    9899                    return;
    99100                }
  • src/preferences/mail/Jamfile

     
    2323    main.cpp
    2424;
    2525
     26AddResources E-mail : e-mail.rdef ;
    2627
    2728Preference E-mail
    2829    :
     
    3031    :
    3132    be libmail.so $(HAIKU_NETWORK_LIBS) $(TARGET_NETAPI_LIB) $(TARGET_LIBSTDC++)
    3233    $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
    33     : e-mail.rdef
    3434;
    3535
    3636DoCatalogs E-mail
    37     : x-vnd.Haiku-Mail
    38     : ConfigViews.cpp
    39       ConfigWindow.cpp
     37    :
     38    x-vnd.Haiku-Mail
     39    :
     40    AutoConfigView.cpp
     41    AutoConfigWindow.cpp
     42    ConfigViews.cpp
     43    ConfigWindow.cpp
     44    FilterConfigView.cpp
    4045;
    4146
    4247
  • src/preferences/mail/AutoConfigView.cpp

     
    4949    topLeft.y += stepSize;
    5050    rightDown.y += stepSize;
    5151    fEmailView = new BTextControl(BRect(topLeft, rightDown), "email",
    52         "E-mail address:", "", new BMessage(kEMailChangedMsg));
     52        B_TRANSLATE("E-mail address:"), "", new BMessage(kEMailChangedMsg));
    5353    fEmailView->SetDivider(divider);
    5454    AddChild(fEmailView);
    5555
     
    5757    topLeft.y += stepSize;
    5858    rightDown.y += stepSize;
    5959    fLoginNameView = new BTextControl(BRect(topLeft, rightDown),
    60         "login", "Login name:", "", NULL);
     60        "login", B_TRANSLATE("Login name:"), "", NULL);
    6161    fLoginNameView->SetDivider(divider);
    6262    AddChild(fLoginNameView);
    6363
     
    6565    topLeft.y += stepSize;
    6666    rightDown.y += stepSize;
    6767    fPasswordView = new BTextControl(BRect(topLeft, rightDown), "password",
    68         "Password:", "", NULL);
     68        B_TRANSLATE("Password:"), "", NULL);
    6969    fPasswordView->SetDivider(divider);
    7070    fPasswordView->TextView()->HideTyping(true);
    7171    AddChild(fPasswordView);
     
    7474    topLeft.y += stepSize;
    7575    rightDown.y += stepSize;
    7676    fAccountNameView = new BTextControl(BRect(topLeft, rightDown), "account",
    77         "Account name:", "", NULL);
     77        B_TRANSLATE("Account name:"), "", NULL);
    7878    fAccountNameView->SetDivider(divider);
    7979    AddChild(fAccountNameView);
    8080
     
    8282    topLeft.y += stepSize;
    8383    rightDown.y += stepSize;
    8484    fNameView = new BTextControl(BRect(topLeft, rightDown), "name",
    85         "Real name:", "", NULL);
     85        B_TRANSLATE("Real name:"), "", NULL);
    8686    AddChild(fNameView);
    8787    fNameView->SetDivider(divider);
    8888}
     
    312312        serverName = info.providerInfo.pop_server;
    313313
    314314    fInboundNameView = new BTextControl(BRect(10, 20, rect.Width() - 20, 35),
    315         "inbound", "Server Name:", serverName.String(),
     315        "inbound", B_TRANSLATE("Server Name:"), serverName.String(),
    316316        new BMessage(kServerChangedMsg));
    317317    fInboundNameView->SetDivider(divider);
    318318
  • src/preferences/mail/ConfigWindow.cpp

     
    648648
    649649            BPopUpMenu rightClickMenu("accounts", false, false);
    650650
    651             BMenuItem* inMenuItem = new BMenuItem("Incoming", NULL);
    652             BMenuItem* outMenuItem = new BMenuItem("Outgoing", NULL);
     651            BMenuItem* inMenuItem = new BMenuItem(B_TRANSLATE("Incoming"),
     652                NULL);
     653            BMenuItem* outMenuItem = new BMenuItem(B_TRANSLATE("Outgoing"),
     654                NULL);
    653655            rightClickMenu.AddItem(inMenuItem);
    654656            rightClickMenu.AddItem(outMenuItem);
    655657
     
    896898    item = new AccountItem(label, account, ACCOUNT_ITEM);
    897899    fAccountsListView->AddItem(item);
    898900
    899     item = new AccountItem(B_TRANSLATE("   · Incoming"), account, INBOUND_ITEM);
     901    item = new AccountItem(B_TRANSLATE("· Incoming"), account, INBOUND_ITEM);
    900902    fAccountsListView->AddItem(item);
    901903    if (!account->IsInboundEnabled())
    902904        item->SetEnabled(false);
    903905
    904     item = new AccountItem(B_TRANSLATE("   · Outgoing"), account,
     906    item = new AccountItem(B_TRANSLATE("· Outgoing"), account,
    905907        OUTBOUND_ITEM);
    906908    fAccountsListView->AddItem(item);
    907909    if (!account->IsOutboundEnabled())
    908910        item->SetEnabled(false);
    909911
    910     item = new AccountItem(B_TRANSLATE("   · E-mail filters"), account,
     912    item = new AccountItem(B_TRANSLATE("· E-mail filters"), account,
    911913        FILTER_ITEM);
    912914    fAccountsListView->AddItem(item);
    913915}
  • src/add-ons/mail_daemon/inbound_protocols/pop3/ConfigView.cpp

     
    4242#endif
    4343        )
    4444{
    45     AddAuthMethod("Plain text");
    46     AddAuthMethod("APOP");
     45    AddAuthMethod(B_TRANSLATE("Plain text"));
     46    AddAuthMethod(B_TRANSLATE("APOP"));
    4747
    4848#if USE_SSL
    49     AddFlavor("No encryption");
    50     AddFlavor("SSL");
     49    AddFlavor(B_TRANSLATE("No encryption"));
     50    AddFlavor(B_TRANSLATE("SSL"));
    5151#endif
    5252
    5353    SetTo(settings);
  • src/add-ons/mail_daemon/inbound_protocols/pop3/pop3.cpp

     
    343343    fLog = "";
    344344
    345345    // Prime the error message
    346     BString error_msg;
    347     error_msg << B_TRANSLATE("Error while connecting to server ") << server;
     346    BString error_msg, servString;
     347    error_msg << B_TRANSLATE("Error while connecting to server %serv");
     348
     349    servString << server;
     350    error_msg.ReplaceFirst("%serv", servString);
     351
    348352    if (port != 110)
    349353        error_msg << ":" << port;
    350354
     
    445449{
    446450    status_t err;
    447451
    448     BString error_msg;
    449     error_msg << B_TRANSLATE("Error while authenticating user ") << uid;
     452    BString error_msg, userString;
     453    error_msg << B_TRANSLATE("Error while authenticating user %user");
    450454
     455    userString << uid;
     456    error_msg.ReplaceFirst("%user", userString);
     457
    451458    if (method == 1) {  //APOP
    452459        int32 index = fLog.FindFirst("<");
    453460        if(index != B_ERROR) {
  • src/add-ons/mail_daemon/inbound_protocols/imap/imap_config.cpp

     
    6060     fAddonSettings(settings)
    6161{
    6262#ifdef USE_SSL
    63     AddFlavor("No encryption");
    64     AddFlavor("SSL");
     63    AddFlavor(B_TRANSLATE("No encryption"));
     64    AddFlavor(B_TRANSLATE("SSL"));
    6565#endif
    6666
    6767    SetTo(settings);
  • src/add-ons/mail_daemon/outbound_protocols/smtp/ConfigView.cpp

     
    4444        )
    4545{
    4646#ifdef USE_SSL
    47     AddFlavor("Unencrypted");
    48     AddFlavor("SSL");
    49     AddFlavor("STARTTLS");
     47    AddFlavor(B_TRANSLATE("Unencrypted"));
     48    AddFlavor(B_TRANSLATE("SSL"));
     49    AddFlavor(B_TRANSLATE("STARTTLS"));
    5050#endif
    5151
    5252    AddAuthMethod(B_TRANSLATE("None"), false);
     
    5454    AddAuthMethod(B_TRANSLATE("POP3 before SMTP"), false);
    5555
    5656    BTextControl *control = (BTextControl *)(FindView("host"));
    57     control->SetLabel(B_TRANSLATE("SMTP server: "));
     57    control->SetLabel(B_TRANSLATE("SMTP server:"));
    5858
    5959    // Reset the dividers after changing one
    6060    float widestLabel = 0;
  • src/add-ons/mail_daemon/outbound_protocols/smtp/smtp.cpp

     
    281281    status = Open(fSettingsMessage.FindString("server"),
    282282        fSettingsMessage.FindInt32("port"), authMethod == 1);
    283283    if (status < B_OK) {
    284         error_msg << B_TRANSLATE("Error while opening connection to ")
    285             << fSettingsMessage.FindString("server");
     284        error_msg << B_TRANSLATE("Error while opening connection to %serv");
     285        error_msg.ReplaceFirst("%serv", fSettingsMessage.FindString("server"));
    286286
    287287        if (fSettingsMessage.FindInt32("port") > 0)
    288288            error_msg << ":" << fSettingsMessage.FindInt32("port");
     
    304304
    305305    if (status != B_OK) {
    306306        //-----This is a really cool kind of error message. How can we make it work for POP3?
    307         error_msg << B_TRANSLATE("Error while logging in to ")
    308             << fSettingsMessage.FindString("server")
     307        error_msg << B_TRANSLATE("Error while logging in to %serv")
    309308            << B_TRANSLATE(". The server said:\n") << fLog;
     309
     310        error_msg.ReplaceFirst("%serv", fSettingsMessage.FindString("server"));
     311
    310312        ShowError(error_msg.String());
    311313    }
    312314    return B_OK;
  • src/add-ons/mail_daemon/inbound_filters/notifier/ConfigView.cpp

     
    3333    // determine font height
    3434    font_height fontHeight;
    3535    GetFontHeight(&fontHeight);
    36     float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent + fontHeight.leading) + 6;
    37 
     36    float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent
     37        + fontHeight.leading) + 6;
     38
    3839    BRect frame(5,2,250,itemHeight + 2);
    3940    BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING,false,false);
    4041
     
    5859    AddChild(field);
    5960
    6061    ResizeToPreferred();
    61 }
     62}
    6263
    6364
    6465void ConfigView::AttachedToWindow()
     
    105106        label.Prepend(item->Label());
    106107    }
    107108    if (label == "")
    108         label = "none";
     109        label = B_TRANSLATE("none");
    109110    field->MenuItem()->SetLabel(label.String());
    110111}
    111112
     
    119120            BMenuItem *item;
    120121            if (msg->FindPointer("source",(void **)&item) < B_OK)
    121122                break;
    122 
     123
    123124            item->SetMarked(!item->IsMarked());
    124125            UpdateNotifyText();
    125126            break;
     
    151152    return B_OK;
    152153}
    153154
    154 
     155
    155156void ConfigView::GetPreferredSize(float *width, float *height)
    156157{
    157158    *width = 258;
     
    171172BString
    172173descriptive_name()
    173174{
    174     return "New mails notification";
     175    return B_TRANSLATE("New mails notification");
    175176}
  • src/add-ons/mail_daemon/inbound_filters/notifier/filter.cpp

     
    7878        text.ReplaceFirst("%name", fMailProtocol.AccountSettings().Name());
    7979
    8080        BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(),
    81             "OK", NULL, NULL, B_WIDTH_AS_USUAL);
     81            B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL);
    8282        alert->SetFeel(B_NORMAL_WINDOW_FEEL);
    8383        alert->Go(NULL);
    8484    }
     
    9898    }
    9999
    100100    if (fStrategy & log_window) {
    101         BString message;
     101        BString message, numString;
    102102        if (fNNewMessages != 1)
    103             message << fNNewMessages << B_TRANSLATE(" new messages");
     103            message << B_TRANSLATE("%num new messages");
    104104        else
    105             message << fNNewMessages << B_TRANSLATE(" new message");
     105            message << B_TRANSLATE("%num new message");
     106
     107        numString << fNNewMessages;
     108        message.ReplaceFirst("%num", numString);
     109
    106110        fMailProtocol.ShowMessage(message.String());
    107111    }
    108112
  • src/add-ons/mail_daemon/inbound_filters/match_header/ConfigView.cpp

     
    5555    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    5656    attr = new BTextControl(BRect(5,5,100,20),"attr", B_TRANSLATE("If"),
    5757        B_TRANSLATE("header (e.g. Subject)"),NULL);
    58     attr->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("If "))+ 4);
     58    attr->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("If"))+ 4);
    5959    if (settings->HasString("attribute"))
    6060        attr->SetText(settings->FindString("attribute"));
    6161    AddChild(attr);
    6262
    63     regex = new BTextControl(BRect(104,5,255,20),"attr", B_TRANSLATE(" has "),
     63    regex = new BTextControl(BRect(104,5,255,20),"attr", B_TRANSLATE("has"),
    6464        B_TRANSLATE("value (use REGEX: in from of regular expressions like "
    6565        "*spam*)"), NULL);
    66     regex->SetDivider(be_plain_font->StringWidth(B_TRANSLATE(" has ")) + 4);
     66    regex->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("has")) + 4);
    6767    if (settings->HasString("regex"))
    6868        regex->SetText(settings->FindString("regex"));
    6969    AddChild(regex);
  • src/add-ons/mail_daemon/inbound_filters/match_header/Jamfile

     
    2121    x-vnd.Haiku-MatchHeader
    2222    :
    2323    ConfigView.cpp
     24    RuleFilter.cpp
    2425;
  • src/add-ons/mail_daemon/inbound_filters/match_header/RuleFilter.cpp

     
    99#include <stdlib.h>
    1010#include <stdio.h>
    1111
     12#include <Catalog.h>
    1213#include <Directory.h>
    1314#include <fs_attr.h>
    1415#include <Node.h>
     
    1718#include <MailProtocol.h>
    1819
    1920
     21#undef B_TRANSLATE_CONTEXT
     22#define B_TRANSLATE_CONTEXT "RuleFilter"
     23
     24
    2025RuleFilter::RuleFilter(MailProtocol& protocol, AddonSettings* addonSettings)
    2126    :
    2227    MailFilter(protocol, addonSettings)
     
    2833
    2934    BString regex;
    3035    settings->FindString("regex", &regex);
    31 
     36
    3237    int32 index = regex.FindFirst("REGEX:");
    3338    if (index == B_ERROR || index > 0)
    3439        EscapeRegexTokens(regex);
    3540    else
    3641        regex.RemoveFirst("REGEX:");
    37 
     42
    3843    fMatcher.SetPattern(regex, false);
    39 
     44
    4045    settings->FindString("argument",&fArg);
    4146    settings->FindInt32("do_what",(long *)&fDoWhat);
    4247    if (fDoWhat == Z_SET_REPLY)
     
    6570
    6671    if (!fMatcher.Match(data))
    6772        return; //-----There wasn't an error. We're just not supposed to do anything
    68 
     73
    6974    switch (fDoWhat) {
    7075        case Z_MOVE_TO:
    7176        {
     
    95100        default:
    96101            fprintf(stderr,"Unknown do_what: 0x%04x!\n", fDoWhat);
    97102    }
    98 
     103
    99104    return;
    100105}
    101106
     
    123128    sprintf(buffer + strlen(buffer), " against \"%s\"", reg);
    124129
    125130    return B_OK;*/
    126     return "Rule filter";
     131    return B_TRANSLATE("Rule filter");
    127132}
    128133
    129134
  • src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.rdef

     
     1/*
     2 * SpamFilter.rdef
     3 */
     4
     5resource app_signature "application/x-vnd.Haiku-SpamFilter";
     6
     7resource app_version {
     8    major  = 1,
     9    middle = 0,
     10    minor  = 0,
     11    variety = 0,
     12    internal = 0,
     13    short_info = "1.0.0",
     14    long_info = "Haiku SpamFilter mail_daemon add-on."
     15};
  • src/add-ons/mail_daemon/inbound_filters/spam_filter/Jamfile

     
    66
    77SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
    88
     9AddResources SpamFilter : SpamFilter.rdef ;
     10
    911Addon SpamFilter :
    1012    SpamFilterConfig.cpp
    1113    SpamFilter.cpp
    1214    :
    13     be libmail.so $(TARGET_LIBSUPC++)
     15    be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
    1416    ;
     17
     18DoCatalogs SpamFilter
     19    :
     20    x-vnd.Haiku-SpamFilter
     21    :
     22    SpamFilter.cpp
     23    SpamFilterConfig.cpp
     24    ;
  • src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilter.cpp

     
    113113 */
    114114
    115115#include <Beep.h>
     116#include <Catalog.h>
    116117#include <fs_attr.h>
    117118#include <Messenger.h>
    118119#include <Node.h>
     
    127128
    128129#include "SpamFilter.h"
    129130
     131
     132#undef B_TRANSLATE_CONTEXT
     133#define B_TRANSLATE_CONTEXT "SpamFilter"
     134
     135
    130136// The names match the ones set up by spamdbm for sound effects.
    131137static const char *kAGMSBayesBeepGenuineName = "SpamFilter-Genuine";
    132138static const char *kAGMSBayesBeepSpamName = "SpamFilter-Spam";
     
    225231    float spamRatio;
    226232    if (_GetSpamRatio(stringBuffer, dataSize, spamRatio) != B_OK)
    227233        return B_ERROR;
    228 
     234
    229235    // If we are auto-training, feed back the message to the server as a
    230236    // training example (don't train if it is uncertain).
    231237    if (fAutoTraining && (spamRatio >= fSpamCutoffRatio
     
    406412        delete[] buffer;
    407413        return B_ERROR;
    408414    }
    409 
     415
    410416    BString newSubjectString;
    411417    newSubjectString.SetTo("[Spam ");
    412418    char percentageString[30];
     
    426432BString
    427433descriptive_name()
    428434{
    429     return "Spam Filter (AGMS Bayesian)";
     435    return B_TRANSLATE("Spam Filter (AGMS Bayesian)");
    430436}
    431437
    432438
  • src/add-ons/mail_daemon/inbound_filters/spam_filter/SpamFilterConfig.cpp

     
    8080
    8181#include <Alert.h>
    8282#include <Button.h>
     83#include <Catalog.h>
    8384#include <CheckBox.h>
    8485#include <Message.h>
    8586#include <Messenger.h>
     
    9394#include <MailAddon.h>
    9495#include <FileConfigView.h>
    9596
     97
     98#undef B_TRANSLATE_CONTEXT
     99#define B_TRANSLATE_CONTEXT "SpamFilterConfig"
     100
     101
    96102static const char *kServerSignature = "application/x-vnd.agmsmith.spamdbm";
    97103
    98104class AGMSBayesianSpamFilterConfig : public BView {
     
    179185    fAddSpamToSubjectCheckBoxPntr = new BCheckBox (
    180186        tempRect,
    181187        "AddToSubject",
    182         "Add spam rating to start of subject",
     188        B_TRANSLATE("Add spam rating to start of subject"),
    183189        new BMessage (kAddSpamToSubjectPressed));
    184190    AddChild (fAddSpamToSubjectCheckBoxPntr);
    185191    fAddSpamToSubjectCheckBoxPntr->ResizeToPreferred ();
     
    195201    fNoWordsMeansSpamCheckBoxPntr = new BCheckBox (
    196202        tempRect,
    197203        "NoWordsMeansSpam",
    198         "or empty e-mail",
     204        B_TRANSLATE("or empty e-mail"),
    199205        new BMessage (kNoWordsMeansSpam));
    200206    AddChild (fNoWordsMeansSpamCheckBoxPntr);
    201207    fNoWordsMeansSpamCheckBoxPntr->ResizeToPreferred ();
     
    210216
    211217    tempRect.right = fNoWordsMeansSpamCheckBoxPntr->Frame().left -
    212218        be_plain_font->StringWidth ("a");
    213     tempStringPntr = "Spam above:";
     219    tempStringPntr = B_TRANSLATE("Spam above:");
    214220    sprintf (numberString, "%06.4f", (double) fSpamCutoffRatio);
    215221    fSpamCutoffRatioTextBoxPntr = new BTextControl (
    216222        tempRect,
     
    229235
    230236    // Add the box displaying the genuine cutoff ratio, on a line by itself.
    231237
    232     tempStringPntr = "Genuine below and uncertain above:";
     238    tempStringPntr = B_TRANSLATE("Genuine below and uncertain above:");
    233239    sprintf (numberString, "%08.6f", (double) fGenuineCutoffRatio);
    234240    fGenuineCutoffRatioTextBoxPntr = new BTextControl (
    235241        tempRect,
     
    251257    fAutoTrainingCheckBoxPntr = new BCheckBox (
    252258        tempRect,
    253259        "autoTraining",
    254         "Learn from all incoming e-mail",
     260        B_TRANSLATE("Learn from all incoming e-mail"),
    255261        new BMessage (kAutoTrainingPressed));
    256262    AddChild (fAutoTrainingCheckBoxPntr);
    257263    fAutoTrainingCheckBoxPntr->ResizeToPreferred ();
     
    394400                    goto ErrorExit;
    395401            }
    396402        }
    397 
     403
    398404    // Set up the messenger to the database server.
    399405    messengerToServer =
    400406        BMessenger (kServerSignature);
     
    415421    return; // Successful.
    416422
    417423ErrorExit:
    418     (new BAlert ("SpamFilterConfig Error", "Sorry, unable to launch the "
    419         "spamdbm program to let you edit the server settings.",
    420         "Close"))->Go ();
     424    (new BAlert ("SpamFilterConfig Error", B_TRANSLATE("Sorry, unable to "
     425        "launch the spamdbm program to let you edit the server settings."),
     426        B_TRANSLATE("Close")))->Go ();
    421427    return;
    422428}
    423429
  • src/add-ons/mail_daemon/outbound_filters/fortune/ConfigView.cpp

     
    5757
    5858    BString path = archive->FindString("tag_line");
    5959    if (!archive->HasString("tag_line"))
    60         path = "Fortune cookie says:\n\n";
     60        path = B_TRANSLATE("Fortune cookie says:\n\n");
    6161
    6262    path.Truncate(path.Length() - 2);
    6363    if (BTextControl *control = (BTextControl *)FindView("tag_line"))
  • src/servers/mail/DeskbarView.cpp

     
    541541    // The New E-mail query
    542542
    543543    if (fNewMessages > 0) {
    544         BString string;
     544        BString string, numString;
    545545        if (fNewMessages != 1)
    546             string << fNewMessages << B_TRANSLATE(" new messages");
     546            string << B_TRANSLATE("%num new messages");
    547547        else
    548             string << fNewMessages << B_TRANSLATE(" new message");
     548            string << B_TRANSLATE("%num new message");
    549549
     550        numString << fNewMessages;
     551        string.ReplaceFirst("%num", numString);
     552
    550553        _GetNewQueryRef(ref);
    551554
    552555        item = new BMenuItem(navMenu = new BNavMenu(string.String(),
  • src/servers/mail/MailDaemon.cpp

     
    9696    fAutoCheckRunner(NULL)
    9797{
    9898    fErrorLogWindow = new ErrorLogWindow(BRect(200, 200, 500, 250),
    99         "Mail daemon status log", B_TITLED_WINDOW);
     99        B_TRANSLATE("Mail daemon status log"), B_TITLED_WINDOW);
    100100    fMailStatusWindow = new MailStatusWindow(BRect(40, 400, 360, 400),
    101         "Mail Status", fSettingsFile.ShowStatusWindow());
     101        B_TRANSLATE("Mail Status"), fSettingsFile.ShowStatusWindow());
    102102    // install MimeTypes, attributes, indices, and the
    103103    // system beep add startup
    104104    MakeMimeTypes();
     
    162162        fQueries.AddItem(query);
    163163    }
    164164
    165     BString string;
     165    BString string, numString;
    166166    if (fNewMessages > 0) {
    167167        if (fNewMessages != 1)
    168             string << fNewMessages << B_TRANSLATE(" new messages.");
     168            string << B_TRANSLATE("%num new messages.");
    169169        else
    170             string << fNewMessages << B_TRANSLATE(" new message.");
     170            string << B_TRANSLATE("%num new message.");
     171
     172        numString << fNewMessages;
     173        string.ReplaceFirst("%num", numString);
    171174    }
    172175    else
    173176        string = B_TRANSLATE("No new messages");
     
    518521        {
    519522            int32 numMessages = msg->FindInt32("num_messages");
    520523            BString numString;
    521 
     524
    522525            if (numMessages > 1)
    523526                fAlertString << B_TRANSLATE("%num new messages for %name\n");
    524527            else
     
    543546                    break;
    544547            }
    545548
    546             BString string;
     549            BString string, numString;
    547550
    548551            if (fNewMessages > 0) {
    549552                if (fNewMessages != 1)
    550                     string << fNewMessages << B_TRANSLATE(" new messages.");
     553                    string << B_TRANSLATE("%num new messages.");
    551554                else
    552                     string << fNewMessages << B_TRANSLATE(" new message.");
     555                    string << B_TRANSLATE("%num new message.");
     556
     557            numString << fNewMessages;
     558            string.ReplaceFirst("%num", numString);
    553559            }
    554560            else
    555561                string << B_TRANSLATE("No new messages.");