More localization support by taos, thanks!
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42344 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -55,15 +55,15 @@ RuleFilterConfig::RuleFilterConfig(const BMessage *settings)
|
|||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
attr = new BTextControl(BRect(5,5,100,20),"attr", B_TRANSLATE("If"),
|
attr = new BTextControl(BRect(5,5,100,20),"attr", B_TRANSLATE("If"),
|
||||||
B_TRANSLATE("header (e.g. Subject)"),NULL);
|
B_TRANSLATE("header (e.g. Subject)"),NULL);
|
||||||
attr->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("If "))+ 4);
|
attr->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("If"))+ 4);
|
||||||
if (settings->HasString("attribute"))
|
if (settings->HasString("attribute"))
|
||||||
attr->SetText(settings->FindString("attribute"));
|
attr->SetText(settings->FindString("attribute"));
|
||||||
AddChild(attr);
|
AddChild(attr);
|
||||||
|
|
||||||
regex = new BTextControl(BRect(104,5,255,20),"attr", B_TRANSLATE(" has "),
|
regex = new BTextControl(BRect(104,5,255,20),"attr", B_TRANSLATE("has"),
|
||||||
B_TRANSLATE("value (use REGEX: in from of regular expressions like "
|
B_TRANSLATE("value (use REGEX: in from of regular expressions like "
|
||||||
"*spam*)"), NULL);
|
"*spam*)"), NULL);
|
||||||
regex->SetDivider(be_plain_font->StringWidth(B_TRANSLATE(" has ")) + 4);
|
regex->SetDivider(be_plain_font->StringWidth(B_TRANSLATE("has")) + 4);
|
||||||
if (settings->HasString("regex"))
|
if (settings->HasString("regex"))
|
||||||
regex->SetText(settings->FindString("regex"));
|
regex->SetText(settings->FindString("regex"));
|
||||||
AddChild(regex);
|
AddChild(regex);
|
||||||
|
|||||||
@@ -21,4 +21,5 @@ DoCatalogs MatchHeader
|
|||||||
x-vnd.Haiku-MatchHeader
|
x-vnd.Haiku-MatchHeader
|
||||||
:
|
:
|
||||||
ConfigView.cpp
|
ConfigView.cpp
|
||||||
|
RuleFilter.cpp
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <Directory.h>
|
#include <Directory.h>
|
||||||
#include <fs_attr.h>
|
#include <fs_attr.h>
|
||||||
#include <Node.h>
|
#include <Node.h>
|
||||||
@@ -17,6 +18,10 @@
|
|||||||
#include <MailProtocol.h>
|
#include <MailProtocol.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "RuleFilter"
|
||||||
|
|
||||||
|
|
||||||
RuleFilter::RuleFilter(MailProtocol& protocol, AddonSettings* addonSettings)
|
RuleFilter::RuleFilter(MailProtocol& protocol, AddonSettings* addonSettings)
|
||||||
:
|
:
|
||||||
MailFilter(protocol, addonSettings)
|
MailFilter(protocol, addonSettings)
|
||||||
@@ -123,7 +128,7 @@ descriptive_name()
|
|||||||
sprintf(buffer + strlen(buffer), " against \"%s\"", reg);
|
sprintf(buffer + strlen(buffer), " against \"%s\"", reg);
|
||||||
|
|
||||||
return B_OK;*/
|
return B_OK;*/
|
||||||
return "Rule filter";
|
return B_TRANSLATE("Rule filter");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,8 @@ ConfigView::ConfigView()
|
|||||||
// determine font height
|
// determine font height
|
||||||
font_height fontHeight;
|
font_height fontHeight;
|
||||||
GetFontHeight(&fontHeight);
|
GetFontHeight(&fontHeight);
|
||||||
float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent + fontHeight.leading) + 6;
|
float itemHeight = (int32)(fontHeight.ascent + fontHeight.descent
|
||||||
|
+ fontHeight.leading) + 6;
|
||||||
|
|
||||||
BRect frame(5,2,250,itemHeight + 2);
|
BRect frame(5,2,250,itemHeight + 2);
|
||||||
BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING,false,false);
|
BPopUpMenu *menu = new BPopUpMenu(B_EMPTY_STRING,false,false);
|
||||||
@@ -105,7 +106,7 @@ void ConfigView::UpdateNotifyText()
|
|||||||
label.Prepend(item->Label());
|
label.Prepend(item->Label());
|
||||||
}
|
}
|
||||||
if (label == "")
|
if (label == "")
|
||||||
label = "none";
|
label = B_TRANSLATE("none");
|
||||||
field->MenuItem()->SetLabel(label.String());
|
field->MenuItem()->SetLabel(label.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -171,5 +172,5 @@ instantiate_filter_config_panel(AddonSettings& settings)
|
|||||||
BString
|
BString
|
||||||
descriptive_name()
|
descriptive_name()
|
||||||
{
|
{
|
||||||
return "New mails notification";
|
return B_TRANSLATE("New mails notification");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ NotifyFilter::MailboxSynced(status_t status)
|
|||||||
text.ReplaceFirst("%name", fMailProtocol.AccountSettings().Name());
|
text.ReplaceFirst("%name", fMailProtocol.AccountSettings().Name());
|
||||||
|
|
||||||
BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(),
|
BAlert *alert = new BAlert(B_TRANSLATE("New messages"), text.String(),
|
||||||
"OK", NULL, NULL, B_WIDTH_AS_USUAL);
|
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_AS_USUAL);
|
||||||
alert->SetFeel(B_NORMAL_WINDOW_FEEL);
|
alert->SetFeel(B_NORMAL_WINDOW_FEEL);
|
||||||
alert->Go(NULL);
|
alert->Go(NULL);
|
||||||
}
|
}
|
||||||
@@ -98,11 +98,15 @@ NotifyFilter::MailboxSynced(status_t status)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fStrategy & log_window) {
|
if (fStrategy & log_window) {
|
||||||
BString message;
|
BString message, numString;
|
||||||
if (fNNewMessages != 1)
|
if (fNNewMessages != 1)
|
||||||
message << fNNewMessages << B_TRANSLATE(" new messages");
|
message << B_TRANSLATE("%num new messages");
|
||||||
else
|
else
|
||||||
message << fNNewMessages << B_TRANSLATE(" new message");
|
message << B_TRANSLATE("%num new message");
|
||||||
|
|
||||||
|
numString << fNNewMessages;
|
||||||
|
message.ReplaceFirst("%num", numString);
|
||||||
|
|
||||||
fMailProtocol.ShowMessage(message.String());
|
fMailProtocol.ShowMessage(message.String());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,19 @@ UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
|
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
|
||||||
|
|
||||||
|
AddResources SpamFilter : SpamFilter.rdef ;
|
||||||
|
|
||||||
Addon SpamFilter :
|
Addon SpamFilter :
|
||||||
SpamFilterConfig.cpp
|
SpamFilterConfig.cpp
|
||||||
SpamFilter.cpp
|
SpamFilter.cpp
|
||||||
:
|
:
|
||||||
be libmail.so $(TARGET_LIBSUPC++)
|
be libmail.so $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSUPC++)
|
||||||
|
;
|
||||||
|
|
||||||
|
DoCatalogs SpamFilter
|
||||||
|
:
|
||||||
|
x-vnd.Haiku-SpamFilter
|
||||||
|
:
|
||||||
|
SpamFilter.cpp
|
||||||
|
SpamFilterConfig.cpp
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -113,6 +113,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include <Beep.h>
|
#include <Beep.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <fs_attr.h>
|
#include <fs_attr.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <Node.h>
|
#include <Node.h>
|
||||||
@@ -127,6 +128,11 @@
|
|||||||
|
|
||||||
#include "SpamFilter.h"
|
#include "SpamFilter.h"
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "SpamFilter"
|
||||||
|
|
||||||
|
|
||||||
// The names match the ones set up by spamdbm for sound effects.
|
// The names match the ones set up by spamdbm for sound effects.
|
||||||
static const char *kAGMSBayesBeepGenuineName = "SpamFilter-Genuine";
|
static const char *kAGMSBayesBeepGenuineName = "SpamFilter-Genuine";
|
||||||
static const char *kAGMSBayesBeepSpamName = "SpamFilter-Spam";
|
static const char *kAGMSBayesBeepSpamName = "SpamFilter-Spam";
|
||||||
@@ -426,7 +432,7 @@ AGMSBayesianSpamFilter::_AddSpamToSubject(BNode* file, float spamRatio)
|
|||||||
BString
|
BString
|
||||||
descriptive_name()
|
descriptive_name()
|
||||||
{
|
{
|
||||||
return "Spam Filter (AGMS Bayesian)";
|
return B_TRANSLATE("Spam Filter (AGMS Bayesian)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -80,6 +80,7 @@
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Button.h>
|
#include <Button.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <Message.h>
|
#include <Message.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
@@ -93,6 +94,11 @@
|
|||||||
#include <MailAddon.h>
|
#include <MailAddon.h>
|
||||||
#include <FileConfigView.h>
|
#include <FileConfigView.h>
|
||||||
|
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "SpamFilterConfig"
|
||||||
|
|
||||||
|
|
||||||
static const char *kServerSignature = "application/x-vnd.agmsmith.spamdbm";
|
static const char *kServerSignature = "application/x-vnd.agmsmith.spamdbm";
|
||||||
|
|
||||||
class AGMSBayesianSpamFilterConfig : public BView {
|
class AGMSBayesianSpamFilterConfig : public BView {
|
||||||
@@ -179,7 +185,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow ()
|
|||||||
fAddSpamToSubjectCheckBoxPntr = new BCheckBox (
|
fAddSpamToSubjectCheckBoxPntr = new BCheckBox (
|
||||||
tempRect,
|
tempRect,
|
||||||
"AddToSubject",
|
"AddToSubject",
|
||||||
"Add spam rating to start of subject",
|
B_TRANSLATE("Add spam rating to start of subject"),
|
||||||
new BMessage (kAddSpamToSubjectPressed));
|
new BMessage (kAddSpamToSubjectPressed));
|
||||||
AddChild (fAddSpamToSubjectCheckBoxPntr);
|
AddChild (fAddSpamToSubjectCheckBoxPntr);
|
||||||
fAddSpamToSubjectCheckBoxPntr->ResizeToPreferred ();
|
fAddSpamToSubjectCheckBoxPntr->ResizeToPreferred ();
|
||||||
@@ -195,7 +201,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow ()
|
|||||||
fNoWordsMeansSpamCheckBoxPntr = new BCheckBox (
|
fNoWordsMeansSpamCheckBoxPntr = new BCheckBox (
|
||||||
tempRect,
|
tempRect,
|
||||||
"NoWordsMeansSpam",
|
"NoWordsMeansSpam",
|
||||||
"or empty e-mail",
|
B_TRANSLATE("or empty e-mail"),
|
||||||
new BMessage (kNoWordsMeansSpam));
|
new BMessage (kNoWordsMeansSpam));
|
||||||
AddChild (fNoWordsMeansSpamCheckBoxPntr);
|
AddChild (fNoWordsMeansSpamCheckBoxPntr);
|
||||||
fNoWordsMeansSpamCheckBoxPntr->ResizeToPreferred ();
|
fNoWordsMeansSpamCheckBoxPntr->ResizeToPreferred ();
|
||||||
@@ -210,7 +216,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow ()
|
|||||||
|
|
||||||
tempRect.right = fNoWordsMeansSpamCheckBoxPntr->Frame().left -
|
tempRect.right = fNoWordsMeansSpamCheckBoxPntr->Frame().left -
|
||||||
be_plain_font->StringWidth ("a");
|
be_plain_font->StringWidth ("a");
|
||||||
tempStringPntr = "Spam above:";
|
tempStringPntr = B_TRANSLATE("Spam above:");
|
||||||
sprintf (numberString, "%06.4f", (double) fSpamCutoffRatio);
|
sprintf (numberString, "%06.4f", (double) fSpamCutoffRatio);
|
||||||
fSpamCutoffRatioTextBoxPntr = new BTextControl (
|
fSpamCutoffRatioTextBoxPntr = new BTextControl (
|
||||||
tempRect,
|
tempRect,
|
||||||
@@ -229,7 +235,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow ()
|
|||||||
|
|
||||||
// Add the box displaying the genuine cutoff ratio, on a line by itself.
|
// Add the box displaying the genuine cutoff ratio, on a line by itself.
|
||||||
|
|
||||||
tempStringPntr = "Genuine below and uncertain above:";
|
tempStringPntr = B_TRANSLATE("Genuine below and uncertain above:");
|
||||||
sprintf (numberString, "%08.6f", (double) fGenuineCutoffRatio);
|
sprintf (numberString, "%08.6f", (double) fGenuineCutoffRatio);
|
||||||
fGenuineCutoffRatioTextBoxPntr = new BTextControl (
|
fGenuineCutoffRatioTextBoxPntr = new BTextControl (
|
||||||
tempRect,
|
tempRect,
|
||||||
@@ -251,7 +257,7 @@ void AGMSBayesianSpamFilterConfig::AttachedToWindow ()
|
|||||||
fAutoTrainingCheckBoxPntr = new BCheckBox (
|
fAutoTrainingCheckBoxPntr = new BCheckBox (
|
||||||
tempRect,
|
tempRect,
|
||||||
"autoTraining",
|
"autoTraining",
|
||||||
"Learn from all incoming e-mail",
|
B_TRANSLATE("Learn from all incoming e-mail"),
|
||||||
new BMessage (kAutoTrainingPressed));
|
new BMessage (kAutoTrainingPressed));
|
||||||
AddChild (fAutoTrainingCheckBoxPntr);
|
AddChild (fAutoTrainingCheckBoxPntr);
|
||||||
fAutoTrainingCheckBoxPntr->ResizeToPreferred ();
|
fAutoTrainingCheckBoxPntr->ResizeToPreferred ();
|
||||||
@@ -415,9 +421,9 @@ AGMSBayesianSpamFilterConfig::ShowSpamServerConfigurationWindow () {
|
|||||||
return; // Successful.
|
return; // Successful.
|
||||||
|
|
||||||
ErrorExit:
|
ErrorExit:
|
||||||
(new BAlert ("SpamFilterConfig Error", "Sorry, unable to launch the "
|
(new BAlert ("SpamFilterConfig Error", B_TRANSLATE("Sorry, unable to "
|
||||||
"spamdbm program to let you edit the server settings.",
|
"launch the spamdbm program to let you edit the server settings."),
|
||||||
"Close"))->Go ();
|
B_TRANSLATE("Close")))->Go ();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,8 +60,8 @@ IMAPConfig::IMAPConfig(MailAddonSettings& settings,
|
|||||||
fAddonSettings(settings)
|
fAddonSettings(settings)
|
||||||
{
|
{
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
AddFlavor("No encryption");
|
AddFlavor(B_TRANSLATE("No encryption"));
|
||||||
AddFlavor("SSL");
|
AddFlavor(B_TRANSLATE("SSL"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetTo(settings);
|
SetTo(settings);
|
||||||
|
|||||||
@@ -42,12 +42,12 @@ POP3ConfigView::POP3ConfigView(MailAddonSettings& settings,
|
|||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
AddAuthMethod("Plain text");
|
AddAuthMethod(B_TRANSLATE("Plain text"));
|
||||||
AddAuthMethod("APOP");
|
AddAuthMethod(B_TRANSLATE("APOP"));
|
||||||
|
|
||||||
#if USE_SSL
|
#if USE_SSL
|
||||||
AddFlavor("No encryption");
|
AddFlavor(B_TRANSLATE("No encryption"));
|
||||||
AddFlavor("SSL");
|
AddFlavor(B_TRANSLATE("SSL"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SetTo(settings);
|
SetTo(settings);
|
||||||
|
|||||||
@@ -343,8 +343,12 @@ POP3Protocol::Open(const char *server, int port, int)
|
|||||||
fLog = "";
|
fLog = "";
|
||||||
|
|
||||||
// Prime the error message
|
// Prime the error message
|
||||||
BString error_msg;
|
BString error_msg, servString;
|
||||||
error_msg << B_TRANSLATE("Error while connecting to server ") << server;
|
error_msg << B_TRANSLATE("Error while connecting to server %serv");
|
||||||
|
|
||||||
|
servString << server;
|
||||||
|
error_msg.ReplaceFirst("%serv", servString);
|
||||||
|
|
||||||
if (port != 110)
|
if (port != 110)
|
||||||
error_msg << ":" << port;
|
error_msg << ":" << port;
|
||||||
|
|
||||||
@@ -445,8 +449,11 @@ POP3Protocol::Login(const char *uid, const char *password, int method)
|
|||||||
{
|
{
|
||||||
status_t err;
|
status_t err;
|
||||||
|
|
||||||
BString error_msg;
|
BString error_msg, userString;
|
||||||
error_msg << B_TRANSLATE("Error while authenticating user ") << uid;
|
error_msg << B_TRANSLATE("Error while authenticating user %user");
|
||||||
|
|
||||||
|
userString << uid;
|
||||||
|
error_msg.ReplaceFirst("%user", userString);
|
||||||
|
|
||||||
if (method == 1) { //APOP
|
if (method == 1) { //APOP
|
||||||
int32 index = fLog.FindFirst("<");
|
int32 index = fLog.FindFirst("<");
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ void ConfigView::SetTo(const BMessage *archive)
|
|||||||
|
|
||||||
BString path = archive->FindString("tag_line");
|
BString path = archive->FindString("tag_line");
|
||||||
if (!archive->HasString("tag_line"))
|
if (!archive->HasString("tag_line"))
|
||||||
path = "Fortune cookie says:\n\n";
|
path = B_TRANSLATE("Fortune cookie says:\n\n");
|
||||||
|
|
||||||
path.Truncate(path.Length() - 2);
|
path.Truncate(path.Length() - 2);
|
||||||
if (BTextControl *control = (BTextControl *)FindView("tag_line"))
|
if (BTextControl *control = (BTextControl *)FindView("tag_line"))
|
||||||
|
|||||||
@@ -44,9 +44,9 @@ SMTPConfigView::SMTPConfigView(MailAddonSettings& settings,
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
#ifdef USE_SSL
|
#ifdef USE_SSL
|
||||||
AddFlavor("Unencrypted");
|
AddFlavor(B_TRANSLATE("Unencrypted"));
|
||||||
AddFlavor("SSL");
|
AddFlavor(B_TRANSLATE("SSL"));
|
||||||
AddFlavor("STARTTLS");
|
AddFlavor(B_TRANSLATE("STARTTLS"));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
AddAuthMethod(B_TRANSLATE("None"), false);
|
AddAuthMethod(B_TRANSLATE("None"), false);
|
||||||
@@ -54,7 +54,7 @@ SMTPConfigView::SMTPConfigView(MailAddonSettings& settings,
|
|||||||
AddAuthMethod(B_TRANSLATE("POP3 before SMTP"), false);
|
AddAuthMethod(B_TRANSLATE("POP3 before SMTP"), false);
|
||||||
|
|
||||||
BTextControl *control = (BTextControl *)(FindView("host"));
|
BTextControl *control = (BTextControl *)(FindView("host"));
|
||||||
control->SetLabel(B_TRANSLATE("SMTP server: "));
|
control->SetLabel(B_TRANSLATE("SMTP server:"));
|
||||||
|
|
||||||
// Reset the dividers after changing one
|
// Reset the dividers after changing one
|
||||||
float widestLabel = 0;
|
float widestLabel = 0;
|
||||||
|
|||||||
@@ -281,8 +281,8 @@ SMTPProtocol::Connect()
|
|||||||
status = Open(fSettingsMessage.FindString("server"),
|
status = Open(fSettingsMessage.FindString("server"),
|
||||||
fSettingsMessage.FindInt32("port"), authMethod == 1);
|
fSettingsMessage.FindInt32("port"), authMethod == 1);
|
||||||
if (status < B_OK) {
|
if (status < B_OK) {
|
||||||
error_msg << B_TRANSLATE("Error while opening connection to ")
|
error_msg << B_TRANSLATE("Error while opening connection to %serv");
|
||||||
<< fSettingsMessage.FindString("server");
|
error_msg.ReplaceFirst("%serv", fSettingsMessage.FindString("server"));
|
||||||
|
|
||||||
if (fSettingsMessage.FindInt32("port") > 0)
|
if (fSettingsMessage.FindInt32("port") > 0)
|
||||||
error_msg << ":" << fSettingsMessage.FindInt32("port");
|
error_msg << ":" << fSettingsMessage.FindInt32("port");
|
||||||
@@ -304,9 +304,11 @@ SMTPProtocol::Connect()
|
|||||||
|
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
//-----This is a really cool kind of error message. How can we make it work for POP3?
|
//-----This is a really cool kind of error message. How can we make it work for POP3?
|
||||||
error_msg << B_TRANSLATE("Error while logging in to ")
|
error_msg << B_TRANSLATE("Error while logging in to %serv")
|
||||||
<< fSettingsMessage.FindString("server")
|
|
||||||
<< B_TRANSLATE(". The server said:\n") << fLog;
|
<< B_TRANSLATE(". The server said:\n") << fLog;
|
||||||
|
|
||||||
|
error_msg.ReplaceFirst("%serv", fSettingsMessage.FindString("server"));
|
||||||
|
|
||||||
ShowError(error_msg.String());
|
ShowError(error_msg.String());
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ AutoConfigView::AutoConfigView(BRect rect, AutoConfig &config)
|
|||||||
topLeft.y += stepSize;
|
topLeft.y += stepSize;
|
||||||
rightDown.y += stepSize;
|
rightDown.y += stepSize;
|
||||||
fEmailView = new BTextControl(BRect(topLeft, rightDown), "email",
|
fEmailView = new BTextControl(BRect(topLeft, rightDown), "email",
|
||||||
"E-mail address:", "", new BMessage(kEMailChangedMsg));
|
B_TRANSLATE("E-mail address:"), "", new BMessage(kEMailChangedMsg));
|
||||||
fEmailView->SetDivider(divider);
|
fEmailView->SetDivider(divider);
|
||||||
AddChild(fEmailView);
|
AddChild(fEmailView);
|
||||||
|
|
||||||
@@ -57,7 +57,7 @@ AutoConfigView::AutoConfigView(BRect rect, AutoConfig &config)
|
|||||||
topLeft.y += stepSize;
|
topLeft.y += stepSize;
|
||||||
rightDown.y += stepSize;
|
rightDown.y += stepSize;
|
||||||
fLoginNameView = new BTextControl(BRect(topLeft, rightDown),
|
fLoginNameView = new BTextControl(BRect(topLeft, rightDown),
|
||||||
"login", "Login name:", "", NULL);
|
"login", B_TRANSLATE("Login name:"), "", NULL);
|
||||||
fLoginNameView->SetDivider(divider);
|
fLoginNameView->SetDivider(divider);
|
||||||
AddChild(fLoginNameView);
|
AddChild(fLoginNameView);
|
||||||
|
|
||||||
@@ -65,7 +65,7 @@ AutoConfigView::AutoConfigView(BRect rect, AutoConfig &config)
|
|||||||
topLeft.y += stepSize;
|
topLeft.y += stepSize;
|
||||||
rightDown.y += stepSize;
|
rightDown.y += stepSize;
|
||||||
fPasswordView = new BTextControl(BRect(topLeft, rightDown), "password",
|
fPasswordView = new BTextControl(BRect(topLeft, rightDown), "password",
|
||||||
"Password:", "", NULL);
|
B_TRANSLATE("Password:"), "", NULL);
|
||||||
fPasswordView->SetDivider(divider);
|
fPasswordView->SetDivider(divider);
|
||||||
fPasswordView->TextView()->HideTyping(true);
|
fPasswordView->TextView()->HideTyping(true);
|
||||||
AddChild(fPasswordView);
|
AddChild(fPasswordView);
|
||||||
@@ -74,7 +74,7 @@ AutoConfigView::AutoConfigView(BRect rect, AutoConfig &config)
|
|||||||
topLeft.y += stepSize;
|
topLeft.y += stepSize;
|
||||||
rightDown.y += stepSize;
|
rightDown.y += stepSize;
|
||||||
fAccountNameView = new BTextControl(BRect(topLeft, rightDown), "account",
|
fAccountNameView = new BTextControl(BRect(topLeft, rightDown), "account",
|
||||||
"Account name:", "", NULL);
|
B_TRANSLATE("Account name:"), "", NULL);
|
||||||
fAccountNameView->SetDivider(divider);
|
fAccountNameView->SetDivider(divider);
|
||||||
AddChild(fAccountNameView);
|
AddChild(fAccountNameView);
|
||||||
|
|
||||||
@@ -82,7 +82,7 @@ AutoConfigView::AutoConfigView(BRect rect, AutoConfig &config)
|
|||||||
topLeft.y += stepSize;
|
topLeft.y += stepSize;
|
||||||
rightDown.y += stepSize;
|
rightDown.y += stepSize;
|
||||||
fNameView = new BTextControl(BRect(topLeft, rightDown), "name",
|
fNameView = new BTextControl(BRect(topLeft, rightDown), "name",
|
||||||
"Real name:", "", NULL);
|
B_TRANSLATE("Real name:"), "", NULL);
|
||||||
AddChild(fNameView);
|
AddChild(fNameView);
|
||||||
fNameView->SetDivider(divider);
|
fNameView->SetDivider(divider);
|
||||||
}
|
}
|
||||||
@@ -312,7 +312,7 @@ ServerSettingsView::ServerSettingsView(BRect rect, const account_info &info)
|
|||||||
serverName = info.providerInfo.pop_server;
|
serverName = info.providerInfo.pop_server;
|
||||||
|
|
||||||
fInboundNameView = new BTextControl(BRect(10, 20, rect.Width() - 20, 35),
|
fInboundNameView = new BTextControl(BRect(10, 20, rect.Width() - 20, 35),
|
||||||
"inbound", "Server Name:", serverName.String(),
|
"inbound", B_TRANSLATE("Server Name:"), serverName.String(),
|
||||||
new BMessage(kServerChangedMsg));
|
new BMessage(kServerChangedMsg));
|
||||||
fInboundNameView->SetDivider(divider);
|
fInboundNameView->SetDivider(divider);
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
AutoConfigWindow::AutoConfigWindow(BRect rect, ConfigWindow *parent)
|
AutoConfigWindow::AutoConfigWindow(BRect rect, ConfigWindow *parent)
|
||||||
:
|
:
|
||||||
BWindow(rect, "Create new account", B_TITLED_WINDOW_LOOK,
|
BWindow(rect, B_TRANSLATE("Create new account"), B_TITLED_WINDOW_LOOK,
|
||||||
B_MODAL_APP_WINDOW_FEEL,
|
B_MODAL_APP_WINDOW_FEEL,
|
||||||
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AVOID_FRONT, B_ALL_WORKSPACES),
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AVOID_FRONT, B_ALL_WORKSPACES),
|
||||||
fParentWindow(parent),
|
fParentWindow(parent),
|
||||||
@@ -93,7 +93,8 @@ AutoConfigWindow::MessageReceived(BMessage* msg)
|
|||||||
fMainView->GetBasicAccountInfo(fAccountInfo);
|
fMainView->GetBasicAccountInfo(fAccountInfo);
|
||||||
if (!fMainView->IsValidMailAddress(fAccountInfo.email)) {
|
if (!fMainView->IsValidMailAddress(fAccountInfo.email)) {
|
||||||
invalidMailAlert = new BAlert("invalidMailAlert",
|
invalidMailAlert = new BAlert("invalidMailAlert",
|
||||||
"Enter a valid e-mail address.", "OK");
|
B_TRANSLATE("Enter a valid e-mail address."),
|
||||||
|
B_TRANSLATE("OK"));
|
||||||
invalidMailAlert->Go();
|
invalidMailAlert->Go();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -648,8 +648,10 @@ ConfigWindow::MessageReceived(BMessage *msg)
|
|||||||
|
|
||||||
BPopUpMenu rightClickMenu("accounts", false, false);
|
BPopUpMenu rightClickMenu("accounts", false, false);
|
||||||
|
|
||||||
BMenuItem* inMenuItem = new BMenuItem("Incoming", NULL);
|
BMenuItem* inMenuItem = new BMenuItem(B_TRANSLATE("Incoming"),
|
||||||
BMenuItem* outMenuItem = new BMenuItem("Outgoing", NULL);
|
NULL);
|
||||||
|
BMenuItem* outMenuItem = new BMenuItem(B_TRANSLATE("Outgoing"),
|
||||||
|
NULL);
|
||||||
rightClickMenu.AddItem(inMenuItem);
|
rightClickMenu.AddItem(inMenuItem);
|
||||||
rightClickMenu.AddItem(outMenuItem);
|
rightClickMenu.AddItem(outMenuItem);
|
||||||
|
|
||||||
@@ -896,18 +898,18 @@ ConfigWindow::_AddAccountToView(BMailAccountSettings* account)
|
|||||||
item = new AccountItem(label, account, ACCOUNT_ITEM);
|
item = new AccountItem(label, account, ACCOUNT_ITEM);
|
||||||
fAccountsListView->AddItem(item);
|
fAccountsListView->AddItem(item);
|
||||||
|
|
||||||
item = new AccountItem(B_TRANSLATE(" · Incoming"), account, INBOUND_ITEM);
|
item = new AccountItem(B_TRANSLATE("· Incoming"), account, INBOUND_ITEM);
|
||||||
fAccountsListView->AddItem(item);
|
fAccountsListView->AddItem(item);
|
||||||
if (!account->IsInboundEnabled())
|
if (!account->IsInboundEnabled())
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
|
|
||||||
item = new AccountItem(B_TRANSLATE(" · Outgoing"), account,
|
item = new AccountItem(B_TRANSLATE("· Outgoing"), account,
|
||||||
OUTBOUND_ITEM);
|
OUTBOUND_ITEM);
|
||||||
fAccountsListView->AddItem(item);
|
fAccountsListView->AddItem(item);
|
||||||
if (!account->IsOutboundEnabled())
|
if (!account->IsOutboundEnabled())
|
||||||
item->SetEnabled(false);
|
item->SetEnabled(false);
|
||||||
|
|
||||||
item = new AccountItem(B_TRANSLATE(" · E-mail filters"), account,
|
item = new AccountItem(B_TRANSLATE("· E-mail filters"), account,
|
||||||
FILTER_ITEM);
|
FILTER_ITEM);
|
||||||
fAccountsListView->AddItem(item);
|
fAccountsListView->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ local sources =
|
|||||||
main.cpp
|
main.cpp
|
||||||
;
|
;
|
||||||
|
|
||||||
|
AddResources E-mail : e-mail.rdef ;
|
||||||
|
|
||||||
Preference E-mail
|
Preference E-mail
|
||||||
:
|
:
|
||||||
@@ -30,13 +31,17 @@ Preference E-mail
|
|||||||
:
|
:
|
||||||
be libmail.so $(HAIKU_NETWORK_LIBS) $(TARGET_NETAPI_LIB) $(TARGET_LIBSTDC++)
|
be libmail.so $(HAIKU_NETWORK_LIBS) $(TARGET_NETAPI_LIB) $(TARGET_LIBSTDC++)
|
||||||
$(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
$(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
: e-mail.rdef
|
|
||||||
;
|
;
|
||||||
|
|
||||||
DoCatalogs E-mail
|
DoCatalogs E-mail
|
||||||
: x-vnd.Haiku-Mail
|
:
|
||||||
: ConfigViews.cpp
|
x-vnd.Haiku-Mail
|
||||||
ConfigWindow.cpp
|
:
|
||||||
|
AutoConfigView.cpp
|
||||||
|
AutoConfigWindow.cpp
|
||||||
|
ConfigViews.cpp
|
||||||
|
ConfigWindow.cpp
|
||||||
|
FilterConfigView.cpp
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -541,11 +541,14 @@ DeskbarView::_BuildMenu()
|
|||||||
// The New E-mail query
|
// The New E-mail query
|
||||||
|
|
||||||
if (fNewMessages > 0) {
|
if (fNewMessages > 0) {
|
||||||
BString string;
|
BString string, numString;
|
||||||
if (fNewMessages != 1)
|
if (fNewMessages != 1)
|
||||||
string << fNewMessages << B_TRANSLATE(" new messages");
|
string << B_TRANSLATE("%num new messages");
|
||||||
else
|
else
|
||||||
string << fNewMessages << B_TRANSLATE(" new message");
|
string << B_TRANSLATE("%num new message");
|
||||||
|
|
||||||
|
numString << fNewMessages;
|
||||||
|
string.ReplaceFirst("%num", numString);
|
||||||
|
|
||||||
_GetNewQueryRef(ref);
|
_GetNewQueryRef(ref);
|
||||||
|
|
||||||
|
|||||||
@@ -96,9 +96,9 @@ MailDaemonApp::MailDaemonApp()
|
|||||||
fAutoCheckRunner(NULL)
|
fAutoCheckRunner(NULL)
|
||||||
{
|
{
|
||||||
fErrorLogWindow = new ErrorLogWindow(BRect(200, 200, 500, 250),
|
fErrorLogWindow = new ErrorLogWindow(BRect(200, 200, 500, 250),
|
||||||
"Mail daemon status log", B_TITLED_WINDOW);
|
B_TRANSLATE("Mail daemon status log"), B_TITLED_WINDOW);
|
||||||
fMailStatusWindow = new MailStatusWindow(BRect(40, 400, 360, 400),
|
fMailStatusWindow = new MailStatusWindow(BRect(40, 400, 360, 400),
|
||||||
"Mail Status", fSettingsFile.ShowStatusWindow());
|
B_TRANSLATE("Mail Status"), fSettingsFile.ShowStatusWindow());
|
||||||
// install MimeTypes, attributes, indices, and the
|
// install MimeTypes, attributes, indices, and the
|
||||||
// system beep add startup
|
// system beep add startup
|
||||||
MakeMimeTypes();
|
MakeMimeTypes();
|
||||||
@@ -162,12 +162,15 @@ MailDaemonApp::ReadyToRun()
|
|||||||
fQueries.AddItem(query);
|
fQueries.AddItem(query);
|
||||||
}
|
}
|
||||||
|
|
||||||
BString string;
|
BString string, numString;
|
||||||
if (fNewMessages > 0) {
|
if (fNewMessages > 0) {
|
||||||
if (fNewMessages != 1)
|
if (fNewMessages != 1)
|
||||||
string << fNewMessages << B_TRANSLATE(" new messages.");
|
string << B_TRANSLATE("%num new messages.");
|
||||||
else
|
else
|
||||||
string << fNewMessages << B_TRANSLATE(" new message.");
|
string << B_TRANSLATE("%num new message.");
|
||||||
|
|
||||||
|
numString << fNewMessages;
|
||||||
|
string.ReplaceFirst("%num", numString);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
string = B_TRANSLATE("No new messages");
|
string = B_TRANSLATE("No new messages");
|
||||||
@@ -543,13 +546,16 @@ MailDaemonApp::MessageReceived(BMessage* msg)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
BString string;
|
BString string, numString;
|
||||||
|
|
||||||
if (fNewMessages > 0) {
|
if (fNewMessages > 0) {
|
||||||
if (fNewMessages != 1)
|
if (fNewMessages != 1)
|
||||||
string << fNewMessages << B_TRANSLATE(" new messages.");
|
string << B_TRANSLATE("%num new messages.");
|
||||||
else
|
else
|
||||||
string << fNewMessages << B_TRANSLATE(" new message.");
|
string << B_TRANSLATE("%num new message.");
|
||||||
|
|
||||||
|
numString << fNewMessages;
|
||||||
|
string.ReplaceFirst("%num", numString);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
string << B_TRANSLATE("No new messages.");
|
string << B_TRANSLATE("No new messages.");
|
||||||
|
|||||||
Reference in New Issue
Block a user