Localization to replace the hardcoded English/Japanese. I will follow up with a Japanese translation based on the previous code. Some of the old solution lingers in parts of the code. A small amount of clean-up and removal BeOS-specifics.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@34956 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Jonas Sundström
2010-01-08 20:26:05 +00:00
parent b5be9fe6ff
commit c8767bee6f
17 changed files with 389 additions and 433 deletions
+25 -31
View File
@@ -38,35 +38,29 @@ All rights reserved.
#include <stdio.h> #include <stdio.h>
#include <ctype.h> #include <ctype.h>
#include <Debug.h>
#include <Alert.h> #include <Alert.h>
#include <Beep.h> #include <Beep.h>
#include <Clipboard.h>
#include <Debug.h>
#include <E-mail.h> #include <E-mail.h>
#include <Beep.h> #include <Input.h>
#include <Locale.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Mime.h>
#include <NodeInfo.h> #include <NodeInfo.h>
#include <NodeMonitor.h> #include <NodeMonitor.h>
#include <Path.h> #include <Path.h>
#include <Mime.h>
#include <Beep.h>
#include <PopUpMenu.h> #include <PopUpMenu.h>
#include <MenuItem.h>
#include <Region.h> #include <Region.h>
#include <Roster.h> #include <Roster.h>
#include <ScrollView.h> #include <ScrollView.h>
#include <TextView.h> #include <TextView.h>
#include <UTF8.h> #include <UTF8.h>
#include <MenuItem.h>
#include <Roster.h>
#include <Clipboard.h>
#include <Input.h>
#include <MailMessage.h> #include <MailMessage.h>
#include <MailAttachment.h> #include <MailAttachment.h>
#include <mail_util.h> #include <mail_util.h>
#include <MDRLanguage.h>
#include "MailApp.h" #include "MailApp.h"
#include "MailSupport.h" #include "MailSupport.h"
#include "MailWindow.h" #include "MailWindow.h"
@@ -84,6 +78,10 @@ All rights reserved.
# define DSPELL(x) ; # define DSPELL(x) ;
#endif #endif
#define TR_CONTEXT "Mail"
const rgb_color kNormalTextColor = {0, 0, 0, 255}; const rgb_color kNormalTextColor = {0, 0, 0, 255};
const rgb_color kSpellTextColor = {255, 0, 0, 255}; const rgb_color kSpellTextColor = {255, 0, 0, 255};
const rgb_color kHyperLinkColor = {0, 0, 255, 255}; const rgb_color kHyperLinkColor = {0, 0, 255, 255};
@@ -744,9 +742,8 @@ TContentView::MessageReceived(BMessage *msg)
} else { } else {
beep(); beep();
(new BAlert("", (new BAlert("",
MDR_DIALECT_CHOICE ("An error occurred trying to open this signature.", TR("An error occurred trying to open this signature."),
"この署名を開くときにエラーが発生しました"), TR("Sorry")))->Go();
MDR_DIALECT_CHOICE ("Sorry", "了解")))->Go();
} }
break; break;
} }
@@ -885,19 +882,19 @@ TTextView::TTextView(BRect frame, BRect text, bool incoming,
// //
fEnclosureMenu = new BPopUpMenu("Enclosure", false, false); fEnclosureMenu = new BPopUpMenu("Enclosure", false, false);
fEnclosureMenu->SetFont(&menuFont); fEnclosureMenu->SetFont(&menuFont);
fEnclosureMenu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Save Enclosure", "添付ファイルを保存") B_UTF8_ELLIPSIS,new BMessage(M_SAVE))); fEnclosureMenu->AddItem(new BMenuItem(TR("Save Enclosure" B_UTF8_ELLIPSIS),
fEnclosureMenu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Open Enclosure", "添付ファイルを開く"), new BMessage(M_OPEN))); new BMessage(M_SAVE)));
fEnclosureMenu->AddItem(new BMenuItem(TR("Open Enclosure"),
new BMessage(M_OPEN)));
// //
// Hyperlink pop up menu // Hyperlink pop up menu
// //
fLinkMenu = new BPopUpMenu("Link", false, false); fLinkMenu = new BPopUpMenu("Link", false, false);
fLinkMenu->SetFont(&menuFont); fLinkMenu->SetFont(&menuFont);
fLinkMenu->AddItem(new BMenuItem( fLinkMenu->AddItem(new BMenuItem(TR("Open This Link"),
MDR_DIALECT_CHOICE ("Open This Link", "リンク先を開く"),
new BMessage(M_OPEN))); new BMessage(M_OPEN)));
fLinkMenu->AddItem(new BMenuItem( fLinkMenu->AddItem(new BMenuItem(TR("Copy Link Location"),
MDR_DIALECT_CHOICE ("Copy Link Location", "リンク先をコピー"),
new BMessage(M_COPY))); new BMessage(M_COPY)));
SetDoesUndo(true); SetDoesUndo(true);
@@ -1551,7 +1548,7 @@ TTextView::MouseDown(BPoint where)
BMenuItem *addItem = NULL; BMenuItem *addItem = NULL;
if (!foundWord && gUserDict >= 0) { if (!foundWord && gUserDict >= 0) {
menu.AddSeparatorItem(); menu.AddSeparatorItem();
addItem = new BMenuItem(MDR_DIALECT_CHOICE ("Add", "追加"), NULL); addItem = new BMenuItem(TR("Add"), NULL);
menu.AddItem(addItem); menu.AddItem(addItem);
} }
@@ -1893,8 +1890,7 @@ TTextView::Open(hyper_text *enclosure)
if (result != B_NO_ERROR && result != B_ALREADY_RUNNING) { if (result != B_NO_ERROR && result != B_ALREADY_RUNNING) {
beep(); beep();
(new BAlert("", (new BAlert("",
MDR_DIALECT_CHOICE("There is no installed handler for URL links.", TR("There is no installed handler for URL links."),
"このURLリンクを扱えるアプリケーションが存在しません"),
"Sorry"))->Go(); "Sorry"))->Go();
} }
break; break;
@@ -2043,10 +2039,8 @@ TTextView::Save(BMessage *msg, bool makeNewFile)
if (result != B_NO_ERROR) { if (result != B_NO_ERROR) {
beep(); beep();
MDR_DIALECT_CHOICE( (new BAlert("", TR("An error occurred trying to save the enclosure."),
(new BAlert("", "An error occurred trying to save the enclosure.", "Sorry"))->Go();, TR("Sorry")))->Go();
(new BAlert("", "添付ファイルを保存するときにエラーが発生しました", "了解"))->Go();
)
} }
return result; return result;
@@ -3285,8 +3279,8 @@ TTextView::Undo(BClipboard */*clipboard*/)
} else { } else {
::beep(); ::beep();
(new BAlert("", (new BAlert("",
MDR_DIALECT_CHOICE("Inconsistency occurred in the Undo/Redo buffer.", TR("Inconsistency occurred in the Undo/Redo buffer."),
"Undo/Redoバッファに矛盾が発生しました!"), "OK"))->Go(); TR("OK")))->Go();
} }
break; break;
} }
@@ -3331,8 +3325,8 @@ TTextView::Redo()
case K_REPLACED: case K_REPLACED:
::beep(); ::beep();
(new BAlert("", (new BAlert("",
MDR_DIALECT_CHOICE("Inconsistency occurred in the Undo/Redo buffer.", TR("Inconsistency occurred in the Undo/Redo buffer."),
"Undo/Redoバッファに矛盾が発生しました!"), "OK"))->Go(); TR("OK")))->Go();
break; break;
} }
ScrollToSelection(); ScrollToSelection();
+16 -19
View File
@@ -41,19 +41,18 @@ All rights reserved.
#include "Enclosures.h" #include "Enclosures.h"
#include <Debug.h> #include <Alert.h>
#include <Beep.h> #include <Beep.h>
#include <Bitmap.h> #include <Bitmap.h>
#include <Debug.h>
#include <Locale.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Alert.h>
#include <NodeMonitor.h> #include <NodeMonitor.h>
#include <PopUpMenu.h> #include <PopUpMenu.h>
#include <MailAttachment.h> #include <MailAttachment.h>
#include <MailMessage.h> #include <MailMessage.h>
#include <MDRLanguage.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@@ -64,6 +63,9 @@ All rights reserved.
#include "Messages.h" #include "Messages.h"
#define TR_CONTEXT "Mail"
static const float kPlainFontSizeScale = 0.9; static const float kPlainFontSizeScale = 0.9;
static status_t static status_t
@@ -137,7 +139,7 @@ TEnclosuresView::TEnclosuresView(BRect rect, BRect wind_rect)
BRect r; BRect r;
r.left = ENCLOSE_TEXT_H + font.StringWidth( r.left = ENCLOSE_TEXT_H + font.StringWidth(
MDR_DIALECT_CHOICE ("Enclosures: ","添付ファイル")) + 5; TR("Enclosures: ")) + 5;
r.top = ENCLOSE_FIELD_V; r.top = ENCLOSE_FIELD_V;
r.right = wind_rect.right - wind_rect.left - B_V_SCROLL_BAR_WIDTH - 9; r.right = wind_rect.right - wind_rect.left - B_V_SCROLL_BAR_WIDTH - 9;
r.bottom = Frame().Height() - 8; r.bottom = Frame().Height() - 8;
@@ -218,16 +220,14 @@ TEnclosuresView::MessageReceived(BMessage *msg)
if (item->Component()) if (item->Component())
{ {
// remove the component from the mail
TMailWindow *window = dynamic_cast<TMailWindow *>(Window()); TMailWindow *window = dynamic_cast<TMailWindow *>(Window());
if (window && window->Mail()) if (window && window->Mail())
window->Mail()->RemoveComponent(item->Component()); window->Mail()->RemoveComponent(item->Component());
(new BAlert("", MDR_DIALECT_CHOICE ( (new BAlert("", TR(
"Removing enclosures from a forwarded mail is not yet implemented!\n" "Removing enclosures from a forwarded mail is not yet "
"It will not yet work correctly.", "implemented!\nIt will not yet work correctly."),
"転送メールから添付ファイルを削除する機能はまだ実装されていません。"), TR("OK")))->Go();
MDR_DIALECT_CHOICE ("OK","了解")))->Go();
} }
else else
watch_node(item->NodeRef(), B_STOP_WATCHING, this); watch_node(item->NodeRef(), B_STOP_WATCHING, this);
@@ -277,10 +277,9 @@ TEnclosuresView::MessageReceived(BMessage *msg)
if (badType) if (badType)
{ {
beep(); beep();
(new BAlert("", MDR_DIALECT_CHOICE ( (new BAlert("",
"Only files can be added as enclosures.", TR("Only files can be added as enclosures."),
"添付できるのは、ファイルのみです。"), TR("Ok")))->Go();
MDR_DIALECT_CHOICE ("Ok","了解")))->Go();
} }
} }
break; break;
@@ -424,11 +423,9 @@ TListView::MouseDown(BPoint point)
BPopUpMenu menu("enclosure", false, false); BPopUpMenu menu("enclosure", false, false);
menu.SetFont(&font); menu.SetFont(&font);
menu.AddItem(new BMenuItem( menu.AddItem(new BMenuItem(TR("Open Enclosure"),
MDR_DIALECT_CHOICE ("Open Enclosure","添付ファイルを開く"),
new BMessage(LIST_INVOKED))); new BMessage(LIST_INVOKED)));
menu.AddItem(new BMenuItem( menu.AddItem(new BMenuItem(TR("Remove Enclosure"),
MDR_DIALECT_CHOICE ("Remove Enclosure","添付ファイルを削除"),
new BMessage(M_REMOVE))); new BMessage(M_REMOVE)));
BPoint menuStart = ConvertToScreen(point); BPoint menuStart = ConvertToScreen(point);
+10 -6
View File
@@ -43,13 +43,17 @@ All rights reserved.
#include "Messages.h" #include "Messages.h"
#include "AutoTextControl.h" #include "AutoTextControl.h"
#include <TextView.h>
#include <Button.h>
#include <Application.h> #include <Application.h>
#include <String.h>
#include <Box.h> #include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <Locale.h>
#include <String.h>
#include <TextView.h>
#define TR_CONTEXT "Mail"
#include <MDRLanguage.h>
enum { enum {
M_FIND_STRING_CHANGED = 'fsch' M_FIND_STRING_CHANGED = 'fsch'
@@ -134,7 +138,7 @@ FindPanel::FindPanel(BRect rect)
AddChild(mBTextControl); AddChild(mBTextControl);
mFindButton = new BButton(BRect(0,0,90,20),"FINDBUTTON", mFindButton = new BButton(BRect(0,0,90,20),"FINDBUTTON",
MDR_DIALECT_CHOICE ("Find","検索"), TR("Find"),
new BMessage(FINDBUTTON),B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); new BMessage(FINDBUTTON),B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
mFindButton->ResizeToPreferred(); mFindButton->ResizeToPreferred();
AddChild(mFindButton); AddChild(mFindButton);
@@ -229,7 +233,7 @@ void FindPanel::Find()
FindWindow::FindWindow() FindWindow::FindWindow()
: BWindow(FindWindow::mLastPosition, : BWindow(FindWindow::mLastPosition,
MDR_DIALECT_CHOICE ("Find","検索"), TR("Find"),
B_FLOATING_WINDOW, B_FLOATING_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK) B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_WILL_ACCEPT_FIRST_CLICK)
{ {
+28 -21
View File
@@ -42,13 +42,13 @@ All rights reserved.
#include "FieldMsg.h" #include "FieldMsg.h"
#include "Prefs.h" #include "Prefs.h"
#include <MDRLanguage.h>
#include <MailSettings.h> #include <MailSettings.h>
#include <MailMessage.h> #include <MailMessage.h>
#include <CharacterSet.h> #include <CharacterSet.h>
#include <CharacterSetRoster.h> #include <CharacterSetRoster.h>
#include <E-mail.h> #include <E-mail.h>
#include <Locale.h>
#include <MenuBar.h> #include <MenuBar.h>
#include <MenuField.h> #include <MenuField.h>
#include <MenuItem.h> #include <MenuItem.h>
@@ -70,6 +70,9 @@ All rights reserved.
#include <time.h> #include <time.h>
#define TR_CONTEXT "Mail"
using namespace BPrivate; using namespace BPrivate;
using std::map; using std::map;
@@ -153,7 +156,7 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
BMessage* msg; BMessage* msg;
float x = StringWidth( /* The longest title string in the header area */ float x = StringWidth( /* The longest title string in the header area */
MDR_DIALECT_CHOICE ("Enclosures: ","添付ファイル:")) + 9; TR("Enclosures: ")) + 9;
float y = TO_FIELD_V; float y = TO_FIELD_V;
BMenuBar* dummy = new BMenuBar(BRect(0, 0, 100, 15), "Dummy"); BMenuBar* dummy = new BMenuBar(BRect(0, 0, 100, 15), "Dummy");
@@ -242,17 +245,17 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (fIncoming && !resending) { if (fIncoming && !resending) {
// Set up the character set pop-up menu on the right of "To" box. // Set up the character set pop-up menu on the right of "To" box.
r.Set (windowRect.Width() - widestCharacterSet - r.Set (windowRect.Width() - widestCharacterSet -
StringWidth (DECODING_TEXT) - 2 * SEPARATOR_MARGIN, y - 2, StringWidth (TR("Decoding:")) - 2 * SEPARATOR_MARGIN, y - 2,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
field = new BMenuField (r, "decoding", DECODING_TEXT, fEncodingMenu, field = new BMenuField (r, "decoding", TR("Decoding:"), fEncodingMenu,
true /* fixedSize */, true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_RIGHT, B_FOLLOW_TOP | B_FOLLOW_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
field->SetDivider(field->StringWidth(DECODING_TEXT) + 5); field->SetDivider(field->StringWidth(TR("Decoding:")) + 5);
AddChild(field); AddChild(field);
r.Set(SEPARATOR_MARGIN, y, r.Set(SEPARATOR_MARGIN, y,
field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight); field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight);
sprintf(string, FROM_TEXT); sprintf(string, TR("From:"));
} else { } else {
r.Set(x - 12, y, windowRect.Width() - SEPARATOR_MARGIN, r.Set(x - 12, y, windowRect.Width() - SEPARATOR_MARGIN,
y + menuFieldHeight); y + menuFieldHeight);
@@ -279,9 +282,9 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (!fIncoming || resending) { if (!fIncoming || resending) {
r.right = r.left - 5; r.right = r.left - 5;
r.left = r.right - ceilf(be_plain_font->StringWidth(TO_TEXT) + 25); r.left = r.right - ceilf(be_plain_font->StringWidth(TR("To:")) + 25);
r.top -= 1; r.top -= 1;
fToMenu = new QPopupMenu(TO_TEXT); fToMenu = new QPopupMenu(TR("To:"));
field = new BMenuField(r, "", "", fToMenu, true, field = new BMenuField(r, "", "", fToMenu, true,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
field->SetDivider(0.0); field->SetDivider(0.0);
@@ -293,13 +296,14 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (!fIncoming || resending) { if (!fIncoming || resending) {
// Put the character set box on the right of the From field. // Put the character set box on the right of the From field.
r.Set(windowRect.Width() - widestCharacterSet - r.Set(windowRect.Width() - widestCharacterSet -
StringWidth(ENCODING_TEXT) - 2 * SEPARATOR_MARGIN, StringWidth(TR("Encoding:")) - 2 * SEPARATOR_MARGIN,
y - 2, windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); y - 2, windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
BMenuField *encodingField = new BMenuField (r, "encoding", ENCODING_TEXT, fEncodingMenu, BMenuField* encodingField = new BMenuField(r, "encoding",
true /* fixedSize */, TR("Encoding:"), fEncodingMenu, true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_RIGHT, B_FOLLOW_TOP | B_FOLLOW_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
encodingField->SetDivider(encodingField->StringWidth(ENCODING_TEXT) + 5); encodingField->SetDivider(encodingField->StringWidth(TR("Encoding:"))
+ 5);
AddChild(encodingField); AddChild(encodingField);
field = encodingField; field = encodingField;
@@ -351,7 +355,7 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
} }
r.Set(SEPARATOR_MARGIN, y - 2, r.Set(SEPARATOR_MARGIN, y - 2,
field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight); field->Frame().left - SEPARATOR_MARGIN, y + menuFieldHeight);
field = new BMenuField(r, "account", FROM_TEXT, fAccountMenu, field = new BMenuField(r, "account", TR("From:"), fAccountMenu,
true /* fixedSize */, true /* fixedSize */,
B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT, B_FOLLOW_TOP | B_FOLLOW_LEFT_RIGHT,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
@@ -371,7 +375,8 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
if (account) if (account)
r.right -= SEPARATOR_MARGIN + ACCOUNT_FIELD_WIDTH; r.right -= SEPARATOR_MARGIN + ACCOUNT_FIELD_WIDTH;
fAccountTo = new TTextControl(r, TO_TEXT, NULL, fIncoming, false, B_FOLLOW_LEFT_RIGHT); fAccountTo = new TTextControl(r, TR("To:"), NULL, fIncoming, false,
B_FOLLOW_LEFT_RIGHT);
fAccountTo->SetEnabled(false); fAccountTo->SetEnabled(false);
fAccountTo->SetDivider(x - 12 - SEPARATOR_MARGIN); fAccountTo->SetDivider(x - 12 - SEPARATOR_MARGIN);
fAccountTo->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fAccountTo->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
@@ -379,7 +384,8 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
if (account) { if (account) {
r.left = r.right + 6; r.right = windowRect.Width() - SEPARATOR_MARGIN; r.left = r.right + 6; r.right = windowRect.Width() - SEPARATOR_MARGIN;
fAccount = new TTextControl(r, ACCOUNT_TEXT, NULL, fIncoming, false, B_FOLLOW_RIGHT | B_FOLLOW_TOP); fAccount = new TTextControl(r, TR("Account:"), NULL, fIncoming,
false, B_FOLLOW_RIGHT | B_FOLLOW_TOP);
fAccount->SetEnabled(false); fAccount->SetEnabled(false);
AddChild(fAccount); AddChild(fAccount);
} }
@@ -390,7 +396,7 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
r.Set(SEPARATOR_MARGIN, y, r.Set(SEPARATOR_MARGIN, y,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
y += controlHeight; y += controlHeight;
fSubject = new TTextControl(r, SUBJECT_TEXT, new BMessage(SUBJECT_FIELD), fSubject = new TTextControl(r, TR("Subject:"), new BMessage(SUBJECT_FIELD),
fIncoming, false, B_FOLLOW_LEFT_RIGHT); fIncoming, false, B_FOLLOW_LEFT_RIGHT);
AddChild(fSubject); AddChild(fSubject);
(msg = new BMessage(FIELD_CHANGED))->AddInt32("bitmask", FIELD_SUBJECT); (msg = new BMessage(FIELD_CHANGED))->AddInt32("bitmask", FIELD_SUBJECT);
@@ -413,9 +419,9 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
fCc->SetModificationMessage(msg); fCc->SetModificationMessage(msg);
r.right = r.left - 5; r.right = r.left - 5;
r.left = r.right - ceilf(be_plain_font->StringWidth(CC_TEXT) + 25); r.left = r.right - ceilf(be_plain_font->StringWidth(TR("Cc:")) + 25);
r.top -= 1; r.top -= 1;
fCcMenu = new QPopupMenu(CC_TEXT); fCcMenu = new QPopupMenu(TR("Cc:"));
field = new BMenuField(r, "", "", fCcMenu, true, field = new BMenuField(r, "", "", fCcMenu, true,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
@@ -423,7 +429,7 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
field->SetEnabled(true); field->SetEnabled(true);
AddChild(field); AddChild(field);
r.Set(BCC_FIELD_H + be_plain_font->StringWidth(BCC_TEXT), y, r.Set(BCC_FIELD_H + be_plain_font->StringWidth(TR("Bcc:")), y,
windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight); windowRect.Width() - SEPARATOR_MARGIN, y + menuFieldHeight);
y += controlHeight; y += controlHeight;
fBcc = new TTextControl(r, "", new BMessage(BCC_FIELD), fBcc = new TTextControl(r, "", new BMessage(BCC_FIELD),
@@ -436,9 +442,9 @@ THeaderView::THeaderView(BRect rect, BRect windowRect, bool incoming,
fBcc->SetModificationMessage(msg); fBcc->SetModificationMessage(msg);
r.right = r.left - 5; r.right = r.left - 5;
r.left = r.right - ceilf(be_plain_font->StringWidth(BCC_TEXT) + 25); r.left = r.right - ceilf(be_plain_font->StringWidth(TR("Bcc:")) + 25);
r.top -= 1; r.top -= 1;
fBccMenu = new QPopupMenu(BCC_TEXT); fBccMenu = new QPopupMenu(TR("Bcc:"));
field = new BMenuField(r, "", "", fBccMenu, true, field = new BMenuField(r, "", "", fBccMenu, true,
B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW); B_FOLLOW_LEFT | B_FOLLOW_TOP, B_WILL_DRAW);
field->SetDivider(0.0); field->SetDivider(0.0);
@@ -1159,3 +1165,4 @@ void
QPopupMenu::EntryRemoved(ino_t /*node*/) QPopupMenu::EntryRemoved(ino_t /*node*/)
{ {
} }
+1 -8
View File
@@ -47,32 +47,24 @@ All rights reserved.
#include <fs_attr.h> #include <fs_attr.h>
#define TO_TEXT "To:"
#define FROM_TEXT "From:"
#define ENCODING_TEXT "Encoding:"
#define DECODING_TEXT "Decoding:"
#define TO_FIELD_H 39 #define TO_FIELD_H 39
#define FROM_FIELD_H 31 #define FROM_FIELD_H 31
#define TO_FIELD_V 7 #define TO_FIELD_V 7
#define TO_FIELD_WIDTH 270 #define TO_FIELD_WIDTH 270
#define FROM_FIELD_WIDTH 280 #define FROM_FIELD_WIDTH 280
#define ACCOUNT_TEXT "Account:"
#define ACCOUNT_FIELD_WIDTH 165 #define ACCOUNT_FIELD_WIDTH 165
#define SUBJECT_TEXT "Subject:"
#define SUBJECT_FIELD_H 18 #define SUBJECT_FIELD_H 18
#define SUBJECT_FIELD_V 33 #define SUBJECT_FIELD_V 33
#define SUBJECT_FIELD_WIDTH 270 #define SUBJECT_FIELD_WIDTH 270
#define SUBJECT_FIELD_HEIGHT 16 #define SUBJECT_FIELD_HEIGHT 16
#define CC_TEXT "CC:"
#define CC_FIELD_H 40 #define CC_FIELD_H 40
#define CC_FIELD_V 58 #define CC_FIELD_V 58
#define CC_FIELD_WIDTH 192 #define CC_FIELD_WIDTH 192
#define CC_FIELD_HEIGHT 16 #define CC_FIELD_HEIGHT 16
#define BCC_TEXT "BCC:"
#define BCC_FIELD_H 268 #define BCC_FIELD_H 268
#define BCC_FIELD_V 58 #define BCC_FIELD_V 58
#define BCC_FIELD_WIDTH 197 #define BCC_FIELD_WIDTH 197
@@ -141,3 +133,4 @@ class TTextControl : public BComboBox {
}; };
#endif /* _HEADER_H */ #endif /* _HEADER_H */
+22 -9
View File
@@ -1,7 +1,5 @@
SubDir HAIKU_TOP src apps mail ; SubDir HAIKU_TOP src apps mail ;
SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
} }
@@ -11,7 +9,8 @@ UsePrivateHeaders textencoding ;
UsePrivateHeaders shared ; UsePrivateHeaders shared ;
UsePrivateHeaders storage ; UsePrivateHeaders storage ;
AddResources Mail : Mail.rdef pictures.rdef ; AddResources Mail : pictures.rdef ;
Application Mail : Application Mail :
AutoTextControl.cpp AutoTextControl.cpp
BmapButton.cpp BmapButton.cpp
@@ -32,11 +31,25 @@ Application Mail :
Utilities.cpp Utilities.cpp
WIndex.cpp WIndex.cpp
Words.cpp Words.cpp
KUndoBuffer.cpp ; KUndoBuffer.cpp
: be tracker $(TARGET_LIBSTDC++) $(TARGET_LIBSUPC++) liblocale.so libmail.so
libtextencoding.so
: Mail.rdef
;
LinkAgainst Mail : be tracker $(TARGET_LIBSTDC++) libmail.so libtextencoding.so ; DoCatalogs Mail :
x-vnd.Be-MAIL
Package haiku-maildaemon-cvs : :
Mail : Content.cpp
boot beos apps ; Enclosures.cpp
FindWindow.cpp
Header.cpp
MailApp.cpp
MailPopUpMenu.cpp
MailWindow.cpp
Prefs.cpp
Signature.cpp
: en.catalog
: # ja.catkeys
;
+1 -1
View File
@@ -19,7 +19,7 @@ resource app_version {
internal = 3, internal = 3,
short_info = "Mail", short_info = "Mail",
long_info = "Mail ©2005-2009 Haiku, Inc." long_info = "Mail ©2005-2010 Haiku, Inc."
}; };
resource vector_icon { resource vector_icon {
+11 -8
View File
@@ -44,10 +44,12 @@ All rights reserved.
#include <unistd.h> #include <unistd.h>
#include <Autolock.h> #include <Autolock.h>
#include <Catalog.h>
#include <Clipboard.h> #include <Clipboard.h>
#include <Debug.h> #include <Debug.h>
#include <E-mail.h> #include <E-mail.h>
#include <InterfaceKit.h> #include <InterfaceKit.h>
#include <Locale.h>
#include <Roster.h> #include <Roster.h>
#include <Screen.h> #include <Screen.h>
#include <StorageKit.h> #include <StorageKit.h>
@@ -62,16 +64,11 @@ All rights reserved.
#include <MailSettings.h> #include <MailSettings.h>
#include <MailDaemon.h> #include <MailDaemon.h>
#include <mail_util.h> #include <mail_util.h>
#include <MDRLanguage.h>
#include <CharacterSetRoster.h> #include <CharacterSetRoster.h>
using namespace BPrivate ; using namespace BPrivate ;
#ifdef HAIKU_TARGET_PLATFORM_BEOS
#include <netdb.h>
#endif
#include "ButtonBar.h" #include "ButtonBar.h"
#include "Content.h" #include "Content.h"
#include "Enclosures.h" #include "Enclosures.h"
@@ -90,6 +87,9 @@ using namespace BPrivate ;
#include "Words.h" #include "Words.h"
#define TR_CONTEXT "Mail"
static const char *kDictDirectory = "word_dictionary"; static const char *kDictDirectory = "word_dictionary";
static const char *kIndexDirectory = "word_index"; static const char *kIndexDirectory = "word_index";
static const char *kWordsPath = "/boot/optional/goodies/words"; static const char *kWordsPath = "/boot/optional/goodies/words";
@@ -117,12 +117,14 @@ TMailApp::TMailApp()
fMailCharacterSet(B_MS_WINDOWS_CONVERSION), fMailCharacterSet(B_MS_WINDOWS_CONVERSION),
fContentFont(be_fixed_font) fContentFont(be_fixed_font)
{ {
be_locale->GetAppCatalog(&fCatalog);
// set default values // set default values
fContentFont.SetSize(12.0); fContentFont.SetSize(12.0);
fAutoMarkRead = true; fAutoMarkRead = true;
fSignature = (char *)malloc(strlen(SIG_NONE) + 1); fSignature = (char*)malloc(strlen(TR("None")) + 1);
strcpy(fSignature, SIG_NONE); strcpy(fSignature, TR("None"));
fReplyPreamble = (char *)malloc(1); fReplyPreamble = (char*)malloc(1);
fReplyPreamble[0] = '\0'; fReplyPreamble[0] = '\0';
fMailWindowFrame.Set(0, 0, 0, 0); fMailWindowFrame.Set(0, 0, 0, 0);
@@ -1253,3 +1255,4 @@ main()
TMailApp().Run(); TMailApp().Run();
return B_OK; return B_OK;
} }
+4
View File
@@ -35,6 +35,7 @@ All rights reserved.
#define _MAIL_APP_H #define _MAIL_APP_H
#include <Application.h> #include <Application.h>
#include <Catalog.h>
#include <Entry.h> #include <Entry.h>
#include <Font.h> #include <Font.h>
#include <List.h> #include <List.h>
@@ -128,7 +129,10 @@ class TMailApp : public BApplication {
int32 fUseAccountFrom; int32 fUseAccountFrom;
uint32 fMailCharacterSet; uint32 fMailCharacterSet;
BFont fContentFont; BFont fContentFont;
BCatalog fCatalog;
}; };
#endif // #ifndef _MAIL_H #endif // #ifndef _MAIL_H
+7 -7
View File
@@ -35,18 +35,21 @@ All rights reserved.
#include "MailPopUpMenu.h" #include "MailPopUpMenu.h"
#include <Catalog.h>
#include <Locale.h>
#include <MenuItem.h> #include <MenuItem.h>
#include <Message.h> #include <Message.h>
#include <malloc.h> #include <malloc.h>
#include <string.h> #include <string.h>
#include <MDRLanguage.h>
#include "MailSupport.h" #include "MailSupport.h"
#include "Messages.h" #include "Messages.h"
#define TR_CONTEXT "Mail"
TMenu::TMenu(const char *name, const char *attribute, int32 message, bool popup, TMenu::TMenu(const char *name, const char *attribute, int32 message, bool popup,
bool addRandom) bool addRandom)
: BPopUpMenu(name, false, false), : BPopUpMenu(name, false, false),
@@ -94,13 +97,10 @@ TMenu::BuildMenu()
BMessage *msg = new BMessage(M_RANDOM_SIG); BMessage *msg = new BMessage(M_RANDOM_SIG);
if (!fPopup) { if (!fPopup) {
AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Random","R) 自動決定"), msg, AddItem(new BMenuItem(TR("Random"), msg, '0'), 0);
'0'), 0);
} else { } else {
AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Random","R) 自動決定"), msg), AddItem(new BMenuItem(TR("Random"), msg), 0);
0);
} }
} }
} }
-1
View File
@@ -62,7 +62,6 @@ All rights reserved.
#include <MailSettings.h> #include <MailSettings.h>
#include <MailDaemon.h> #include <MailDaemon.h>
#include <mail_util.h> #include <mail_util.h>
#include <MDRLanguage.h>
#include <CharacterSetRoster.h> #include <CharacterSetRoster.h>
+143 -166
View File
@@ -48,6 +48,7 @@ All rights reserved.
#include <Debug.h> #include <Debug.h>
#include <E-mail.h> #include <E-mail.h>
#include <InterfaceKit.h> #include <InterfaceKit.h>
#include <Locale.h>
#include <PathMonitor.h> #include <PathMonitor.h>
#include <Roster.h> #include <Roster.h>
#include <Screen.h> #include <Screen.h>
@@ -86,6 +87,9 @@ All rights reserved.
#include "Words.h" #include "Words.h"
#define TR_CONTEXT "Mail"
using namespace BPrivate; using namespace BPrivate;
@@ -195,12 +199,11 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
// File Menu // File Menu
menu = new BMenu(MDR_DIALECT_CHOICE ("File","F) ファイル")); menu = new BMenu(TR("File"));
msg = new BMessage(M_NEW); msg = new BMessage(M_NEW);
msg->AddInt32("type", M_NEW); msg->AddInt32("type", M_NEW);
menu->AddItem(item = new BMenuItem(MDR_DIALECT_CHOICE ( menu->AddItem(item = new BMenuItem(TR("New Mail Message"), msg, 'N'));
"New Mail Message", "N) 新規メッセージ作成"), msg, 'N'));
item->SetTarget(be_app); item->SetTarget(be_app);
// Cheap hack - only show the drafts menu when composing messages. Insert // Cheap hack - only show the drafts menu when composing messages. Insert
@@ -216,7 +219,7 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
if (!fIncoming) { if (!fIncoming) {
QueryMenu *queryMenu; QueryMenu *queryMenu;
queryMenu = new QueryMenu(MDR_DIALECT_CHOICE ("Open Draft", "O) ドラフトを開く"), false); queryMenu = new QueryMenu(TR("Open Draft"), false);
queryMenu->SetTargetForItems(be_app); queryMenu->SetTargetForItems(be_app);
queryMenu->SetPredicate("MAIL:draft==1"); queryMenu->SetPredicate("MAIL:draft==1");
@@ -224,135 +227,132 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
} }
if (!fIncoming || resending) { if (!fIncoming || resending) {
menu->AddItem(fSendLater = new BMenuItem( menu->AddItem(fSendLater = new BMenuItem(TR("Save as Draft"),
MDR_DIALECT_CHOICE ("Save as Draft", "S)ドラフトとして保存"),
new BMessage(M_SAVE_AS_DRAFT), 'S')); new BMessage(M_SAVE_AS_DRAFT), 'S'));
} }
if (!resending && fIncoming) { if (!resending && fIncoming) {
menu->AddSeparatorItem(); menu->AddSeparatorItem();
subMenu = new BMenu(MDR_DIALECT_CHOICE ("Close and ","C) 閉じる")); subMenu = new BMenu(TR("Close and "));
if (file.GetAttrInfo(B_MAIL_ATTR_STATUS, &info) == B_NO_ERROR) if (file.GetAttrInfo(B_MAIL_ATTR_STATUS, &info) == B_NO_ERROR)
file.ReadAttr(B_MAIL_ATTR_STATUS, B_STRING_TYPE, 0, str, info.size); file.ReadAttr(B_MAIL_ATTR_STATUS, B_STRING_TYPE, 0, str, info.size);
else else
str[0] = 0; str[0] = 0;
if (!strcmp(str, "New")) { if (!strcmp(str, "New")) {
subMenu->AddItem(item = new BMenuItem( subMenu->AddItem(item = new BMenuItem(TR("Leave as New"),
MDR_DIALECT_CHOICE ("Leave as New", "N) 新規<New>のままにする"),
new BMessage(M_CLOSE_SAME), 'W', B_SHIFT_KEY)); new BMessage(M_CLOSE_SAME), 'W', B_SHIFT_KEY));
#if 0 #if 0
subMenu->AddItem(item = new BMenuItem( subMenu->AddItem(item = new BMenuItem(TR("Set to Read"),
MDR_DIALECT_CHOICE ("Set to Read", "R) 開封済<Read>に設定"),
new BMessage(M_CLOSE_READ), 'W')); new BMessage(M_CLOSE_READ), 'W'));
#endif #endif
message = M_CLOSE_READ; message = M_CLOSE_READ;
} else { } else {
if (strlen(str)) if (strlen(str))
sprintf(status, MDR_DIALECT_CHOICE ("Leave as '%s'","W) 属性を<%s>にする"), str); sprintf(status, TR("Leave as '%s'"), str);
else else
sprintf(status, MDR_DIALECT_CHOICE ("Leave same","W) 属性はそのまま")); sprintf(status, TR("Leave same"));
subMenu->AddItem(item = new BMenuItem(status, subMenu->AddItem(item = new BMenuItem(status,
new BMessage(M_CLOSE_SAME), 'W')); new BMessage(M_CLOSE_SAME), 'W'));
message = M_CLOSE_SAME; message = M_CLOSE_SAME;
AddShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY, new BMessage(M_CLOSE_SAME)); AddShortcut('W', B_COMMAND_KEY | B_SHIFT_KEY, new BMessage(M_CLOSE_SAME));
} }
subMenu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE("Move to Trash", subMenu->AddItem(new BMenuItem(TR("Move to Trash"),
"T) 削除"), new BMessage(M_DELETE), 'T', B_CONTROL_KEY)); new BMessage(M_DELETE), 'T', B_CONTROL_KEY));
AddShortcut('T', B_SHIFT_KEY | B_COMMAND_KEY, new BMessage(M_DELETE_NEXT)); AddShortcut('T', B_SHIFT_KEY|B_COMMAND_KEY,
new BMessage(M_DELETE_NEXT));
subMenu->AddSeparatorItem(); subMenu->AddSeparatorItem();
subMenu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE("Set to Saved", subMenu->AddItem(new BMenuItem(TR("Set to Saved"),
"S) 属性を<Saved>に設定"), new BMessage(M_CLOSE_SAVED), 'W', B_CONTROL_KEY)); new BMessage(M_CLOSE_SAVED), 'W', B_CONTROL_KEY));
if (add_query_menu_items(subMenu, INDEX_STATUS, M_STATUS, if (add_query_menu_items(subMenu, INDEX_STATUS, M_STATUS,
MDR_DIALECT_CHOICE("Set to %s", "属性を<%s>に設定")) > 0) TR("Set to %s")) > 0)
subMenu->AddSeparatorItem(); subMenu->AddSeparatorItem();
subMenu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE("Set to", "X) 他の属性に変更") subMenu->AddItem(new BMenuItem(TR("Set to" B_UTF8_ELLIPSIS),
B_UTF8_ELLIPSIS, new BMessage(M_CLOSE_CUSTOM))); new BMessage(M_CLOSE_CUSTOM)));
#if 0 #if 0
subMenu->AddItem(new BMenuItem(new TMenu( subMenu->AddItem(new BMenuItem(new TMenu(
MDR_DIALECT_CHOICE ("Set to", "X) 他の属性に変更")B_UTF8_ELLIPSIS, TR("Set to" B_UTF8_ELLIPSIS), INDEX_STATUS, M_STATUS, false, false),
INDEX_STATUS, M_STATUS, false, false), new BMessage(M_CLOSE_CUSTOM))); new BMessage(M_CLOSE_CUSTOM)));
#endif #endif
menu->AddItem(subMenu); menu->AddItem(subMenu);
} else { } else {
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem( menu->AddItem(new BMenuItem(TR("Close"),
MDR_DIALECT_CHOICE ("Close", "W) 閉じる"),
new BMessage(B_CLOSE_REQUESTED), 'W')); new BMessage(B_CLOSE_REQUESTED), 'W'));
} }
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fPrint = new BMenuItem( menu->AddItem(fPrint = new BMenuItem(TR("Page Setup" B_UTF8_ELLIPSIS),
MDR_DIALECT_CHOICE ("Page Setup", "G) ページ設定") B_UTF8_ELLIPSIS,
new BMessage(M_PRINT_SETUP))); new BMessage(M_PRINT_SETUP)));
menu->AddItem(fPrint = new BMenuItem( menu->AddItem(fPrint = new BMenuItem(TR("Print" B_UTF8_ELLIPSIS),
MDR_DIALECT_CHOICE ("Print", "P) 印刷") B_UTF8_ELLIPSIS,
new BMessage(M_PRINT), 'P')); new BMessage(M_PRINT), 'P'));
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
MDR_DIALECT_CHOICE ("About Mail", "A) Mailについて") B_UTF8_ELLIPSIS, TR("About Mail" B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED))); new BMessage(B_ABOUT_REQUESTED)));
item->SetTarget(be_app); item->SetTarget(be_app);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(TR("Quit"),
MDR_DIALECT_CHOICE ("Quit", "Q) 終了"),
new BMessage(B_QUIT_REQUESTED), 'Q')); new BMessage(B_QUIT_REQUESTED), 'Q'));
item->SetTarget(be_app); item->SetTarget(be_app);
// Edit Menu // Edit Menu
menu = new BMenu(MDR_DIALECT_CHOICE ("Edit","E) 編集")); menu = new BMenu(TR("Edit"));
menu->AddItem(fUndo = new BMenuItem(MDR_DIALECT_CHOICE ("Undo","Z) 元に戻す"), new BMessage(B_UNDO), 'Z', 0)); menu->AddItem(fUndo = new BMenuItem(TR("Undo"), new BMessage(B_UNDO),
'Z', 0));
fUndo->SetTarget(NULL, this); fUndo->SetTarget(NULL, this);
menu->AddItem(fRedo = new BMenuItem(MDR_DIALECT_CHOICE ("Redo","Z) やり直し"), new BMessage(M_REDO), 'Z', B_SHIFT_KEY)); menu->AddItem(fRedo = new BMenuItem(TR("Redo"), new BMessage(M_REDO),
'Z', B_SHIFT_KEY));
fRedo->SetTarget(NULL, this); fRedo->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fCut = new BMenuItem(MDR_DIALECT_CHOICE ("Cut","X) 切り取り"), new BMessage(B_CUT), 'X')); menu->AddItem(fCut = new BMenuItem(TR("Cut"), new BMessage(B_CUT), 'X'));
fCut->SetTarget(NULL, this); fCut->SetTarget(NULL, this);
menu->AddItem(fCopy = new BMenuItem(MDR_DIALECT_CHOICE ("Copy","C) コピー"), new BMessage(B_COPY), 'C')); menu->AddItem(fCopy = new BMenuItem(TR("Copy"), new BMessage(B_COPY), 'C'));
fCopy->SetTarget(NULL, this); fCopy->SetTarget(NULL, this);
menu->AddItem(fPaste = new BMenuItem(MDR_DIALECT_CHOICE ("Paste","V) 貼り付け"), new BMessage(B_PASTE), 'V')); menu->AddItem(fPaste = new BMenuItem(TR("Paste"), new BMessage(B_PASTE),
'V'));
fPaste->SetTarget(NULL, this); fPaste->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem(MDR_DIALECT_CHOICE ("Select All", "A) 全文選択"), new BMessage(M_SELECT), 'A')); menu->AddItem(item = new BMenuItem(TR("Select All"), new BMessage(M_SELECT),
'A'));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
item->SetTarget(NULL, this); item->SetTarget(NULL, this);
menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Find", "F) 検索") B_UTF8_ELLIPSIS, new BMessage(M_FIND), 'F')); menu->AddItem(new BMenuItem(TR("Find" B_UTF8_ELLIPSIS),
menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Find Again", "G) 次を検索"), new BMessage(M_FIND_AGAIN), 'G')); new BMessage(M_FIND), 'F'));
menu->AddItem(new BMenuItem(TR("Find Again"), new BMessage(M_FIND_AGAIN),
'G'));
if (!fIncoming) { if (!fIncoming) {
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fQuote =new BMenuItem( menu->AddItem(fQuote =new BMenuItem(TR("Quote"),
MDR_DIALECT_CHOICE ("Quote","Q) 引用符をつける"),
new BMessage(M_QUOTE), B_RIGHT_ARROW)); new BMessage(M_QUOTE), B_RIGHT_ARROW));
menu->AddItem(fRemoveQuote = new BMenuItem( menu->AddItem(fRemoveQuote = new BMenuItem(TR("Remove Quote"),
MDR_DIALECT_CHOICE ("Remove Quote","R) 引用符を削除"),
new BMessage(M_REMOVE_QUOTE), B_LEFT_ARROW)); new BMessage(M_REMOVE_QUOTE), B_LEFT_ARROW));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fSpelling = new BMenuItem( fSpelling = new BMenuItem(TR("Check Spelling"),
MDR_DIALECT_CHOICE ("Check Spelling","H) スペルチェック"), new BMessage(M_CHECK_SPELLING), ';');
new BMessage( M_CHECK_SPELLING ), ';' );
menu->AddItem(fSpelling); menu->AddItem(fSpelling);
if (fApp->StartWithSpellCheckOn()) if (fApp->StartWithSpellCheckOn())
PostMessage (M_CHECK_SPELLING); PostMessage (M_CHECK_SPELLING);
} }
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
MDR_DIALECT_CHOICE ("Preferences","P) Mailの設定") B_UTF8_ELLIPSIS, TR("Preferences" B_UTF8_ELLIPSIS),
new BMessage(M_PREFS),',')); new BMessage(M_PREFS),','));
item->SetTarget(be_app); item->SetTarget(be_app);
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
MDR_DIALECT_CHOICE ("Accounts","Accounts") B_UTF8_ELLIPSIS, TR("Accounts" B_UTF8_ELLIPSIS),
new BMessage(M_ACCOUNTS),'-')); new BMessage(M_ACCOUNTS),'-'));
item->SetTarget(be_app); item->SetTarget(be_app);
@@ -360,41 +360,50 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
if (!resending && fIncoming) { if (!resending && fIncoming) {
menu = new BMenu("View"); menu = new BMenu("View");
menu->AddItem(fHeader = new BMenuItem(MDR_DIALECT_CHOICE ("Show Header","H) ヘッダーを表示"), new BMessage(M_HEADER), 'H')); menu->AddItem(fHeader = new BMenuItem(TR("Show Header"),
menu->AddItem(fRaw = new BMenuItem(MDR_DIALECT_CHOICE ("Show Raw Message"," メッセージを生で表示"), new BMessage(M_RAW))); new BMessage(M_HEADER), 'H'));
menu->AddItem(fRaw = new BMenuItem(TR("Show Raw Message"),
new BMessage(M_RAW)));
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
} }
// Message Menu // Message Menu
menu = new BMenu(MDR_DIALECT_CHOICE ("Message", "M) メッセージ")); menu = new BMenu(TR("Message"));
if (!resending && fIncoming) { if (!resending && fIncoming) {
BMenuItem *menuItem; BMenuItem *menuItem;
menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply","R) 返信"), new BMessage(M_REPLY),'R')); menu->AddItem(new BMenuItem(TR("Reply"), new BMessage(M_REPLY),'R'));
menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply to Sender","S) 送信者に返信"), new BMessage(M_REPLY_TO_SENDER),'R',B_OPTION_KEY)); menu->AddItem(new BMenuItem(TR("Reply to Sender"),
menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply to All","P) 全員に返信"), new BMessage(M_REPLY_ALL), 'R', B_SHIFT_KEY)); new BMessage(M_REPLY_TO_SENDER),'R',B_OPTION_KEY));
menu->AddItem(new BMenuItem(TR("Reply to All"),
new BMessage(M_REPLY_ALL), 'R', B_SHIFT_KEY));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Forward","J) 転送"), new BMessage(M_FORWARD), 'J')); menu->AddItem(new BMenuItem(TR("Forward"), new BMessage(M_FORWARD),
menu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Forward without Attachments","The opposite: F) 添付ファイルを含めて転送"), new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS))); 'J'));
menu->AddItem(menuItem = new BMenuItem(MDR_DIALECT_CHOICE ("Resend"," 再送信"), new BMessage(M_RESEND))); menu->AddItem(new BMenuItem(TR("Forward without Attachments"),
menu->AddItem(menuItem = new BMenuItem(MDR_DIALECT_CHOICE ("Copy to New","D) 新規メッセージへコピー"), new BMessage(M_COPY_TO_NEW), 'D')); new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS)));
menu->AddItem(menuItem = new BMenuItem(TR("Resend"),
new BMessage(M_RESEND)));
menu->AddItem(menuItem = new BMenuItem(TR("Copy to New"),
new BMessage(M_COPY_TO_NEW), 'D'));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fDeleteNext = new BMenuItem(MDR_DIALECT_CHOICE ("Move to Trash","T) 削除"), new BMessage(M_DELETE_NEXT), 'T'); fDeleteNext = new BMenuItem(TR("Move to Trash"),
new BMessage(M_DELETE_NEXT), 'T');
menu->AddItem(fDeleteNext); menu->AddItem(fDeleteNext);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fPrevMsg = new BMenuItem(MDR_DIALECT_CHOICE ("Previous Message","B) 前のメッセージ"), new BMessage(M_PREVMSG), fPrevMsg = new BMenuItem(TR("Previous Message"),
B_UP_ARROW); new BMessage(M_PREVMSG), B_UP_ARROW);
menu->AddItem(fPrevMsg); menu->AddItem(fPrevMsg);
fNextMsg = new BMenuItem(MDR_DIALECT_CHOICE ("Next Message","N) 次のメッセージ"), new BMessage(M_NEXTMSG), fNextMsg = new BMenuItem(TR("Next Message"), new BMessage(M_NEXTMSG),
B_DOWN_ARROW); B_DOWN_ARROW);
menu->AddItem(fNextMsg); menu->AddItem(fNextMsg);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fSaveAddrMenu = subMenu = new BMenu(MDR_DIALECT_CHOICE ("Save Address", " アドレスを保存")); fSaveAddrMenu = subMenu = new BMenu(TR("Save Address"));
// create the list of addresses // create the list of addresses
@@ -449,30 +458,31 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
} }
} else { } else {
menu->AddItem(fSendNow = new BMenuItem( menu->AddItem(fSendNow = new BMenuItem(TR("Send Message"),
MDR_DIALECT_CHOICE ("Send Message", "M) メッセージを送信"),
new BMessage(M_SEND_NOW), 'M')); new BMessage(M_SEND_NOW), 'M'));
if (!fIncoming) { if (!fIncoming) {
menu->AddSeparatorItem(); menu->AddSeparatorItem();
fSignature = new TMenu( fSignature = new TMenu(TR("Add Signature"), INDEX_SIGNATURE,
MDR_DIALECT_CHOICE ("Add Signature", "D) 署名を追加"), M_SIGNATURE);
INDEX_SIGNATURE, M_SIGNATURE);
menu->AddItem(new BMenuItem(fSignature)); menu->AddItem(new BMenuItem(fSignature));
menu->AddItem(item = new BMenuItem( menu->AddItem(item = new BMenuItem(
MDR_DIALECT_CHOICE ("Edit Signatures","S) 署名の編集") B_UTF8_ELLIPSIS, TR("Edit Signatures" B_UTF8_ELLIPSIS),
new BMessage(M_EDIT_SIGNATURE))); new BMessage(M_EDIT_SIGNATURE)));
item->SetTarget(be_app); item->SetTarget(be_app);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fAdd = new BMenuItem(MDR_DIALECT_CHOICE ("Add Enclosure","E) 追加")B_UTF8_ELLIPSIS, new BMessage(M_ADD), 'E')); menu->AddItem(fAdd = new BMenuItem(TR(
menu->AddItem(fRemove = new BMenuItem(MDR_DIALECT_CHOICE ("Remove Enclosure","T) 削除"), new BMessage(M_REMOVE), 'T')); "Add Enclosure" B_UTF8_ELLIPSIS),
new BMessage(M_ADD), 'E'));
menu->AddItem(fRemove = new BMenuItem(TR("Remove Enclosure"),
new BMessage(M_REMOVE), 'T'));
} }
fMenuBar->AddItem(menu); fMenuBar->AddItem(menu);
} }
// Queries Menu // Queries Menu
fQueryMenu = new BMenu(MDR_DIALECT_CHOICE("Queries","???")); fQueryMenu = new BMenu(TR("Queries"));
fMenuBar->AddItem(fQueryMenu); fMenuBar->AddItem(fQueryMenu);
_RebuildQueryMenu(true); _RebuildQueryMenu(true);
@@ -527,8 +537,8 @@ TMailWindow::TMailWindow(BRect rect, const char* title, TMailApp* app,
BString signature = fApp->Signature(); BString signature = fApp->Signature();
if (!fIncoming && strcmp(signature.String(), SIG_NONE) != 0) { if (!fIncoming && strcmp(signature.String(), TR("None")) != 0) {
if (strcmp(signature.String(), SIG_RANDOM) == 0) if (strcmp(signature.String(), TR("Random")) == 0)
PostMessage(M_RANDOM_SIG); PostMessage(M_RANDOM_SIG);
else { else {
// Create a query to find this signature // Create a query to find this signature
@@ -585,50 +595,41 @@ TMailWindow::BuildButtonBar()
bbar = new ButtonBar(BRect(0, 0, 100, 100), "ButtonBar", 2, 3, 0, 1, 10, bbar = new ButtonBar(BRect(0, 0, 100, 100), "ButtonBar", 2, 3, 0, 1, 10,
2); 2);
bbar->AddButton(MDR_DIALECT_CHOICE ("New","新規"), 28, new BMessage(M_NEW)); bbar->AddButton(TR("New"), 28, new BMessage(M_NEW));
bbar->AddDivider(5); bbar->AddDivider(5);
fButtonBar = bbar; fButtonBar = bbar;
if (fResending) { if (fResending) {
fSendButton = bbar->AddButton(MDR_DIALECT_CHOICE ("Send","送信"), 8, fSendButton = bbar->AddButton(TR("Send"), 8, new BMessage(M_SEND_NOW));
new BMessage(M_SEND_NOW));
bbar->AddDivider(5); bbar->AddDivider(5);
} else if (!fIncoming) { } else if (!fIncoming) {
fSendButton = bbar->AddButton(MDR_DIALECT_CHOICE ("Send","送信"), 8, fSendButton = bbar->AddButton(TR("Send"), 8, new BMessage(M_SEND_NOW));
new BMessage(M_SEND_NOW));
fSendButton->SetEnabled(false); fSendButton->SetEnabled(false);
fSigButton = bbar->AddButton(MDR_DIALECT_CHOICE ("Signature","署名"), 4, fSigButton = bbar->AddButton(TR("Signature"), 4,
new BMessage(M_SIG_MENU)); new BMessage(M_SIG_MENU));
fSigButton->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); fSigButton->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
fSaveButton = bbar->AddButton(MDR_DIALECT_CHOICE ("Save","保存"), 44, fSaveButton = bbar->AddButton(TR("Save"), 44,
new BMessage(M_SAVE_AS_DRAFT)); new BMessage(M_SAVE_AS_DRAFT));
fSaveButton->SetEnabled(false); fSaveButton->SetEnabled(false);
fPrintButton = bbar->AddButton(MDR_DIALECT_CHOICE ("Print","印刷"), 16, fPrintButton = bbar->AddButton(TR("Print"), 16, new BMessage(M_PRINT));
new BMessage(M_PRINT));
fPrintButton->SetEnabled(false); fPrintButton->SetEnabled(false);
bbar->AddButton(MDR_DIALECT_CHOICE ("Trash","削除"), 0, bbar->AddButton(TR("Trash"), 0, new BMessage(M_DELETE));
new BMessage(M_DELETE));
bbar->AddDivider(5); bbar->AddDivider(5);
} else { } else {
BmapButton *button = bbar->AddButton(MDR_DIALECT_CHOICE ("Reply","返信"), BmapButton *button = bbar->AddButton(TR("Reply"), 12,
12, new BMessage(M_REPLY)); new BMessage(M_REPLY));
button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
button = bbar->AddButton(MDR_DIALECT_CHOICE ("Forward","転送"), 40, button = bbar->AddButton(TR("Forward"), 40, new BMessage(M_FORWARD));
new BMessage(M_FORWARD));
button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
fPrintButton = bbar->AddButton(MDR_DIALECT_CHOICE ("Print","印刷"), 16, fPrintButton = bbar->AddButton(TR("Print"), 16, new BMessage(M_PRINT));
new BMessage(M_PRINT)); bbar->AddButton(TR("Trash"), 0, new BMessage(M_DELETE_NEXT));
bbar->AddButton(MDR_DIALECT_CHOICE ("Trash","削除"), 0,
new BMessage(M_DELETE_NEXT));
if (fApp->ShowSpamGUI()) { if (fApp->ShowSpamGUI()) {
button = bbar->AddButton("Spam", 48, new BMessage(M_SPAM_BUTTON)); button = bbar->AddButton("Spam", 48, new BMessage(M_SPAM_BUTTON));
button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON); button->InvokeOnButton(B_SECONDARY_MOUSE_BUTTON);
} }
bbar->AddDivider(5); bbar->AddDivider(5);
fNextButton = bbar->AddButton(MDR_DIALECT_CHOICE ("Next","次へ"), 24, fNextButton = bbar->AddButton(TR("Next"), 24, new BMessage(M_NEXTMSG));
new BMessage(M_NEXTMSG)); bbar->AddButton(TR("Previous"), 20, new BMessage(M_PREVMSG));
bbar->AddButton(MDR_DIALECT_CHOICE ("Previous","前へ"), 20,
new BMessage(M_PREVMSG));
if (!fAutoMarkRead) { if (!fAutoMarkRead) {
_AddReadButton(); _AddReadButton();
} }
@@ -1036,9 +1037,11 @@ TMailWindow::MessageReceived(BMessage *msg)
if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK
&& buttons == B_SECONDARY_MOUSE_BUTTON) { && buttons == B_SECONDARY_MOUSE_BUTTON) {
BPopUpMenu menu("Reply To", false, false); BPopUpMenu menu("Reply To", false, false);
menu.AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply","R) 返信"),new BMessage(M_REPLY))); menu.AddItem(new BMenuItem(TR("Reply"),new BMessage(M_REPLY)));
menu.AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply to Sender","S) 送信者に返信"),new BMessage(M_REPLY_TO_SENDER))); menu.AddItem(new BMenuItem(TR("Reply to Sender"),
menu.AddItem(new BMenuItem(MDR_DIALECT_CHOICE ("Reply to All","P) 全員に返信"),new BMessage(M_REPLY_ALL))); new BMessage(M_REPLY_TO_SENDER)));
menu.AddItem(new BMenuItem(TR("Reply to All"),
new BMessage(M_REPLY_ALL)));
BPoint where; BPoint where;
msg->FindPoint("where", &where); msg->FindPoint("where", &where);
@@ -1059,10 +1062,9 @@ TMailWindow::MessageReceived(BMessage *msg)
if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK if (msg->FindInt32("buttons", (int32 *)&buttons) == B_OK
&& buttons == B_SECONDARY_MOUSE_BUTTON) { && buttons == B_SECONDARY_MOUSE_BUTTON) {
BPopUpMenu menu("Forward", false, false); BPopUpMenu menu("Forward", false, false);
menu.AddItem(new BMenuItem(MDR_DIALECT_CHOICE("Forward", "J) 転送"), menu.AddItem(new BMenuItem(TR("Forward"),
new BMessage(M_FORWARD))); new BMessage(M_FORWARD)));
menu.AddItem(new BMenuItem(MDR_DIALECT_CHOICE("Forward without Attachments", menu.AddItem(new BMenuItem(TR("Forward without Attachments"),
"The opposite: F) 添付ファイルを含む転送"),
new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS))); new BMessage(M_FORWARD_WITHOUT_ATTACHMENTS)));
BPoint where; BPoint where;
@@ -1120,9 +1122,8 @@ TMailWindow::MessageReceived(BMessage *msg)
tracker.SendMessage(&msg); tracker.SendMessage(&msg);
} else { } else {
(new BAlert("", (new BAlert("",
MDR_DIALECT_CHOICE ( "Need tracker to move items to trash", TR("Need tracker to move items to trash"),
"削除するにはTrackerが必要です。"), TR("sorry")))->Go();
MDR_DIALECT_CHOICE ("sorry","削除できませんでした。")))->Go();
} }
} }
} else { } else {
@@ -1277,12 +1278,13 @@ TMailWindow::MessageReceived(BMessage *msg)
else else
{ {
sprintf(arg, "META:email %s", str); sprintf(arg, "META:email %s", str);
status_t result = be_roster->Launch("application/x-person", 1, &arg); status_t result = be_roster->Launch("application/x-person",
1, &arg);
if (result != B_NO_ERROR) if (result != B_NO_ERROR)
(new BAlert("", MDR_DIALECT_CHOICE ( (new BAlert("", TR(
"Sorry, could not find an application that supports the 'Person' data type.", "Sorry, could not find an application that supports"
"Peopleデータ形式をサポートするアプリケーションが見つかりませんでした。"), " the 'Person' data type."), TR("OK")))->Go();
MDR_DIALECT_CHOICE ("OK","了解")))->Go();
} }
free(arg); free(arg);
} }
@@ -1494,11 +1496,9 @@ TMailWindow::MessageReceived(BMessage *msg)
{ {
beep(); beep();
(new BAlert("", (new BAlert("",
MDR_DIALECT_CHOICE ( TR("The spell check feature requires the optional "
"The spell check feature requires the optional \"words\" file on your BeOS CD.", "\"words\" file on your BeOS CD."),
"スペルチェク機能はBeOS CDの optional \"words\" ファイルが必要です"), TR("OK"), NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
MDR_DIALECT_CHOICE ("OK","了解"),
NULL, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_STOP_ALERT))->Go(); B_STOP_ALERT))->Go();
} }
else else
@@ -1608,14 +1608,9 @@ TMailWindow::QuitRequested()
{ {
if (fResending) { if (fResending) {
BAlert *alert = new BAlert("", BAlert *alert = new BAlert("",
MDR_DIALECT_CHOICE ( TR("Do you wish to send this message before closing?"),
"Do you wish to send this message before closing?", TR("Discard"), TR("Cancel"), TR("Send"),
"閉じる前に送信しますか?"), B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
MDR_DIALECT_CHOICE ("Discard","無視"),
MDR_DIALECT_CHOICE ("Cancel","中止"),
MDR_DIALECT_CHOICE ("Send","送信"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT);
alert->SetShortcut(0,'d'); alert->SetShortcut(0,'d');
alert->SetShortcut(1,B_ESCAPE); alert->SetShortcut(1,B_ESCAPE);
result = alert->Go(); result = alert->Go();
@@ -1631,14 +1626,10 @@ TMailWindow::QuitRequested()
} }
} else { } else {
BAlert *alert = new BAlert("", BAlert *alert = new BAlert("",
MDR_DIALECT_CHOICE ( TR("Do you wish to save this message as a draft before closing?"
"Do you wish to save this message as a draft before closing?", ),
"閉じる前に保存しますか?"), TR("Don't Save"), TR("Cancel"), TR("Save"),
MDR_DIALECT_CHOICE ("Don't Save","保存しない"), B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WARNING_ALERT);
MDR_DIALECT_CHOICE ("Cancel","中止"),
MDR_DIALECT_CHOICE ("Save","保存"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT);
alert->SetShortcut(0,'d'); alert->SetShortcut(0,'d');
alert->SetShortcut(1,B_ESCAPE); alert->SetShortcut(1,B_ESCAPE);
result = alert->Go(); result = alert->Go();
@@ -2187,9 +2178,8 @@ TMailWindow::Send(bool now)
status_t status = SaveAsDraft(); status_t status = SaveAsDraft();
if (status != B_OK) { if (status != B_OK) {
beep(); beep();
(new BAlert("", (new BAlert("", TR("E-mail draft could not be saved!"),
MDR_DIALECT_CHOICE ("E-mail draft could not be saved!","ドラフトは保存できませんでした。"), TR("OK")))->Go();
MDR_DIALECT_CHOICE ("OK","了解")))->Go();
} }
return status; return status;
} }
@@ -2267,24 +2257,16 @@ TMailWindow::Send(bool now)
if (count > 0) { if (count > 0) {
int32 userAnswer; int32 userAnswer;
BString messageString; BString messageString;
MDR_DIALECT_CHOICE ( messageString << TR("Your main text contains ") << count <<
messageString << "Your main text contains " << count << TR(" unencodable characters. Perhaps a different "
" unencodable characters. Perhaps a different character " "character set would work better? Hit Send to send it "
"set would work better? Hit Send to send it anyway " "anyway "
"(a substitute character will be used in place of " "(a substitute character will be used in place of "
"the unencodable ones), or choose Cancel to go back " "the unencodable ones), or choose Cancel to go back "
"and try fixing it up." "and try fixing it up.");
,
messageString << "送信メールの本文には " << count <<
" 個のエンコードできない文字があります。"
"違う文字セットを使うほうがよい可能性があります。"
"このまま送信の場合は「送信」ボタンを押してください。"
"その場合、代用文字がUnicode化可能な文字に代わって使われます。"
"文字セットを変更する場合は「中止」ボタンを押して下さい。"
);
userAnswer = (new BAlert("Question", messageString.String(), userAnswer = (new BAlert("Question", messageString.String(),
MDR_DIALECT_CHOICE ("Send","送信"), TR("Send"),
MDR_DIALECT_CHOICE ("Cancel","中止"), TR("Cancel"),
NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING, NULL, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT))->Go(); B_WARNING_ALERT))->Go();
if (userAnswer == 1) { if (userAnswer == 1) {
@@ -2416,12 +2398,9 @@ TMailWindow::Send(bool now)
fSent = true; fSent = true;
int32 start = (new BAlert("no daemon", int32 start = (new BAlert("no daemon",
MDR_DIALECT_CHOICE ("The mail_daemon is not running. " TR("The mail_daemon is not running. The message is queued and "
"The message is queued and will be sent when the mail_daemon is started.", "will be sent when the mail_daemon is started."),
"mail_daemon が開始されていません " TR("Start Now"), TR("Ok")))->Go();
"このメッセージは処理待ちとなり、mail_daemon 開始後に処理されます"),
MDR_DIALECT_CHOICE ("Start Now","ただちに開始する"),
MDR_DIALECT_CHOICE ("Ok","了解")))->Go();
if (start == 0) { if (start == 0) {
result = be_roster->Launch("application/x-vnd.Be-POST"); result = be_roster->Launch("application/x-vnd.Be-POST");
@@ -2661,7 +2640,7 @@ ErrorExit:
"Possibly useful error code: %s (%ld).", "Possibly useful error code: %s (%ld).",
filePath.Path(), CommandWord, strerror (errorCode), errorCode); filePath.Path(), CommandWord, strerror (errorCode), errorCode);
(new BAlert("", errorString, (new BAlert("", errorString,
MDR_DIALECT_CHOICE("OK","了解")))->Go(); TR("OK")))->Go();
return errorCode; return errorCode;
} }
@@ -2956,7 +2935,7 @@ TMailWindow::_RebuildQueryMenu(bool firstTime)
delete item; delete item;
} }
fQueryMenu->AddItem(new BMenuItem(MDR_DIALECT_CHOICE("Edit Queries" B_UTF8_ELLIPSIS,"???" B_UTF8_ELLIPSIS), fQueryMenu->AddItem(new BMenuItem(TR("Edit Queries" B_UTF8_ELLIPSIS),
new BMessage(M_EDIT_QUERIES), 'E', B_SHIFT_KEY)); new BMessage(M_EDIT_QUERIES), 'E', B_SHIFT_KEY));
bool queryItemsAdded = false; bool queryItemsAdded = false;
@@ -3123,12 +3102,10 @@ TMailWindow::_AddReadButton()
int32 buttonIndex = fButtonBar->IndexOf(fNextButton); int32 buttonIndex = fButtonBar->IndexOf(fNextButton);
if (newMail) if (newMail)
fReadButton = fButtonBar->AddButton( fReadButton = fButtonBar->AddButton(
MDR_DIALECT_CHOICE (" Read ", " Read "), 24, TR(" Read "), 24, new BMessage(M_READ), buttonIndex);
new BMessage(M_READ), buttonIndex);
else else
fReadButton = fButtonBar->AddButton( fReadButton = fButtonBar->AddButton(
MDR_DIALECT_CHOICE ("Unread", "Unread"), 28, TR("Unread"), 28, new BMessage(M_UNREAD), buttonIndex);
new BMessage(M_UNREAD), buttonIndex);
} }
+82 -107
View File
@@ -50,7 +50,6 @@ All rights reserved.
#include <MailSettings.h> #include <MailSettings.h>
#include <mail_encoding.h> #include <mail_encoding.h>
#include <MDRLanguage.h>
#include <String.h> #include <String.h>
#include <CharacterSet.h> #include <CharacterSet.h>
@@ -62,38 +61,20 @@ using namespace BPrivate;
#include "MailSupport.h" #include "MailSupport.h"
#include "MailWindow.h" #include "MailWindow.h"
#include "Messages.h" #include "Messages.h"
#include "Signature.h"
#define TR_CONTEXT "Mail"
#define BUTTON_WIDTH 70 #define BUTTON_WIDTH 70
#define BUTTON_HEIGHT 20 #define BUTTON_HEIGHT 20
#define ITEM_SPACE 6 #define ITEM_SPACE 6
#define FONT_TEXT MDR_DIALECT_CHOICE ("Font:", "フォント:")
#define SIZE_TEXT MDR_DIALECT_CHOICE ("Size:", "サイズ:")
#define LEVEL_TEXT MDR_DIALECT_CHOICE ("User Level:", "ユーザーレベル:")
#define WRAP_TEXT MDR_DIALECT_CHOICE ("Text Wrapping:", "テキスト・ラップ:")
#define ATTACH_ATTRIBUTES_TEXT MDR_DIALECT_CHOICE ("Attach Attributes:", "ファイル属性情報:")
#define QUOTES_TEXT MDR_DIALECT_CHOICE ("Colored Quotes:", "引用部分の着色:")
#define ACCOUNT_TEXT MDR_DIALECT_CHOICE ("Default Account:", "標準アカウント:")
#define REPLYTO_TEXT MDR_DIALECT_CHOICE ("Reply Account:", "返信用アカウント:")
#define REPLYTO_USE_DEFAULT_TEXT MDR_DIALECT_CHOICE ("Use Default Account", "標準アカウントを使う")
#define REPLYTO_FROM_MAIL_TEXT MDR_DIALECT_CHOICE ("Account From Mail", "メールのアカウントを使う")
#define REPLY_PREAMBLE_TEXT MDR_DIALECT_CHOICE ("Reply Preamble:", "返信へ追加:")
#define SIGNATURE_TEXT MDR_DIALECT_CHOICE ("Auto Signature:", "自動署名:")
#define ENCODING_TEXT MDR_DIALECT_CHOICE ("Encoding:", "エンコード形式:")
#define WARN_UNENCODABLE_TEXT MDR_DIALECT_CHOICE ("Warn Unencodable:", "警告: エンコードできません")
#define SPELL_CHECK_START_ON_TEXT MDR_DIALECT_CHOICE ("Initial Spell Check Mode:", "編集時スペルチェック:")
#define AUTO_MARK_READ_TEXT MDR_DIALECT_CHOICE ("Automatically mark mail as read:", "Automatically mark mail as read:")
#define BUTTONBAR_TEXT MDR_DIALECT_CHOICE ("Button Bar:", "ボタンバー:")
#define OK_BUTTON_X1 (PREF_WIDTH - BUTTON_WIDTH - 6) #define OK_BUTTON_X1 (PREF_WIDTH - BUTTON_WIDTH - 6)
#define OK_BUTTON_X2 (OK_BUTTON_X1 + BUTTON_WIDTH) #define OK_BUTTON_X2 (OK_BUTTON_X1 + BUTTON_WIDTH)
#define OK_BUTTON_TEXT MDR_DIALECT_CHOICE ("OK", "設定")
#define CANCEL_BUTTON_TEXT MDR_DIALECT_CHOICE ("Cancel", "中止")
#define REVERT_BUTTON_X1 8 #define REVERT_BUTTON_X1 8
#define REVERT_BUTTON_X2 (REVERT_BUTTON_X1 + BUTTON_WIDTH) #define REVERT_BUTTON_X2 (REVERT_BUTTON_X1 + BUTTON_WIDTH)
#define REVERT_BUTTON_TEXT MDR_DIALECT_CHOICE ("Revert", "復元")
enum P_MESSAGES {P_OK = 128, P_CANCEL, P_REVERT, P_FONT, enum P_MESSAGES {P_OK = 128, P_CANCEL, P_REVERT, P_FONT,
P_SIZE, P_LEVEL, P_WRAP, P_ATTACH_ATTRIBUTES, P_SIZE, P_LEVEL, P_WRAP, P_ATTACH_ATTRIBUTES,
@@ -102,16 +83,8 @@ enum P_MESSAGES {P_OK = 128, P_CANCEL, P_REVERT, P_FONT,
P_ACCOUNT, P_REPLYTO, P_REPLY_PREAMBLE, P_ACCOUNT, P_REPLYTO, P_REPLY_PREAMBLE,
P_COLORED_QUOTES, P_MARK_READ}; P_COLORED_QUOTES, P_MARK_READ};
#define ICON_LABEL_TEXT MDR_DIALECT_CHOICE ("Show Icons & Labels", "アイコンとラベル")
#define ICON_TEXT MDR_DIALECT_CHOICE ("Show Icons Only", "アイコンのみ")
#define HIDE_TEXT MDR_DIALECT_CHOICE ("Hide", "隠す")
extern BPoint prefs_window; extern BPoint prefs_window;
#define ATTRIBUTE_ON_TEXT MDR_DIALECT_CHOICE ("Include BeOS Attributes in Attachments", "BeOSの属性を付ける")
#define ATTRIBUTE_OFF_TEXT MDR_DIALECT_CHOICE ("No BeOS Attributes, just Plain Data", "BeOSの属性を付けない(データのみ)")
//#pragma mark - //#pragma mark -
@@ -140,11 +113,11 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
bool* spellCheckStartOn, bool* autoMarkRead, uint8* buttonBar) bool* spellCheckStartOn, bool* autoMarkRead, uint8* buttonBar)
: :
#if USE_LAYOUT_MANAGEMENT #if USE_LAYOUT_MANAGEMENT
BWindow(rect, MDR_DIALECT_CHOICE ("Mail Preferences", "Mailの設定"), BWindow(rect, TR("Mail Preferences"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE
| B_AUTO_UPDATE_SIZE_LIMITS), | B_AUTO_UPDATE_SIZE_LIMITS),
#else #else
BWindow(rect, MDR_DIALECT_CHOICE ("Mail Preferences", "Mailの設定"), BWindow(rect, TR("Mail Preferences"),
B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE), B_TITLED_WINDOW, B_NOT_RESIZABLE | B_NOT_ZOOMABLE),
#endif #endif
@@ -205,20 +178,19 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
interfaceLayout->AlignLayoutWith(mailLayout, B_HORIZONTAL); interfaceLayout->AlignLayoutWith(mailLayout, B_HORIZONTAL);
BBox* interfaceBox = new BBox(B_FANCY_BORDER, interfaceView); BBox* interfaceBox = new BBox(B_FANCY_BORDER, interfaceView);
interfaceBox->SetLabel(MDR_DIALECT_CHOICE ("User Interface", interfaceBox->SetLabel(TR("User Interface"));
"ユーザーインターフェース"));
BBox* mailBox = new BBox(B_FANCY_BORDER, mailView); BBox* mailBox = new BBox(B_FANCY_BORDER, mailView);
mailBox->SetLabel(MDR_DIALECT_CHOICE ("Mailing", "メール関係")); mailBox->SetLabel(TR("Mailing"));
// revert, ok & cancel // revert, ok & cancel
BButton* okButton = new BButton("ok", OK_BUTTON_TEXT, new BMessage(P_OK)); BButton* okButton = new BButton("ok", TR("OK"), new BMessage(P_OK));
okButton->MakeDefault(true); okButton->MakeDefault(true);
BButton* cancelButton = new BButton("cancel", CANCEL_BUTTON_TEXT, BButton* cancelButton = new BButton("cancel", TR("Cancel"),
new BMessage(P_CANCEL)); new BMessage(P_CANCEL));
fRevert = new BButton("revert", REVERT_BUTTON_TEXT, fRevert = new BButton("revert", TR("Revert"),
new BMessage(P_REVERT)); new BMessage(P_REVERT));
fRevert->SetEnabled(false); fRevert->SetEnabled(false);
@@ -226,45 +198,47 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
int32 layoutRow = 0; int32 layoutRow = 0;
fButtonBarMenu = _BuildButtonBarMenu(*buttonBar); fButtonBarMenu = _BuildButtonBarMenu(*buttonBar);
menu = new BMenuField("bar", BUTTONBAR_TEXT, fButtonBarMenu, NULL); menu = new BMenuField("bar", TR("Button Bar:"), fButtonBarMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fFontMenu = _BuildFontMenu(font); fFontMenu = _BuildFontMenu(font);
menu = new BMenuField("font", FONT_TEXT, fFontMenu, NULL); menu = new BMenuField("font", TR("Font:"), fFontMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fSizeMenu = _BuildSizeMenu(font); fSizeMenu = _BuildSizeMenu(font);
menu = new BMenuField("size", SIZE_TEXT, fSizeMenu, NULL); menu = new BMenuField("size", TR("Size:"), fSizeMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fColoredQuotesMenu = _BuildColoredQuotesMenu(fColoredQuotes); fColoredQuotesMenu = _BuildColoredQuotesMenu(fColoredQuotes);
menu = new BMenuField("cquotes", QUOTES_TEXT, fColoredQuotesMenu, NULL); menu = new BMenuField("cquotes", TR("Colored Quotes:"), fColoredQuotesMenu,
NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fSpellCheckStartOnMenu = _BuildSpellCheckStartOnMenu(fSpellCheckStartOn); fSpellCheckStartOnMenu = _BuildSpellCheckStartOnMenu(fSpellCheckStartOn);
menu = new BMenuField("spellCheckStartOn", SPELL_CHECK_START_ON_TEXT, menu = new BMenuField("spellCheckStartOn", TR("Initial Spell Check Mode:"),
fSpellCheckStartOnMenu, NULL); fSpellCheckStartOnMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
fAutoMarkReadMenu = _BuildAutoMarkReadMenu(fAutoMarkRead); fAutoMarkReadMenu = _BuildAutoMarkReadMenu(fAutoMarkRead);
menu = new BMenuField("autoMarkRead", AUTO_MARK_READ_TEXT, menu = new BMenuField("autoMarkRead",
fAutoMarkReadMenu, NULL); TR("Automatically mark mail as read:"), fAutoMarkReadMenu, NULL);
add_menu_to_layout(menu, interfaceLayout, layoutRow); add_menu_to_layout(menu, interfaceLayout, layoutRow);
// Mail Accounts // Mail Accounts
layoutRow = 0; layoutRow = 0;
fAccountMenu = _BuildAccountMenu(fAccount); fAccountMenu = _BuildAccountMenu(fAccount);
menu = new BMenuField("account", ACCOUNT_TEXT, fAccountMenu, NULL); menu = new BMenuField("account", TR("Default Account:"), fAccountMenu,
NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fReplyToMenu = _BuildReplyToMenu(fReplyTo); fReplyToMenu = _BuildReplyToMenu(fReplyTo);
menu = new BMenuField("replyTo", REPLYTO_TEXT, fReplyToMenu, NULL); menu = new BMenuField("replyTo", TR("Reply Account:"), fReplyToMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
// Mail Contents // Mail Contents
fReplyPreamble = new BTextControl("replytext", REPLY_PREAMBLE_TEXT, fReplyPreamble = new BTextControl("replytext", TR("Reply Preamble:"),
*preamble, new BMessage(P_REPLY_PREAMBLE)); *preamble, new BMessage(P_REPLY_PREAMBLE));
fReplyPreamble->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); fReplyPreamble->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
@@ -279,24 +253,24 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
layoutRow++; layoutRow++;
fSignatureMenu = _BuildSignatureMenu(*sig); fSignatureMenu = _BuildSignatureMenu(*sig);
menu = new BMenuField("sig", SIGNATURE_TEXT, fSignatureMenu, NULL); menu = new BMenuField("sig", TR("Auto Signature:"), fSignatureMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fEncodingMenu = _BuildEncodingMenu(fEncoding); fEncodingMenu = _BuildEncodingMenu(fEncoding);
menu = new BMenuField("enc", ENCODING_TEXT, fEncodingMenu, NULL); menu = new BMenuField("enc", TR("Encoding:"), fEncodingMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fWarnUnencodableMenu = _BuildWarnUnencodableMenu(fWarnUnencodable); fWarnUnencodableMenu = _BuildWarnUnencodableMenu(fWarnUnencodable);
menu = new BMenuField("warnUnencodable", WARN_UNENCODABLE_TEXT, menu = new BMenuField("warnUnencodable", TR("Warn Unencodable:"),
fWarnUnencodableMenu, NULL); fWarnUnencodableMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fWrapMenu = _BuildWrapMenu(*wrap); fWrapMenu = _BuildWrapMenu(*wrap);
menu = new BMenuField("wrap", WRAP_TEXT, fWrapMenu, NULL); menu = new BMenuField("wrap", TR("Text wrapping:"), fWrapMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
fAttachAttributesMenu = _BuildAttachAttributesMenu(*attachAttributes); fAttachAttributesMenu = _BuildAttachAttributesMenu(*attachAttributes);
menu = new BMenuField("attachAttributes", ATTACH_ATTRIBUTES_TEXT, menu = new BMenuField("attachAttributes", TR("Attach Attributes:"),
fAttachAttributesMenu, NULL); fAttachAttributesMenu, NULL);
add_menu_to_layout(menu, mailLayout, layoutRow); add_menu_to_layout(menu, mailLayout, layoutRow);
@@ -328,21 +302,20 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
view->GetFontHeight(&fontHeight); view->GetFontHeight(&fontHeight);
int32 height = (int32)(fontHeight.ascent + fontHeight.descent int32 height = (int32)(fontHeight.ascent + fontHeight.descent
+ fontHeight.leading) + 6; + fontHeight.leading) + 6;
int32 labelWidth = (int32)view->StringWidth(SPELL_CHECK_START_ON_TEXT) int32 labelWidth = (int32)view->StringWidth(TR("Initial Spell Check Mode:"))
+ SEPARATOR_MARGIN; + SEPARATOR_MARGIN;
// group boxes // group boxes
r.Set(8, 4, Bounds().right - 8, 4 + 6 * (height + ITEM_SPACE)); r.Set(8, 4, Bounds().right - 8, 4 + 6 * (height + ITEM_SPACE));
BBox* interfaceBox = new BBox(r , NULL,B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); BBox* interfaceBox = new BBox(r , NULL,B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
interfaceBox->SetLabel(MDR_DIALECT_CHOICE ("User Interface", interfaceBox->SetLabel(TR("User Interface"));
"ユーザーインターフェース"));
view->AddChild(interfaceBox); view->AddChild(interfaceBox);
r.top = r.bottom + 8; r.top = r.bottom + 8;
r.bottom = r.top + 9 * (height + ITEM_SPACE); r.bottom = r.top + 9 * (height + ITEM_SPACE);
BBox* mailBox = new BBox(r,NULL,B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP); BBox* mailBox = new BBox(r,NULL,B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP);
mailBox->SetLabel(MDR_DIALECT_CHOICE ("Mailing", "メール関係")); mailBox->SetLabel(TR("Mailing"));
view->AddChild(mailBox); view->AddChild(mailBox);
// revert, ok & cancel // revert, ok & cancel
@@ -351,17 +324,17 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.bottom = r.top + height; r.bottom = r.top + height;
r.left = OK_BUTTON_X1; r.left = OK_BUTTON_X1;
r.right = OK_BUTTON_X2; r.right = OK_BUTTON_X2;
BButton* button = new BButton(r, "ok", OK_BUTTON_TEXT, new BMessage(P_OK)); BButton* button = new BButton(r, "ok", TR("OK"), new BMessage(P_OK));
button->MakeDefault(true); button->MakeDefault(true);
view->AddChild(button); view->AddChild(button);
r.OffsetBy(-(OK_BUTTON_X2 - OK_BUTTON_X1 + 10), 0); r.OffsetBy(-(OK_BUTTON_X2 - OK_BUTTON_X1 + 10), 0);
button = new BButton(r, "cancel", CANCEL_BUTTON_TEXT, button = new BButton(r, "cancel", TR("Cancel"),
new BMessage(P_CANCEL)); new BMessage(P_CANCEL));
view->AddChild(button); view->AddChild(button);
r.left = REVERT_BUTTON_X1; r.right = REVERT_BUTTON_X2; r.left = REVERT_BUTTON_X1; r.right = REVERT_BUTTON_X2;
fRevert = new BButton(r, "revert", REVERT_BUTTON_TEXT, fRevert = new BButton(r, "revert", TR("Revert"),
new BMessage(P_REVERT)); new BMessage(P_REVERT));
fRevert->SetEnabled(false); fRevert->SetEnabled(false);
view->AddChild(fRevert); view->AddChild(fRevert);
@@ -374,7 +347,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.top = height; r.top = height;
r.bottom = r.top + height - 3; r.bottom = r.top + height - 3;
fButtonBarMenu = _BuildButtonBarMenu(*buttonBar); fButtonBarMenu = _BuildButtonBarMenu(*buttonBar);
menu = new BMenuField(r, "bar", BUTTONBAR_TEXT, fButtonBarMenu, menu = new BMenuField(r, "bar", TR("Button Bar:"), fButtonBarMenu,
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -382,7 +355,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fFontMenu = _BuildFontMenu(font); fFontMenu = _BuildFontMenu(font);
menu = new BMenuField(r, "font", FONT_TEXT, fFontMenu, menu = new BMenuField(r, "font", TR("Font:"), fFontMenu,
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -390,7 +363,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fSizeMenu = _BuildSizeMenu(font); fSizeMenu = _BuildSizeMenu(font);
menu = new BMenuField(r, "size", SIZE_TEXT, fSizeMenu, menu = new BMenuField(r, "size", TR("Size:"), fSizeMenu,
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -398,16 +371,17 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fColoredQuotesMenu = _BuildColoredQuotesMenu(fColoredQuotes); fColoredQuotesMenu = _BuildColoredQuotesMenu(fColoredQuotes);
menu = new BMenuField(r, "cquotes", QUOTES_TEXT, fColoredQuotesMenu, menu = new BMenuField(r, "cquotes", TR("Colored Quotes:"),
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); fColoredQuotesMenu, B_FOLLOW_ALL,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
interfaceBox->AddChild(menu); interfaceBox->AddChild(menu);
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fSpellCheckStartOnMenu = _BuildSpellCheckStartOnMenu(fSpellCheckStartOn); fSpellCheckStartOnMenu = _BuildSpellCheckStartOnMenu(fSpellCheckStartOn);
menu = new BMenuField(r, "spellCheckStartOn", SPELL_CHECK_START_ON_TEXT, menu = new BMenuField(r, "spellCheckStartOn",
fSpellCheckStartOnMenu, B_FOLLOW_ALL, TR("Initial Spell Check Mode:"), fSpellCheckStartOnMenu, B_FOLLOW_ALL,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -415,8 +389,8 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fAutoMarkReadMenu = _BuildAutoMarkReadMenu(fAutoMarkRead); fAutoMarkReadMenu = _BuildAutoMarkReadMenu(fAutoMarkRead);
menu = new BMenuField("autoMarkRead", AUTO_MARK_READ_TEXT, menu = new BMenuField("autoMarkRead",
fAutoMarkReadMenu, NULL); TR("Automatically mark mail as read:"), fAutoMarkReadMenu, NULL);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
interfaceBox->AddChild(menu); interfaceBox->AddChild(menu);
@@ -429,7 +403,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.top = height; r.top = height;
r.bottom = r.top + height - 3; r.bottom = r.top + height - 3;
fAccountMenu = _BuildAccountMenu(fAccount); fAccountMenu = _BuildAccountMenu(fAccount);
menu = new BMenuField(r, "account", ACCOUNT_TEXT, fAccountMenu, menu = new BMenuField(r, "account", TR("Default Account:"), fAccountMenu,
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -437,7 +411,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fReplyToMenu = _BuildReplyToMenu(fReplyTo); fReplyToMenu = _BuildReplyToMenu(fReplyTo);
menu = new BMenuField(r, "replyTo", REPLYTO_TEXT, fReplyToMenu, menu = new BMenuField(r, "replyTo", TR("Reply Account:"), fReplyToMenu,
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -447,7 +421,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
r.right -= 25; r.right -= 25;
fReplyPreamble = new BTextControl(r, "replytext", REPLY_PREAMBLE_TEXT, fReplyPreamble = new BTextControl(r, "replytext", TR("Reply Preamble:"),
*preamble, new BMessage(P_REPLY_PREAMBLE), B_FOLLOW_ALL, *preamble, new BMessage(P_REPLY_PREAMBLE), B_FOLLOW_ALL,
B_WILL_DRAW | B_NAVIGABLE); B_WILL_DRAW | B_NAVIGABLE);
fReplyPreamble->SetDivider(labelWidth); fReplyPreamble->SetDivider(labelWidth);
@@ -467,7 +441,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fSignatureMenu = _BuildSignatureMenu(*sig); fSignatureMenu = _BuildSignatureMenu(*sig);
menu = new BMenuField(r, "sig", SIGNATURE_TEXT, fSignatureMenu, menu = new BMenuField(r, "sig", TR("Auto Signature:"), fSignatureMenu,
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -475,7 +449,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fEncodingMenu = _BuildEncodingMenu(fEncoding); fEncodingMenu = _BuildEncodingMenu(fEncoding);
menu = new BMenuField(r, "enc", ENCODING_TEXT, fEncodingMenu, menu = new BMenuField(r, "enc", TR("Encoding:"), fEncodingMenu,
B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
@@ -483,7 +457,7 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fWarnUnencodableMenu = _BuildWarnUnencodableMenu(fWarnUnencodable); fWarnUnencodableMenu = _BuildWarnUnencodableMenu(fWarnUnencodable);
menu = new BMenuField(r, "warnUnencodable", WARN_UNENCODABLE_TEXT, menu = new BMenuField(r, "warnUnencodable", TR("Warn Unencodable:"),
fWarnUnencodableMenu, B_FOLLOW_ALL, fWarnUnencodableMenu, B_FOLLOW_ALL,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
@@ -492,15 +466,15 @@ TPrefsWindow::TPrefsWindow(BRect rect, BFont* font, int32* level, bool* wrap,
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fWrapMenu = _BuildWrapMenu(*wrap); fWrapMenu = _BuildWrapMenu(*wrap);
menu = new BMenuField(r, "wrap", WRAP_TEXT, fWrapMenu, B_FOLLOW_ALL, menu = new BMenuField(r, "wrap", TR("Text wrapping:"), fWrapMenu,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_FOLLOW_ALL, B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
menu->SetAlignment(B_ALIGN_RIGHT); menu->SetAlignment(B_ALIGN_RIGHT);
mailBox->AddChild(menu); mailBox->AddChild(menu);
r.OffsetBy(0, height + ITEM_SPACE); r.OffsetBy(0, height + ITEM_SPACE);
fAttachAttributesMenu = _BuildAttachAttributesMenu(*attachAttributes); fAttachAttributesMenu = _BuildAttachAttributesMenu(*attachAttributes);
menu = new BMenuField(r, "attachAttributes", ATTACH_ATTRIBUTES_TEXT, menu = new BMenuField(r, "attachAttributes", TR("Attach Attributes:"),
fAttachAttributesMenu, B_FOLLOW_ALL, fAttachAttributesMenu, B_FOLLOW_ALL,
B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP); B_WILL_DRAW | B_NAVIGABLE | B_NAVIGABLE_JUMP);
menu->SetDivider(labelWidth); menu->SetDivider(labelWidth);
@@ -610,7 +584,7 @@ TPrefsWindow::MessageReceived(BMessage* msg)
} }
strcpy(label,fReplyTo == ACCOUNT_USE_DEFAULT strcpy(label,fReplyTo == ACCOUNT_USE_DEFAULT
? REPLYTO_USE_DEFAULT_TEXT : REPLYTO_FROM_MAIL_TEXT); ? TR("Use Default Account") : TR("Account From Mail"));
if ((item = fReplyToMenu->FindItem(label)) != NULL) if ((item = fReplyToMenu->FindItem(label)) != NULL)
item->SetMarked(true); item->SetMarked(true);
@@ -619,7 +593,8 @@ TPrefsWindow::MessageReceived(BMessage* msg)
item->SetMarked(true); item->SetMarked(true);
strcpy(label, fAttachAttributes strcpy(label, fAttachAttributes
? ATTRIBUTE_ON_TEXT : ATTRIBUTE_OFF_TEXT); ? TR("Include BeOS Attributes in Attachments")
: TR("No BeOS Attributes, just Plain Data"));
if ((item = fAttachAttributesMenu->FindItem(label)) != NULL) if ((item = fAttachAttributesMenu->FindItem(label)) != NULL)
item->SetMarked(true); item->SetMarked(true);
@@ -718,15 +693,15 @@ TPrefsWindow::MessageReceived(BMessage* msg)
case P_SIG: case P_SIG:
free(*fNewSignature); free(*fNewSignature);
if (msg->FindString("signature", &signature) == B_NO_ERROR) { if (msg->FindString("signature", &signature) == B_NO_ERROR) {
*fNewSignature = (char *)malloc(strlen(signature) + 1); *fNewSignature = (char*)malloc(strlen(signature) + 1);
strcpy(*fNewSignature, signature); strcpy(*fNewSignature, signature);
} else { } else {
*fNewSignature = (char *)malloc(strlen(SIG_NONE) + 1); *fNewSignature = (char*)malloc(strlen(TR("None")) + 1);
strcpy(*fNewSignature, SIG_NONE); strcpy(*fNewSignature, TR("None"));
} }
break; break;
case P_ENC: case P_ENC:
msg->FindInt32("encoding", (int32 *)fNewEncoding); msg->FindInt32("encoding", (int32*)fNewEncoding);
break; break;
case P_WARN_UNENCODABLE: case P_WARN_UNENCODABLE:
msg->FindBool("warnUnencodable", fNewWarnUnencodable); msg->FindBool("warnUnencodable", fNewWarnUnencodable);
@@ -739,7 +714,7 @@ TPrefsWindow::MessageReceived(BMessage* msg)
be_app->PostMessage(PREFS_CHANGED); be_app->PostMessage(PREFS_CHANGED);
break; break;
case P_BUTTON_BAR: case P_BUTTON_BAR:
msg->FindInt8("bar", (int8 *)fNewButtonBar); msg->FindInt8("bar", (int8*)fNewButtonBar);
be_app->PostMessage(PREFS_CHANGED); be_app->PostMessage(PREFS_CHANGED);
break; break;
@@ -834,15 +809,13 @@ TPrefsWindow::_BuildLevelMenu(int32 level)
menu = new BPopUpMenu(""); menu = new BPopUpMenu("");
msg = new BMessage(P_LEVEL); msg = new BMessage(P_LEVEL);
msg->AddInt32("level", L_BEGINNER); msg->AddInt32("level", L_BEGINNER);
menu->AddItem(item = new BMenuItem(MDR_DIALECT_CHOICE ("Beginner","初心者"), menu->AddItem(item = new BMenuItem(TR("Beginner"), msg));
msg));
if (level == L_BEGINNER) if (level == L_BEGINNER)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_LEVEL); msg = new BMessage(P_LEVEL);
msg->AddInt32("level", L_EXPERT); msg->AddInt32("level", L_EXPERT);
menu->AddItem(item = new BMenuItem(MDR_DIALECT_CHOICE ("Expert","上級者"), menu->AddItem(item = new BMenuItem(TR("Expert"), msg));
msg));
if (level == L_EXPERT) if (level == L_EXPERT)
item->SetMarked(true); item->SetMarked(true);
@@ -888,13 +861,13 @@ TPrefsWindow::_BuildReplyToMenu(int32 account)
BMenuItem* item; BMenuItem* item;
BMessage* msg; BMessage* msg;
menu->AddItem(item = new BMenuItem(REPLYTO_USE_DEFAULT_TEXT, menu->AddItem(item = new BMenuItem(TR("Use Default Account"),
msg = new BMessage(P_REPLYTO))); msg = new BMessage(P_REPLYTO)));
msg->AddInt32("replyTo", ACCOUNT_USE_DEFAULT); msg->AddInt32("replyTo", ACCOUNT_USE_DEFAULT);
if (account == ACCOUNT_USE_DEFAULT) if (account == ACCOUNT_USE_DEFAULT)
item->SetMarked(true); item->SetMarked(true);
menu->AddItem(item = new BMenuItem(REPLYTO_FROM_MAIL_TEXT, menu->AddItem(item = new BMenuItem(TR("Account From Mail"),
msg = new BMessage(P_REPLYTO))); msg = new BMessage(P_REPLYTO)));
msg->AddInt32("replyTo", ACCOUNT_FROM_MAIL); msg->AddInt32("replyTo", ACCOUNT_FROM_MAIL);
if (account == ACCOUNT_FROM_MAIL) if (account == ACCOUNT_FROM_MAIL)
@@ -912,11 +885,11 @@ TPrefsWindow::_BuildReplyPreambleMenu()
"%f - First name", "%f - First name",
"%l - Last name", "%l - Last name",
*/ */
MDR_DIALECT_CHOICE ("%n - Full name", "%n - フルネーム"), TR("%n - Full name"),
MDR_DIALECT_CHOICE ("%e - E-mail address", "%e - E-mailアドレス"), TR("%e - E-mail address"),
MDR_DIALECT_CHOICE ("%d - Date", "%d - 日付"), TR("%d - Date"),
"", "",
MDR_DIALECT_CHOICE ("\\n - Newline", "\\n - 空行"), TR("\\n - Newline"),
NULL NULL
}; };
@@ -950,15 +923,15 @@ TPrefsWindow::_BuildSignatureMenu(char* sig)
BPopUpMenu* menu = new BPopUpMenu(""); BPopUpMenu* menu = new BPopUpMenu("");
msg = new BMessage(P_SIG); msg = new BMessage(P_SIG);
msg->AddString("signature", SIG_NONE); msg->AddString("signature", TR("None"));
menu->AddItem(item = new BMenuItem(SIG_NONE, msg)); menu->AddItem(item = new BMenuItem(TR("None"), msg));
if (!strcmp(sig, SIG_NONE)) if (!strcmp(sig, TR("None")))
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_SIG); msg = new BMessage(P_SIG);
msg->AddString("signature", SIG_RANDOM); msg->AddString("signature", TR("Random"));
menu->AddItem(item = new BMenuItem(SIG_RANDOM, msg)); menu->AddItem(item = new BMenuItem(TR("Random"), msg));
if (!strcmp(sig, SIG_RANDOM)) if (!strcmp(sig, TR("Random")))
item->SetMarked(true); item->SetMarked(true);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
@@ -1048,13 +1021,15 @@ TPrefsWindow::_BuildAttachAttributesMenu(bool attachAttributes)
menu = new BPopUpMenu(""); menu = new BPopUpMenu("");
msg = new BMessage(P_ATTACH_ATTRIBUTES); msg = new BMessage(P_ATTACH_ATTRIBUTES);
msg->AddBool("attachAttributes", true); msg->AddBool("attachAttributes", true);
menu->AddItem(item = new BMenuItem(ATTRIBUTE_ON_TEXT, msg)); menu->AddItem(item = new BMenuItem(
TR("Include BeOS Attributes in Attachments"), msg));
if (attachAttributes) if (attachAttributes)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_ATTACH_ATTRIBUTES); msg = new BMessage(P_ATTACH_ATTRIBUTES);
msg->AddInt32("attachAttributes", false); msg->AddInt32("attachAttributes", false);
menu->AddItem(item = new BMenuItem(ATTRIBUTE_OFF_TEXT, msg)); menu->AddItem(item = new BMenuItem(
TR("No BeOS Attributes, just Plain Data"), msg));
if (!attachAttributes) if (!attachAttributes)
item->SetMarked(true); item->SetMarked(true);
@@ -1140,19 +1115,19 @@ TPrefsWindow::_BuildButtonBarMenu(uint8 show)
msg = new BMessage(P_BUTTON_BAR); msg = new BMessage(P_BUTTON_BAR);
msg->AddInt8("bar", 1); msg->AddInt8("bar", 1);
menu->AddItem(item = new BMenuItem(ICON_LABEL_TEXT, msg)); menu->AddItem(item = new BMenuItem(TR("Show Icons & Labels"), msg));
if (show & 1) if (show & 1)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_BUTTON_BAR); msg = new BMessage(P_BUTTON_BAR);
msg->AddInt8("bar", 2); msg->AddInt8("bar", 2);
menu->AddItem(item = new BMenuItem(ICON_TEXT, msg)); menu->AddItem(item = new BMenuItem(TR("Show Icons Only"), msg));
if (show & 2) if (show & 2)
item->SetMarked(true); item->SetMarked(true);
msg = new BMessage(P_BUTTON_BAR); msg = new BMessage(P_BUTTON_BAR);
msg->AddInt8("bar", 0); msg->AddInt8("bar", 0);
menu->AddItem(item = new BMenuItem(HIDE_TEXT, msg)); menu->AddItem(item = new BMenuItem(TR("Hide"), msg));
if (!show) if (!show)
item->SetMarked(true); item->SetMarked(true);
+1 -3
View File
@@ -50,9 +50,6 @@ class BTextControl;
#define PREF_WIDTH 340 #define PREF_WIDTH 340
#define PREF_HEIGHT 330 #define PREF_HEIGHT 330
#define SIG_NONE MDR_DIALECT_CHOICE ("None", "無し")
#define SIG_RANDOM MDR_DIALECT_CHOICE ("Random", "自動選択")
struct EncodingItem { struct EncodingItem {
char* name; char* name;
uint32 flavor; uint32 flavor;
@@ -146,3 +143,4 @@ private:
}; };
#endif /* _PREFS_H */ #endif /* _PREFS_H */
+35 -42
View File
@@ -40,6 +40,7 @@ All rights reserved.
#include <Clipboard.h> #include <Clipboard.h>
#include <InterfaceKit.h> #include <InterfaceKit.h>
#include <Locale.h>
#include <StorageKit.h> #include <StorageKit.h>
#include "MailApp.h" #include "MailApp.h"
@@ -48,21 +49,18 @@ All rights reserved.
#include "MailWindow.h" #include "MailWindow.h"
#include "Messages.h" #include "Messages.h"
#include <MDRLanguage.h>
#define TR_CONTEXT "Mail"
extern BRect signature_window; extern BRect signature_window;
extern const char *kUndoStrings[]; extern const char *kUndoStrings[];
extern const char *kRedoStrings[]; extern const char *kRedoStrings[];
const char kNameText[] = MDR_DIALECT_CHOICE ("Title:", "署名の名称:");
const char kSigText[] = MDR_DIALECT_CHOICE ("Signature:", "署名:");
//====================================================================
TSignatureWindow::TSignatureWindow(BRect rect) TSignatureWindow::TSignatureWindow(BRect rect)
: BWindow (rect, MDR_DIALECT_CHOICE ("Signatures","署名の編集"), B_TITLED_WINDOW, 0), :
BWindow (rect, TR("Signatures"), B_TITLED_WINDOW, 0),
fFile(NULL) fFile(NULL)
{ {
BMenu *menu; BMenu *menu;
@@ -72,27 +70,30 @@ TSignatureWindow::TSignatureWindow(BRect rect)
BRect r = Bounds(); BRect r = Bounds();
/*** Set up the menus ****/ /*** Set up the menus ****/
menu_bar = new BMenuBar(r, "MenuBar"); menu_bar = new BMenuBar(r, "MenuBar");
menu = new BMenu(MDR_DIALECT_CHOICE ("Signature","S) 署名")); menu = new BMenu(TR("Signature"));
menu->AddItem(fNew = new BMenuItem(MDR_DIALECT_CHOICE ("New","N) 新規"), new BMessage(M_NEW), 'N')); menu->AddItem(fNew = new BMenuItem(TR("New"), new BMessage(M_NEW), 'N'));
fSignature = new TMenu(MDR_DIALECT_CHOICE ("Open","O) 開く"), INDEX_SIGNATURE, M_SIGNATURE); fSignature = new TMenu(TR("Open"), INDEX_SIGNATURE, M_SIGNATURE);
menu->AddItem(new BMenuItem(fSignature)); menu->AddItem(new BMenuItem(fSignature));
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fSave = new BMenuItem(MDR_DIALECT_CHOICE ("Save","S) 保存"), new BMessage(M_SAVE), 'S')); menu->AddItem(fSave = new BMenuItem(TR("Save"), new BMessage(M_SAVE), 'S'));
menu->AddItem(fDelete = new BMenuItem(MDR_DIALECT_CHOICE ("Delete","T) 削除"), new BMessage(M_DELETE), 'T')); menu->AddItem(fDelete = new BMenuItem(TR("Delete"), new BMessage(M_DELETE),
'T'));
menu_bar->AddItem(menu); menu_bar->AddItem(menu);
menu = new BMenu(MDR_DIALECT_CHOICE ("Edit","E) 編集")); menu = new BMenu(TR("Edit"));
menu->AddItem(fUndo = new BMenuItem(MDR_DIALECT_CHOICE ("Undo","Z) やり直し"), new BMessage(B_UNDO), 'Z')); menu->AddItem(fUndo = new BMenuItem(TR("Undo"), new BMessage(B_UNDO), 'Z'));
fUndo->SetTarget(NULL, this); fUndo->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(fCut = new BMenuItem(MDR_DIALECT_CHOICE ("Cut","X) 切り取り"), new BMessage(B_CUT), 'X')); menu->AddItem(fCut = new BMenuItem(TR("Cut"), new BMessage(B_CUT), 'X'));
fCut->SetTarget(NULL, this); fCut->SetTarget(NULL, this);
menu->AddItem(fCopy = new BMenuItem(MDR_DIALECT_CHOICE ("Copy","C) コピー"), new BMessage(B_COPY), 'C')); menu->AddItem(fCopy = new BMenuItem(TR("Copy"), new BMessage(B_COPY), 'C'));
fCopy->SetTarget(NULL, this); fCopy->SetTarget(NULL, this);
menu->AddItem(fPaste = new BMenuItem(MDR_DIALECT_CHOICE ("Paste","V) 貼り付け"), new BMessage(B_PASTE), 'V')); menu->AddItem(fPaste = new BMenuItem(TR("Paste"), new BMessage(B_PASTE),
'V'));
fPaste->SetTarget(NULL, this); fPaste->SetTarget(NULL, this);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem(MDR_DIALECT_CHOICE ("Select All","A) 全文選択"), new BMessage(M_SELECT), 'A')); menu->AddItem(item = new BMenuItem(TR("Select All"), new BMessage(M_SELECT),
'A'));
item->SetTarget(NULL, this); item->SetTarget(NULL, this);
menu_bar->AddItem(menu); menu_bar->AddItem(menu);
@@ -187,11 +188,9 @@ TSignatureWindow::MessageReceived(BMessage* msg)
break; break;
case M_DELETE: case M_DELETE:
if (!(new BAlert("",MDR_DIALECT_CHOICE ( if (!(new BAlert("",
"Really delete this signature? This cannot be undone.", TR("Really delete this signature? This cannot be undone."),
"この署名を削除しますか?"), TR("Cancel"), TR("Delete"), NULL, B_WIDTH_AS_USUAL,
MDR_DIALECT_CHOICE ("Cancel","取消l"),
MDR_DIALECT_CHOICE ("Delete","削除"), NULL, B_WIDTH_AS_USUAL,
B_WARNING_ALERT))->Go()) B_WARNING_ALERT))->Go())
break; break;
@@ -225,10 +224,8 @@ TSignatureWindow::MessageReceived(BMessage* msg)
else { else {
fFile = NULL; fFile = NULL;
beep(); beep();
(new BAlert("", MDR_DIALECT_CHOICE ( (new BAlert("", TR("Couldn't open this signature. Sorry."),
"Couldn't open this signature. Sorry.", TR("OK")))->Go();
"署名を開く時にエラーが発生しました。"),
MDR_DIALECT_CHOICE ("OK","了解")))->Go();
} }
} }
break; break;
@@ -283,14 +280,11 @@ TSignatureWindow::Clear()
if (IsDirty()) { if (IsDirty()) {
beep(); beep();
BAlert *alert = new BAlert("", BAlert *alert = new BAlert("", TR("Save changes to this signature?"),
MDR_DIALECT_CHOICE ("Save changes to this signature?","変更した署名を保存しますか?"), TR("Don't Save"), TR("Cancel"), TR("Save"),
MDR_DIALECT_CHOICE ("Don't Save","保存しない"),
MDR_DIALECT_CHOICE ("Cancel","中止"),
MDR_DIALECT_CHOICE ("Save","保存する"),
B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0,'d'); alert->SetShortcut(0, 'd');
alert->SetShortcut(1,B_ESCAPE); alert->SetShortcut(1, B_ESCAPE);
result = alert->Go(); result = alert->Go();
if (result == 1) if (result == 1)
return false; return false;
@@ -380,10 +374,8 @@ TSignatureWindow::Save()
err_exit: err_exit:
beep(); beep();
(new BAlert("", MDR_DIALECT_CHOICE ( (new BAlert("", TR("An error occurred trying to save this signature."),
"An error occurred trying to save this signature.", TR("Sorry")))->Go();
"署名を保存しようとした時にエラーが発生しました。"),
MDR_DIALECT_CHOICE ("Sorry","了解")))->Go();
} }
@@ -401,8 +393,8 @@ void
TSignatureView::AttachedToWindow() TSignatureView::AttachedToWindow()
{ {
BRect rect = Bounds(); BRect rect = Bounds();
float name_text_length = StringWidth(kNameText); float name_text_length = StringWidth(TR("Title:"));
float sig_text_length = StringWidth(kSigText); float sig_text_length = StringWidth(TR("Signature:"));
float divide_length; float divide_length;
if (name_text_length > sig_text_length) if (name_text_length > sig_text_length)
@@ -413,7 +405,7 @@ TSignatureView::AttachedToWindow()
rect.InsetBy(8,0); rect.InsetBy(8,0);
rect.top+= 8; rect.top+= 8;
fName = new TNameControl(rect, kNameText, new BMessage(NAME_FIELD)); fName = new TNameControl(rect, TR("Title:"), new BMessage(NAME_FIELD));
AddChild(fName); AddChild(fName);
fName->SetDivider(divide_length + 10); fName->SetDivider(divide_length + 10);
@@ -434,7 +426,8 @@ TSignatureView::AttachedToWindow()
/* back up a bit to make room for the label */ /* back up a bit to make room for the label */
rect = scroller->Frame(); rect = scroller->Frame();
BStringView *stringView = new BStringView(rect, "SigLabel", kSigText); BStringView *stringView = new BStringView(rect, "SigLabel",
TR("Signature:"));
AddChild(stringView); AddChild(stringView);
float tWidth, tHeight; float tWidth, tHeight;
+3 -2
View File
@@ -56,13 +56,13 @@ All rights reserved.
#include <TextControl.h> #include <TextControl.h>
#include <Window.h> #include <Window.h>
#include <MDRLanguage.h>
const float kSigHeight = 200; const float kSigHeight = 200;
const float kSigWidth = 457; const float kSigWidth = 457;
#define INDEX_SIGNATURE "_signature" #define INDEX_SIGNATURE "_signature"
class TMenu; class TMenu;
class TNameControl; class TNameControl;
class TScrollView; class TScrollView;
@@ -143,3 +143,4 @@ private:
}; };
#endif // #ifndef _SIGNATURE_H #endif // #ifndef _SIGNATURE_H
-2
View File
@@ -50,8 +50,6 @@ All rights reserved.
#include <MailMessage.h> #include <MailMessage.h>
#include <MDRLanguage.h>
#include "Utilities.h" #include "Utilities.h"