Updated to use B_TRANSLATE* macros. relates to #5408.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36675 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Matt Madia
2010-05-06 22:21:26 +00:00
parent 905c8c8c8a
commit 6c514d3e3b
11 changed files with 168 additions and 143 deletions
+3 -3
View File
@@ -70,9 +70,9 @@ AppearancePrefView::AppearancePrefView(const char* name,
BMenu* sizeMenu = _MakeSizeMenu(MSG_HALF_SIZE_CHANGED, BMenu* sizeMenu = _MakeSizeMenu(MSG_HALF_SIZE_CHANGED,
PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE)); PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE));
fFont = new BMenuField(TR("Font:"), fontMenu); fFont = new BMenuField(B_TRANSLATE("Font:"), fontMenu);
fFontSize = new BMenuField(TR("Size:"), sizeMenu); fFontSize = new BMenuField(B_TRANSLATE("Size:"), sizeMenu);
fColorField = new BMenuField(TR("Color:"), fColorField = new BMenuField(B_TRANSLATE("Color:"),
_MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable, _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable,
kColorTable[0])); kColorTable[0]));
+2 -1
View File
@@ -82,7 +82,8 @@ Arguments::Parse(int argc, const char *const *argv)
argi++; argi++;
} else { } else {
// illegal option // illegal option
fprintf(stderr, TR("Unrecognized option \"%s\"\n"), arg); fprintf(stderr, B_TRANSLATE("Unrecognized option \"%s\"\n"),
arg);
fUsageRequested = true; fUsageRequested = true;
} }
+7 -7
View File
@@ -32,7 +32,7 @@ const BRect kWindowFrame(10, 30, 250, 200);
FindWindow::FindWindow(BMessenger messenger, const BString& str, FindWindow::FindWindow(BMessenger messenger, const BString& str,
bool findSelection, bool matchWord, bool matchCase, bool forwardSearch) bool findSelection, bool matchWord, bool matchCase, bool forwardSearch)
: :
BWindow(kWindowFrame, TR("Find"), B_FLOATING_WINDOW, BWindow(kWindowFrame, B_TRANSLATE("Find"), B_FLOATING_WINDOW,
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE
| B_AUTO_UPDATE_SIZE_LIMITS), | B_AUTO_UPDATE_SIZE_LIMITS),
fFindDlgMessenger(messenger) fFindDlgMessenger(messenger)
@@ -48,16 +48,16 @@ FindWindow::FindWindow(BMessenger messenger, const BString& str,
BView* layoutView = BGroupLayoutBuilder(B_VERTICAL, 5.0) BView* layoutView = BGroupLayoutBuilder(B_VERTICAL, 5.0)
.SetInsets(spacing, spacing, spacing, spacing) .SetInsets(spacing, spacing, spacing, spacing)
.Add(BGridLayoutBuilder() .Add(BGridLayoutBuilder()
.Add(fTextRadio = new BRadioButton(TR("Use text:"), .Add(fTextRadio = new BRadioButton(B_TRANSLATE("Use text:"),
new BMessage(TOGGLE_FIND_CONTROL)), 0, 0) new BMessage(TOGGLE_FIND_CONTROL)), 0, 0)
.Add(fFindLabel = new BTextControl(NULL, NULL, NULL), 1, 0) .Add(fFindLabel = new BTextControl(NULL, NULL, NULL), 1, 0)
.Add(useSelection = new BRadioButton(TR("Use selection"), .Add(useSelection = new BRadioButton(B_TRANSLATE("Use selection"),
new BMessage(TOGGLE_FIND_CONTROL)), 0, 1)) new BMessage(TOGGLE_FIND_CONTROL)), 0, 1))
.Add(separator) .Add(separator)
.Add(fForwardSearchBox = new BCheckBox(TR("Search forward"))) .Add(fForwardSearchBox = new BCheckBox(B_TRANSLATE("Search forward")))
.Add(fMatchCaseBox = new BCheckBox(TR("Match case"))) .Add(fMatchCaseBox = new BCheckBox(B_TRANSLATE("Match case")))
.Add(fMatchWordBox = new BCheckBox(TR("Match word"))) .Add(fMatchWordBox = new BCheckBox(B_TRANSLATE("Match word")))
.Add(fFindButton = new BButton(TR("Find"), new BMessage(MSG_FIND))) .Add(fFindButton = new BButton(B_TRANSLATE("Find"), new BMessage(MSG_FIND)))
.End(); .End();
AddChild(layoutView); AddChild(layoutView);
+3 -2
View File
@@ -249,7 +249,7 @@ PrefHandler::getString(const char *key)
{ {
const char *buffer; const char *buffer;
if (fContainer.FindString(key, &buffer) != B_OK) if (fContainer.FindString(key, &buffer) != B_OK)
buffer = TR("Error!"); buffer = B_TRANSLATE("Error!");
//printf("%x GET %s: %s\n", this, key, buf); //printf("%x GET %s: %s\n", this, key, buf);
return buffer; return buffer;
@@ -281,7 +281,8 @@ PrefHandler::getRGB(const char *key)
if (const char *s = fContainer.FindString(key)) { if (const char *s = fContainer.FindString(key)) {
sscanf(s, "%d, %d, %d", &r, &g, &b); sscanf(s, "%d, %d, %d", &r, &g, &b);
} else { } else {
fprintf(stderr, TR("PrefHandler::getRGB(%s) - key not found\n"), key); fprintf(stderr,
B_TRANSLATE("PrefHandler::getRGB(%s) - key not found\n"), key);
r = g = b = 0; r = g = b = 0;
} }
+9 -7
View File
@@ -27,7 +27,7 @@
#define TR_CONTEXT "Terminal PrefWindow" #define TR_CONTEXT "Terminal PrefWindow"
PrefWindow::PrefWindow(const BMessenger &messenger) PrefWindow::PrefWindow(const BMessenger &messenger)
: BWindow(BRect(0, 0, 375, 185), TR("Terminal settings"), : BWindow(BRect(0, 0, 375, 185), B_TRANSLATE("Terminal settings"),
B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_AUTO_UPDATE_SIZE_LIMITS), B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_AUTO_UPDATE_SIZE_LIMITS),
fPreviousPref(new PrefHandler(PrefHandler::Default())), fPreviousPref(new PrefHandler(PrefHandler::Default())),
@@ -38,16 +38,17 @@ PrefWindow::PrefWindow(const BMessenger &messenger)
BLayoutBuilder::Group<>(this, B_VERTICAL) BLayoutBuilder::Group<>(this, B_VERTICAL)
.AddGroup(B_VERTICAL) .AddGroup(B_VERTICAL)
.SetInsets(10, 10, 10, 10) .SetInsets(10, 10, 10, 10)
.Add(new AppearancePrefView(TR("Appearance"), fTerminalMessenger)) .Add(new AppearancePrefView(B_TRANSLATE("Appearance"),
fTerminalMessenger))
.AddGroup(B_HORIZONTAL) .AddGroup(B_HORIZONTAL)
.Add(fSaveAsFileButton = new BButton("savebutton", .Add(fSaveAsFileButton = new BButton("savebutton",
TR("Save to file" B_UTF8_ELLIPSIS), B_TRANSLATE("Save to file" B_UTF8_ELLIPSIS),
new BMessage(MSG_SAVEAS_PRESSED), B_WILL_DRAW)) new BMessage(MSG_SAVEAS_PRESSED), B_WILL_DRAW))
.AddGlue() .AddGlue()
.Add(fRevertButton = new BButton("revertbutton", .Add(fRevertButton = new BButton("revertbutton",
TR("Cancel"), new BMessage(MSG_REVERT_PRESSED), B_TRANSLATE("Cancel"), new BMessage(MSG_REVERT_PRESSED),
B_WILL_DRAW)) B_WILL_DRAW))
.Add(fSaveButton = new BButton("okbutton", TR("OK"), .Add(fSaveButton = new BButton("okbutton", B_TRANSLATE("OK"),
new BMessage(MSG_SAVE_PRESSED), B_WILL_DRAW)) new BMessage(MSG_SAVE_PRESSED), B_WILL_DRAW))
.End() .End()
.End(); .End();
@@ -83,8 +84,9 @@ PrefWindow::QuitRequested()
if (!fDirty) if (!fDirty)
return true; return true;
BAlert *alert = new BAlert("", TR("Save changes to this settings panel?"), BAlert *alert = new BAlert("",
TR("Cancel"), TR("Don't save"), TR("Save"), B_TRANSLATE("Save changes to this settings panel?"),
B_TRANSLATE("Cancel"), B_TRANSLATE("Don't save"), B_TRANSLATE("Save"),
B_WIDTH_AS_USUAL, B_OFFSET_SPACING, B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
B_WARNING_ALERT); B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
+9 -8
View File
@@ -364,7 +364,8 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
} else { } else {
// B_BUSY is a normal case // B_BUSY is a normal case
if (errno != B_BUSY) if (errno != B_BUSY)
fprintf(stderr, TR("could not open %s: %s\n"), ptyName, strerror(errno)); fprintf(stderr, B_TRANSLATE("could not open %s: %s\n"),
ptyName, strerror(errno));
} }
} }
closedir(dir); closedir(dir);
@@ -372,7 +373,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
#endif /* __HAIKU__ */ #endif /* __HAIKU__ */
if (master < 0) { if (master < 0) {
fprintf(stderr, TR("Didn't find any available pseudo ttys.")); fprintf(stderr, B_TRANSLATE("Didn't find any available pseudo ttys."));
return errno; return errno;
} }
@@ -380,7 +381,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
if (grantpt(master) != 0 || unlockpt(master) != 0 if (grantpt(master) != 0 || unlockpt(master) != 0
|| (ttyName = ptsname(master)) == NULL) { || (ttyName = ptsname(master)) == NULL) {
close(master); close(master);
fprintf(stderr, TR("Failed to init pseudo tty.")); fprintf(stderr, B_TRANSLATE("Failed to init pseudo tty."));
return errno; return errno;
} }
#endif /* __HAIKU__ */ #endif /* __HAIKU__ */
@@ -415,7 +416,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
if (setsid() < 0) { if (setsid() < 0) {
handshake.status = PTY_NG; handshake.status = PTY_NG;
snprintf(handshake.msg, sizeof(handshake.msg), snprintf(handshake.msg, sizeof(handshake.msg),
TR("could not set session leader.")); B_TRANSLATE("could not set session leader."));
send_handshake_message(terminalThread, handshake); send_handshake_message(terminalThread, handshake);
exit(1); exit(1);
} }
@@ -425,7 +426,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
if ((slave = open(ttyName, O_RDWR)) < 0) { if ((slave = open(ttyName, O_RDWR)) < 0) {
handshake.status = PTY_NG; handshake.status = PTY_NG;
snprintf(handshake.msg, sizeof(handshake.msg), snprintf(handshake.msg, sizeof(handshake.msg),
TR("can't open tty (%s)."), ttyName); B_TRANSLATE("can't open tty (%s)."), ttyName);
send_handshake_message(terminalThread, handshake); send_handshake_message(terminalThread, handshake);
exit(1); exit(1);
} }
@@ -464,7 +465,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
if (tcsetattr(0, TCSANOW, &tio) == -1) { if (tcsetattr(0, TCSANOW, &tio) == -1) {
handshake.status = PTY_NG; handshake.status = PTY_NG;
snprintf(handshake.msg, sizeof(handshake.msg), snprintf(handshake.msg, sizeof(handshake.msg),
TR("failed set terminal interface (TERMIOS).")); B_TRANSLATE("failed set terminal interface (TERMIOS)."));
send_handshake_message(terminalThread, handshake); send_handshake_message(terminalThread, handshake);
exit(1); exit(1);
} }
@@ -480,7 +481,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
if (handshake.status != PTY_WS) { if (handshake.status != PTY_WS) {
handshake.status = PTY_NG; handshake.status = PTY_NG;
snprintf(handshake.msg, sizeof(handshake.msg), snprintf(handshake.msg, sizeof(handshake.msg),
TR("mismatch handshake.")); B_TRANSLATE("mismatch handshake."));
send_handshake_message(terminalThread, handshake); send_handshake_message(terminalThread, handshake);
exit(1); exit(1);
} }
@@ -518,7 +519,7 @@ Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **arg
sleep(1); sleep(1);
BString knonLocalizedPart = "alert --stop "; BString knonLocalizedPart = "alert --stop ";
const char *kLocalizedPart = const char *kLocalizedPart =
TR("'Cannot execute \"%s\":\n\t%s' 'Use default shell' 'Abort'"); B_TRANSLATE("'Cannot execute \"%s\":\n\t%s' 'Use default shell' 'Abort'");
const char *spawnAlertMessage = knonLocalizedPart << kLocalizedPart; const char *spawnAlertMessage = knonLocalizedPart << kLocalizedPart;
char errorMessage[256]; char errorMessage[256];
snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, argv[0], strerror(errno)); snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, argv[0], strerror(errno));
+2 -1
View File
@@ -80,7 +80,8 @@ SmartTabView::MouseDown(BPoint point)
message->AddInt32("index", tabIndex); message->AddInt32("index", tabIndex);
BPopUpMenu* popUpMenu = new BPopUpMenu("tab menu"); BPopUpMenu* popUpMenu = new BPopUpMenu("tab menu");
popUpMenu->AddItem(new BMenuItem(TR("Close tab"), message)); popUpMenu->AddItem(new BMenuItem(B_TRANSLATE("Close tab"),
message));
popUpMenu->SetAsyncAutoDestruct(true); popUpMenu->SetAsyncAutoDestruct(true);
popUpMenu->SetTargetForItems(BMessenger(this)); popUpMenu->SetTargetForItems(BMessenger(this));
popUpMenu->Go(ConvertToScreen(point), true, true, true); popUpMenu->Go(ConvertToScreen(point), true, true, true);
+8 -6
View File
@@ -80,7 +80,7 @@ TermApp::TermApp()
fArgs = new Arguments(2, defaultArgs); fArgs = new Arguments(2, defaultArgs);
fWindowTitle = TR("Terminal"); fWindowTitle = B_TRANSLATE("Terminal");
_RegisterTerminal(); _RegisterTerminal();
if (fWindowNumber > 0) if (fWindowNumber > 0)
@@ -122,7 +122,8 @@ TermApp::ReadyToRun()
#endif #endif
action.sa_userdata = this; action.sa_userdata = this;
if (sigaction(SIGCHLD, &action, NULL) < 0) { if (sigaction(SIGCHLD, &action, NULL) < 0) {
fprintf(stderr, TR("sigaction() failed: %s\n"), strerror(errno)); fprintf(stderr, B_TRANSLATE("sigaction() failed: %s\n"),
strerror(errno));
// continue anyway // continue anyway
} }
@@ -134,8 +135,9 @@ TermApp::ReadyToRun()
// failed spawn, print stdout and open alert panel // failed spawn, print stdout and open alert panel
// TODO: This alert does never show up. // TODO: This alert does never show up.
if (status < B_OK) { if (status < B_OK) {
(new BAlert("alert", TR("Terminal couldn't start the shell. Sorry."), (new BAlert("alert",
TR("OK"), NULL, NULL, B_WIDTH_FROM_LABEL, B_TRANSLATE("Terminal couldn't start the shell. Sorry."),
B_TRANSLATE("OK"), NULL, NULL, B_WIDTH_FROM_LABEL,
B_INFO_ALERT))->Go(NULL); B_INFO_ALERT))->Go(NULL);
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
return; return;
@@ -562,14 +564,14 @@ TermApp::_ChildCleanupThread(void* data)
void void
TermApp::_Usage(char *name) TermApp::_Usage(char *name)
{ {
fprintf(stderr, TR("Haiku Terminal\n" fprintf(stderr, B_TRANSLATE("Haiku Terminal\n"
"Copyright 2001-2009 Haiku, Inc.\n" "Copyright 2001-2009 Haiku, Inc.\n"
"Copyright(C) 1999 Kazuho Okui and Takashi Murai.\n" "Copyright(C) 1999 Kazuho Okui and Takashi Murai.\n"
"\n" "\n"
"Usage: %s [OPTION] [SHELL]\n"), name); "Usage: %s [OPTION] [SHELL]\n"), name);
fprintf(stderr, fprintf(stderr,
TR(" -h, --help print this help\n" B_TRANSLATE(" -h, --help print this help\n"
//" -p, --preference load preference file\n" //" -p, --preference load preference file\n"
" -t, --title set window title\n" " -t, --title set window title\n"
" -f, --fullscreen start fullscreen\n") " -f, --fullscreen start fullscreen\n")
+3 -3
View File
@@ -291,17 +291,17 @@ TermParse::DumpState(int *groundtable, int *parsestate, uchar c)
{ NULL, NULL } { NULL, NULL }
}; };
int i; int i;
fprintf(stderr, TR("groundtable: ")); fprintf(stderr, B_TRANSLATE("groundtable: "));
for (i = 0; tables[i].p; i++) { for (i = 0; tables[i].p; i++) {
if (tables[i].p == groundtable) if (tables[i].p == groundtable)
fprintf(stderr, "%s\t", tables[i].name); fprintf(stderr, "%s\t", tables[i].name);
} }
fprintf(stderr, TR("parsestate: ")); fprintf(stderr, B_TRANSLATE("parsestate: "));
for (i = 0; tables[i].p; i++) { for (i = 0; tables[i].p; i++) {
if (tables[i].p == parsestate) if (tables[i].p == parsestate)
fprintf(stderr, "%s\t", tables[i].name); fprintf(stderr, "%s\t", tables[i].name);
} }
fprintf(stderr, TR("char: 0x%02x (%d)\n"), c, c); fprintf(stderr, B_TRANSLATE("char: 0x%02x (%d)\n"), c, c);
} }
+18 -12
View File
@@ -1431,7 +1431,8 @@ TermView::FrameResized(float width, float height)
bool hasResizeView = fResizeRunner != NULL; bool hasResizeView = fResizeRunner != NULL;
if (!hasResizeView) { if (!hasResizeView) {
// show the current size in a view // show the current size in a view
fResizeView = new BStringView(BRect(100, 100, 300, 140), TR("size"), ""); fResizeView = new BStringView(BRect(100, 100, 300, 140),
B_TRANSLATE("size"), "");
fResizeView->SetAlignment(B_ALIGN_CENTER); fResizeView->SetAlignment(B_ALIGN_CENTER);
fResizeView->SetFont(be_bold_font); fResizeView->SetFont(be_bold_font);
@@ -1825,12 +1826,15 @@ TermView::_SecondaryMouseButtonDropped(BMessage* msg)
cpMessage->what = kSecondaryMouseDropAction; cpMessage->what = kSecondaryMouseDropAction;
cpMessage->AddInt8("action", kCopyFiles); cpMessage->AddInt8("action", kCopyFiles);
BMenuItem* insertItem = new BMenuItem(TR("Insert path"), insertMessage); BMenuItem* insertItem = new BMenuItem(
BMenuItem* cdItem = new BMenuItem(TR("Change directory"), cdMessage); B_TRANSLATE("Insert path"), insertMessage);
BMenuItem* lnItem = new BMenuItem(TR("Create link here"), lnMessage); BMenuItem* cdItem = new BMenuItem(
BMenuItem* mvItem = new BMenuItem(TR("Move here"), mvMessage); B_TRANSLATE("Change directory"), cdMessage);
BMenuItem* cpItem = new BMenuItem(TR("Copy here"), cpMessage); BMenuItem* lnItem = new BMenuItem(
BMenuItem* chItem = new BMenuItem(TR("Cancel"), NULL); B_TRANSLATE("Create link here"), lnMessage);
BMenuItem* mvItem = new BMenuItem(B_TRANSLATE("Move here"), mvMessage);
BMenuItem* cpItem = new BMenuItem(B_TRANSLATE("Copy here"), cpMessage);
BMenuItem* chItem = new BMenuItem(B_TRANSLATE("Cancel"), NULL);
// if the refs point to different directorys disable the cd menu item // if the refs point to different directorys disable the cd menu item
bool differentDirs = false; bool differentDirs = false;
@@ -1858,7 +1862,8 @@ TermView::_SecondaryMouseButtonDropped(BMessage* msg)
if (differentDirs) if (differentDirs)
cdItem->SetEnabled(false); cdItem->SetEnabled(false);
BPopUpMenu *menu = new BPopUpMenu(TR("Secondary mouse button drop menu")); BPopUpMenu *menu = new BPopUpMenu(
B_TRANSLATE("Secondary mouse button drop menu"));
menu->SetAsyncAutoDestruct(true); menu->SetAsyncAutoDestruct(true);
menu->AddItem(insertItem); menu->AddItem(insertItem);
menu->AddSeparatorItem(); menu->AddSeparatorItem();
@@ -2768,10 +2773,11 @@ void
TermView::AboutRequested() TermView::AboutRequested()
{ {
BAlert *alert = new (std::nothrow) BAlert("about", BAlert *alert = new (std::nothrow) BAlert("about",
TR("Terminal\n\n" B_TRANSLATE("Terminal\n\n"
"written by Kazuho Okui and Takashi Murai\n" "written by Kazuho Okui and Takashi Murai\n"
"updated by Kian Duffy and others\n\n" "updated by Kian Duffy and others\n\n"
"Copyright " B_UTF8_COPYRIGHT "2003-2009, Haiku.\n"), TR("OK")); "Copyright " B_UTF8_COPYRIGHT "2003-2009, Haiku.\n"),
B_TRANSLATE("OK"));
if (alert != NULL) if (alert != NULL)
alert->Go(); alert->Go();
} }
+44 -33
View File
@@ -257,7 +257,7 @@ TermWindow::MenusBeginning()
BMenu * BMenu *
TermWindow::_MakeEncodingMenu() TermWindow::_MakeEncodingMenu()
{ {
BMenu *menu = new (std::nothrow) BMenu(TR("Text encoding")); BMenu *menu = new (std::nothrow) BMenu(B_TRANSLATE("Text encoding"));
if (menu == NULL) if (menu == NULL)
return NULL; return NULL;
@@ -286,44 +286,49 @@ TermWindow::_SetupMenu()
fMenubar = new BMenuBar(Bounds(), "mbar"); fMenubar = new BMenuBar(Bounds(), "mbar");
// Make File Menu. // Make File Menu.
fFilemenu = new BMenu(TR("Terminal")); fFilemenu = new BMenu(B_TRANSLATE("Terminal"));
fFilemenu->AddItem(new BMenuItem(TR("Switch Terminals"), fFilemenu->AddItem(new BMenuItem(B_TRANSLATE("Switch Terminals"),
new BMessage(MENU_SWITCH_TERM), B_TAB)); new BMessage(MENU_SWITCH_TERM), B_TAB));
fFilemenu->AddItem(new BMenuItem(TR("New Terminal"), fFilemenu->AddItem(new BMenuItem(B_TRANSLATE("New Terminal"),
new BMessage(MENU_NEW_TERM), 'N')); new BMessage(MENU_NEW_TERM), 'N'));
fFilemenu->AddItem(new BMenuItem(TR("New tab"), new BMessage(kNewTab), 'T')); fFilemenu->AddItem(new BMenuItem(B_TRANSLATE("New tab"),
new BMessage(kNewTab), 'T'));
fFilemenu->AddSeparatorItem(); fFilemenu->AddSeparatorItem();
fFilemenu->AddItem(new BMenuItem(TR("Page setup" B_UTF8_ELLIPSIS), fFilemenu->AddItem(new BMenuItem(B_TRANSLATE("Page setup" B_UTF8_ELLIPSIS),
new BMessage(MENU_PAGE_SETUP))); new BMessage(MENU_PAGE_SETUP)));
fFilemenu->AddItem(new BMenuItem(TR("Print"), new BMessage(MENU_PRINT),'P')); fFilemenu->AddItem(new BMenuItem(B_TRANSLATE("Print"),
new BMessage(MENU_PRINT),'P'));
fFilemenu->AddSeparatorItem(); fFilemenu->AddSeparatorItem();
fFilemenu->AddItem(new BMenuItem(TR("About Terminal" B_UTF8_ELLIPSIS), fFilemenu->AddItem(new BMenuItem(
B_TRANSLATE("About Terminal" B_UTF8_ELLIPSIS),
new BMessage(B_ABOUT_REQUESTED))); new BMessage(B_ABOUT_REQUESTED)));
fFilemenu->AddSeparatorItem(); fFilemenu->AddSeparatorItem();
fFilemenu->AddItem(new BMenuItem(TR("Close active tab"), fFilemenu->AddItem(new BMenuItem(B_TRANSLATE("Close active tab"),
new BMessage(kCloseView), 'W', B_SHIFT_KEY)); new BMessage(kCloseView), 'W', B_SHIFT_KEY));
fFilemenu->AddItem(new BMenuItem(TR("Quit"), fFilemenu->AddItem(new BMenuItem(B_TRANSLATE("Quit"),
new BMessage(B_QUIT_REQUESTED), 'Q')); new BMessage(B_QUIT_REQUESTED), 'Q'));
fMenubar->AddItem(fFilemenu); fMenubar->AddItem(fFilemenu);
// Make Edit Menu. // Make Edit Menu.
fEditmenu = new BMenu("Edit"); fEditmenu = new BMenu("Edit");
fEditmenu->AddItem(new BMenuItem(TR("Copy"), new BMessage(B_COPY),'C')); fEditmenu->AddItem(new BMenuItem(B_TRANSLATE("Copy"),
fEditmenu->AddItem(new BMenuItem(TR("Paste"), new BMessage(B_PASTE),'V')); new BMessage(B_COPY),'C'));
fEditmenu->AddItem(new BMenuItem(B_TRANSLATE("Paste"),
new BMessage(B_PASTE),'V'));
fEditmenu->AddSeparatorItem(); fEditmenu->AddSeparatorItem();
fEditmenu->AddItem(new BMenuItem(TR("Select all"), fEditmenu->AddItem(new BMenuItem(B_TRANSLATE("Select all"),
new BMessage(B_SELECT_ALL), 'A')); new BMessage(B_SELECT_ALL), 'A'));
fEditmenu->AddItem(new BMenuItem(TR("Clear all"), fEditmenu->AddItem(new BMenuItem(B_TRANSLATE("Clear all"),
new BMessage(MENU_CLEAR_ALL), 'L')); new BMessage(MENU_CLEAR_ALL), 'L'));
fEditmenu->AddSeparatorItem(); fEditmenu->AddSeparatorItem();
fEditmenu->AddItem(new BMenuItem(TR("Find" B_UTF8_ELLIPSIS), fEditmenu->AddItem(new BMenuItem(B_TRANSLATE("Find" B_UTF8_ELLIPSIS),
new BMessage(MENU_FIND_STRING),'F')); new BMessage(MENU_FIND_STRING),'F'));
fFindPreviousMenuItem = new BMenuItem(TR("Find previous"), fFindPreviousMenuItem = new BMenuItem(B_TRANSLATE("Find previous"),
new BMessage(MENU_FIND_PREVIOUS), 'G', B_SHIFT_KEY); new BMessage(MENU_FIND_PREVIOUS), 'G', B_SHIFT_KEY);
fEditmenu->AddItem(fFindPreviousMenuItem); fEditmenu->AddItem(fFindPreviousMenuItem);
fFindPreviousMenuItem->SetEnabled(false); fFindPreviousMenuItem->SetEnabled(false);
fFindNextMenuItem = new BMenuItem(TR("Find next"), fFindNextMenuItem = new BMenuItem(B_TRANSLATE("Find next"),
new BMessage(MENU_FIND_NEXT), 'G'); new BMessage(MENU_FIND_NEXT), 'G');
fEditmenu->AddItem(fFindNextMenuItem); fEditmenu->AddItem(fFindNextMenuItem);
fFindNextMenuItem->SetEnabled(false); fFindNextMenuItem->SetEnabled(false);
@@ -331,17 +336,17 @@ TermWindow::_SetupMenu()
fMenubar->AddItem(fEditmenu); fMenubar->AddItem(fEditmenu);
// Make Help Menu. // Make Help Menu.
fHelpmenu = new BMenu(TR("Settings")); fHelpmenu = new BMenu(B_TRANSLATE("Settings"));
fWindowSizeMenu = _MakeWindowSizeMenu(); fWindowSizeMenu = _MakeWindowSizeMenu();
fEncodingmenu = _MakeEncodingMenu(); fEncodingmenu = _MakeEncodingMenu();
fSizeMenu = new BMenu(TR("Text size")); fSizeMenu = new BMenu(B_TRANSLATE("Text size"));
fIncreaseFontSizeMenuItem = new BMenuItem(TR("Increase"), fIncreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Increase"),
new BMessage(kIncreaseFontSize), '+', B_COMMAND_KEY); new BMessage(kIncreaseFontSize), '+', B_COMMAND_KEY);
fDecreaseFontSizeMenuItem = new BMenuItem(TR("Decrease"), fDecreaseFontSizeMenuItem = new BMenuItem(B_TRANSLATE("Decrease"),
new BMessage(kDecreaseFontSize), '-', B_COMMAND_KEY); new BMessage(kDecreaseFontSize), '-', B_COMMAND_KEY);
fSizeMenu->AddItem(fIncreaseFontSizeMenuItem); fSizeMenu->AddItem(fIncreaseFontSizeMenuItem);
@@ -351,10 +356,10 @@ TermWindow::_SetupMenu()
fHelpmenu->AddItem(fEncodingmenu); fHelpmenu->AddItem(fEncodingmenu);
fHelpmenu->AddItem(fSizeMenu); fHelpmenu->AddItem(fSizeMenu);
fHelpmenu->AddSeparatorItem(); fHelpmenu->AddSeparatorItem();
fHelpmenu->AddItem(new BMenuItem(TR("Settings" B_UTF8_ELLIPSIS), fHelpmenu->AddItem(new BMenuItem(B_TRANSLATE("Settings" B_UTF8_ELLIPSIS),
new BMessage(MENU_PREF_OPEN))); new BMessage(MENU_PREF_OPEN)));
fHelpmenu->AddSeparatorItem(); fHelpmenu->AddSeparatorItem();
fHelpmenu->AddItem(new BMenuItem(TR("Save as default"), fHelpmenu->AddItem(new BMenuItem(B_TRANSLATE("Save as default"),
new BMessage(SAVE_AS_DEFAULT))); new BMessage(SAVE_AS_DEFAULT)));
fMenubar->AddItem(fHelpmenu); fMenubar->AddItem(fHelpmenu);
@@ -455,9 +460,11 @@ TermWindow::MessageReceived(BMessage *message)
if (fFindString.Length() == 0) { if (fFindString.Length() == 0) {
const char* errorMsg = !fFindSelection const char* errorMsg = !fFindSelection
? TR("No search string was entered.") : TR("Nothing is selected."); ? B_TRANSLATE("No search string was entered.")
BAlert* alert = new BAlert(TR("Find failed"), errorMsg, TR("OK"), NULL, : B_TRANSLATE("Nothing is selected.");
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); BAlert* alert = new BAlert(B_TRANSLATE("Find failed"),
errorMsg, B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->Go(); alert->Go();
fFindPreviousMenuItem->SetEnabled(false); fFindPreviousMenuItem->SetEnabled(false);
@@ -471,8 +478,10 @@ TermWindow::MessageReceived(BMessage *message)
findresult = _ActiveTermView()->Find(fFindString, fForwardSearch, fMatchCase, fMatchWord); findresult = _ActiveTermView()->Find(fFindString, fForwardSearch, fMatchCase, fMatchWord);
if (!findresult) { if (!findresult) {
BAlert *alert = new BAlert(TR("Find failed"), TR("Text not found."), TR("OK"), NULL, BAlert *alert = new BAlert(B_TRANSLATE("Find failed"),
NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); B_TRANSLATE("Text not found."),
B_TRANSLATE("OK"), NULL, NULL,
B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
fFindPreviousMenuItem->SetEnabled(false); fFindPreviousMenuItem->SetEnabled(false);
@@ -492,7 +501,8 @@ TermWindow::MessageReceived(BMessage *message)
(message->what == MENU_FIND_NEXT) == fForwardSearch, (message->what == MENU_FIND_NEXT) == fForwardSearch,
fMatchCase, fMatchWord); fMatchCase, fMatchWord);
if (!findresult) { if (!findresult) {
BAlert *alert = new BAlert(TR("Find failed"), TR("Not found."), TR("OK"), BAlert *alert = new BAlert(B_TRANSLATE("Find failed"),
B_TRANSLATE("Not found."), B_TRANSLATE("OK"),
NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
alert->SetShortcut(0, B_ESCAPE); alert->SetShortcut(0, B_ESCAPE);
alert->Go(); alert->Go();
@@ -723,7 +733,8 @@ void
TermWindow::_DoPrint() TermWindow::_DoPrint()
{ {
if (!fPrintSettings || (_DoPageSetup() != B_OK)) { if (!fPrintSettings || (_DoPageSetup() != B_OK)) {
(new BAlert(TR("Cancel"), TR("Print cancelled."), TR("OK")))->Go(); (new BAlert(B_TRANSLATE("Cancel"), B_TRANSLATE("Print cancelled."),
B_TRANSLATE("OK")))->Go();
return; return;
} }
@@ -982,7 +993,7 @@ TermWindow::_ResizeView(TermView *view)
BMenu* BMenu*
TermWindow::_MakeWindowSizeMenu() TermWindow::_MakeWindowSizeMenu()
{ {
BMenu *menu = new (std::nothrow) BMenu(TR("Window size")); BMenu *menu = new (std::nothrow) BMenu(B_TRANSLATE("Window size"));
if (menu == NULL) if (menu == NULL)
return NULL; return NULL;
@@ -1006,8 +1017,8 @@ TermWindow::_MakeWindowSizeMenu()
} }
menu->AddSeparatorItem(); menu->AddSeparatorItem();
menu->AddItem(new BMenuItem(TR("Full screen"), new BMessage(FULLSCREEN), menu->AddItem(new BMenuItem(B_TRANSLATE("Full screen"),
B_ENTER)); new BMessage(FULLSCREEN), B_ENTER));
return menu; return menu;
} }