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
+20 -20
View File
@@ -62,17 +62,17 @@ AppearancePrefView::AppearancePrefView(const char* name,
}; };
SetLayout(new BGroupLayout(B_HORIZONTAL)); SetLayout(new BGroupLayout(B_HORIZONTAL));
BMenu* fontMenu = _MakeFontMenu(MSG_HALF_FONT_CHANGED, BMenu* fontMenu = _MakeFontMenu(MSG_HALF_FONT_CHANGED,
PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY), PrefHandler::Default()->getString(PREF_HALF_FONT_FAMILY),
PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE)); PrefHandler::Default()->getString(PREF_HALF_FONT_STYLE));
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]));
@@ -93,9 +93,9 @@ AppearancePrefView::AppearancePrefView(const char* name,
B_CELLS_32x8, 8.0, "", new BMessage(MSG_COLOR_CHANGED))) B_CELLS_32x8, 8.0, "", new BMessage(MSG_COLOR_CHANGED)))
.End() .End()
.End(); .End();
AddChild(layoutView); AddChild(layoutView);
fFont->SetAlignment(B_ALIGN_RIGHT); fFont->SetAlignment(B_ALIGN_RIGHT);
fFontSize->SetAlignment(B_ALIGN_RIGHT); fFontSize->SetAlignment(B_ALIGN_RIGHT);
fColorField->SetAlignment(B_ALIGN_RIGHT); fColorField->SetAlignment(B_ALIGN_RIGHT);
@@ -105,7 +105,7 @@ AppearancePrefView::AppearancePrefView(const char* name,
BTextControl* redInput = (BTextControl*)fColorControl->ChildAt(0); BTextControl* redInput = (BTextControl*)fColorControl->ChildAt(0);
BTextControl* greenInput = (BTextControl*)fColorControl->ChildAt(1); BTextControl* greenInput = (BTextControl*)fColorControl->ChildAt(1);
BTextControl* blueInput = (BTextControl*)fColorControl->ChildAt(2); BTextControl* blueInput = (BTextControl*)fColorControl->ChildAt(2);
redInput->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); redInput->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
greenInput->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); greenInput->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
blueInput->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT); blueInput->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
@@ -160,16 +160,16 @@ AppearancePrefView::MessageReceived(BMessage* msg)
const char* style = NULL; const char* style = NULL;
msg->FindString("font_family", &family); msg->FindString("font_family", &family);
msg->FindString("font_style", &style); msg->FindString("font_style", &style);
PrefHandler* pref = PrefHandler::Default(); PrefHandler* pref = PrefHandler::Default();
const char* currentFamily const char* currentFamily
= pref->getString(PREF_HALF_FONT_FAMILY); = pref->getString(PREF_HALF_FONT_FAMILY);
const char* currentStyle const char* currentStyle
= pref->getString(PREF_HALF_FONT_STYLE); = pref->getString(PREF_HALF_FONT_STYLE);
if (currentFamily == NULL || strcmp(currentFamily, family) if (currentFamily == NULL || strcmp(currentFamily, family)
|| currentStyle == NULL || strcmp(currentStyle, style)) { || currentStyle == NULL || strcmp(currentStyle, style)) {
pref->setString(PREF_HALF_FONT_FAMILY, family); pref->setString(PREF_HALF_FONT_FAMILY, family);
pref->setString(PREF_HALF_FONT_STYLE, style); pref->setString(PREF_HALF_FONT_STYLE, style);
modified = true; modified = true;
} }
break; break;
@@ -177,7 +177,7 @@ AppearancePrefView::MessageReceived(BMessage* msg)
case MSG_HALF_SIZE_CHANGED: case MSG_HALF_SIZE_CHANGED:
if (strcmp(PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE), if (strcmp(PrefHandler::Default()->getString(PREF_HALF_FONT_SIZE),
fFontSize->Menu()->FindMarked()->Label())) { fFontSize->Menu()->FindMarked()->Label())) {
PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE, PrefHandler::Default()->setString(PREF_HALF_FONT_SIZE,
fFontSize->Menu()->FindMarked()->Label()); fFontSize->Menu()->FindMarked()->Label());
modified = true; modified = true;
@@ -224,23 +224,23 @@ IsFontUsable(const BFont& font)
if (font.IsFixed()) if (font.IsFixed())
return true; return true;
// manually check if all applicable chars are the same width // manually check if all applicable chars are the same width
char buffer[2] = { ' ', 0 }; char buffer[2] = { ' ', 0 };
int firstWidth = (int)ceilf(font.StringWidth(buffer)); int firstWidth = (int)ceilf(font.StringWidth(buffer));
// TODO: Workaround for broken fonts/font_subsystem // TODO: Workaround for broken fonts/font_subsystem
if (firstWidth <= 0) if (firstWidth <= 0)
return false; return false;
for (int c = ' '+1; c <= 0x7e; c++) { for (int c = ' '+1; c <= 0x7e; c++) {
buffer[0] = c; buffer[0] = c;
int width = (int)ceilf(font.StringWidth(buffer)); int width = (int)ceilf(font.StringWidth(buffer));
if (width != firstWidth) if (width != firstWidth)
return false; return false;
} }
return true; return true;
} }
@@ -253,7 +253,7 @@ AppearancePrefView::_MakeFontMenu(uint32 command,
BPopUpMenu* menu = new BPopUpMenu(""); BPopUpMenu* menu = new BPopUpMenu("");
int32 numFamilies = count_font_families(); int32 numFamilies = count_font_families();
uint32 flags; uint32 flags;
for (int32 i = 0; i < numFamilies; i++) { for (int32 i = 0; i < numFamilies; i++) {
font_family family; font_family family;
if (get_font_family(i, &family, &flags) == B_OK) { if (get_font_family(i, &family, &flags) == B_OK) {
@@ -281,7 +281,7 @@ AppearancePrefView::_MakeFontMenu(uint32 command,
} }
} }
} }
if (menu->FindMarked() == NULL) if (menu->FindMarked() == NULL)
menu->ItemAt(0)->SetMarked(true); menu->ItemAt(0)->SetMarked(true);
+5 -4
View File
@@ -46,7 +46,7 @@ Arguments::Parse(int argc, const char *const *argv)
if (*arg == '-') { if (*arg == '-') {
if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) { if (strcmp(arg, "-h") == 0 || strcmp(arg, "--help") == 0) {
fUsageRequested = true; fUsageRequested = true;
/*} else if (strcmp(arg, "-l") == 0) { /*} else if (strcmp(arg, "-l") == 0) {
// location // location
float x, y; float x, y;
@@ -78,11 +78,12 @@ Arguments::Parse(int argc, const char *const *argv)
fTitle = argv[argi++]; fTitle = argv[argi++];
} else if (strcmp(arg, "-f") == 0 || strcmp(arg, "--fullscreen") == 0) { } else if (strcmp(arg, "-f") == 0 || strcmp(arg, "--fullscreen") == 0) {
fFullScreen = true; fFullScreen = true;
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);
+10 -9
View File
@@ -2,7 +2,7 @@
* Copyright 2003-2007, Haiku, Inc. All Rights Reserved. * Copyright 2003-2007, Haiku, Inc. All Rights Reserved.
* Copyright (c) 2004 Daniel Furrer <[email protected]> * Copyright (c) 2004 Daniel Furrer <[email protected]>
* Copyright (c) 2003-4 Kian Duffy <[email protected]> * Copyright (c) 2003-4 Kian Duffy <[email protected]>
* Copyright (c) 1998,99 Kazuho Okui and Takashi Murai. * Copyright (c) 1998,99 Kazuho Okui and Takashi Murai.
* *
* Distributed unter the terms of the MIT License. * Distributed unter the terms of the MIT License.
*/ */
@@ -130,13 +130,13 @@ PrefHandler::GetDefaultPath(BPath& path)
status = path.Append("Terminal"); status = path.Append("Terminal");
if (status != B_OK) if (status != B_OK)
return status; return status;
// Just create the directory. Harmless if already there // Just create the directory. Harmless if already there
status = create_directory(path.Path(), 0755); status = create_directory(path.Path(), 0755);
if (status != B_OK) if (status != B_OK)
return status; return status;
#ifdef HAIKU_TARGET_PLATFORM_HAIKU #ifdef HAIKU_TARGET_PLATFORM_HAIKU
status = path.Append("Default"); status = path.Append("Default");
#else #else
status = path.Append("HaikuTerminal_settings"); status = path.Append("HaikuTerminal_settings");
@@ -220,7 +220,7 @@ PrefHandler::SaveAsText(const char *path, const char *mimetype,
} }
int32 int32
PrefHandler::getInt32(const char *key) PrefHandler::getInt32(const char *key)
{ {
const char *value = fContainer.FindString(key); const char *value = fContainer.FindString(key);
@@ -231,7 +231,7 @@ PrefHandler::getInt32(const char *key)
} }
float float
PrefHandler::getFloat(const char *key) PrefHandler::getFloat(const char *key)
{ {
const char *value = fContainer.FindString(key); const char *value = fContainer.FindString(key);
@@ -244,12 +244,12 @@ PrefHandler::getFloat(const char *key)
#undef TR_CONTEXT #undef TR_CONTEXT
#define TR_CONTEXT "Terminal getString" #define TR_CONTEXT "Terminal getString"
const char* const char*
PrefHandler::getString(const char *key) 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;
} }
+17 -15
View File
@@ -1,7 +1,7 @@
/* /*
* Copyright 2007-2009, Haiku, Inc. All rights reserved. * Copyright 2007-2009, Haiku, Inc. All rights reserved.
* Copyright 2003-2004 Kian Duffy, [email protected] * Copyright 2003-2004 Kian Duffy, [email protected]
* Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai. * Parts Copyright 1998-1999 Kazuho Okui and Takashi Murai.
* All rights reserved. Distributed under the terms of the MIT license. * All rights reserved. Distributed under the terms of the MIT license.
*/ */
@@ -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,22 +38,23 @@ 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();
fSaveButton->MakeDefault(true); fSaveButton->MakeDefault(true);
AddShortcut('Q', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); AddShortcut('Q', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED));
AddShortcut('W', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED)); AddShortcut('W', B_COMMAND_KEY, new BMessage(B_QUIT_REQUESTED));
@@ -83,13 +84,14 @@ 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);
alert->SetShortcut(1, 'd'); alert->SetShortcut(1, 'd');
alert->SetShortcut(2, 's'); alert->SetShortcut(2, 's');
int32 index = alert->Go(); int32 index = alert->Go();
if (index == 0) if (index == 0)
@@ -111,7 +113,7 @@ PrefWindow::_SaveAs()
BMessenger messenger(this); BMessenger messenger(this);
fSavePanel = new BFilePanel(B_SAVE_PANEL, &messenger); fSavePanel = new BFilePanel(B_SAVE_PANEL, &messenger);
} }
fSavePanel->Show(); fSavePanel->Show();
} }
+10 -9
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);
} }
@@ -517,8 +518,8 @@ 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);
+28 -26
View File
@@ -1,7 +1,7 @@
/* /*
* Copyright 2001-2009, Haiku, Inc. All rights reserved. * Copyright 2001-2009, Haiku, Inc. All rights reserved.
* Copyright (c) 2003-2004 Kian Duffy <myob@users.sourceforge.net> * Copyright (c) 2003-2004 Kian Duffy <myob@users.sourceforge.net>
* Copyright (C) 1998,99 Kazuho Okui and Takashi Murai. * Copyright (C) 1998,99 Kazuho Okui and Takashi Murai.
* *
* Distributed unter the terms of the MIT license. * Distributed unter the terms of the MIT license.
*/ */
@@ -67,7 +67,7 @@ TermApp::TermApp()
const char *defaultArgs[2]; const char *defaultArgs[2];
defaultArgs[0] = kDefaultShell; defaultArgs[0] = kDefaultShell;
defaultArgs[1] = "--login"; defaultArgs[1] = "--login";
struct passwd passwdStruct; struct passwd passwdStruct;
struct passwd *passwdResult; struct passwd *passwdResult;
char stringBuffer[256]; char stringBuffer[256];
@@ -75,12 +75,12 @@ TermApp::TermApp()
sizeof(stringBuffer), &passwdResult)) { sizeof(stringBuffer), &passwdResult)) {
defaultArgs[0] = passwdStruct.pw_shell; defaultArgs[0] = passwdStruct.pw_shell;
} }
be_locale->GetAppCatalog(&fAppCatalog); be_locale->GetAppCatalog(&fAppCatalog);
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;
@@ -200,14 +202,14 @@ void
TermApp::ArgvReceived(int32 argc, char **argv) TermApp::ArgvReceived(int32 argc, char **argv)
{ {
fArgs->Parse(argc, argv); fArgs->Parse(argc, argv);
if (fArgs->UsageRequested()) { if (fArgs->UsageRequested()) {
_Usage(argv[0]); _Usage(argv[0]);
sUsageRequested = true; sUsageRequested = true;
PostMessage(B_QUIT_REQUESTED); PostMessage(B_QUIT_REQUESTED);
return; return;
} }
if (fArgs->Title() != NULL) if (fArgs->Title() != NULL)
fWindowTitle = fArgs->Title(); fWindowTitle = fArgs->Title();
@@ -216,17 +218,17 @@ TermApp::ArgvReceived(int32 argc, char **argv)
void void
TermApp::RefsReceived(BMessage* message) TermApp::RefsReceived(BMessage* message)
{ {
// Works Only Launced by Double-Click file, or Drags file to App. // Works Only Launced by Double-Click file, or Drags file to App.
if (!IsLaunching()) if (!IsLaunching())
return; return;
entry_ref ref; entry_ref ref;
if (message->FindRef("refs", 0, &ref) != B_OK) if (message->FindRef("refs", 0, &ref) != B_OK)
return; return;
BFile file; BFile file;
if (file.SetTo(&ref, B_READ_WRITE) != B_OK) if (file.SetTo(&ref, B_READ_WRITE) != B_OK)
return; return;
@@ -236,7 +238,7 @@ TermApp::RefsReceived(BMessage* message)
// if App opened by Pref file // if App opened by Pref file
if (!strcmp(mimetype, PREFFILE_MIMETYPE)) { if (!strcmp(mimetype, PREFFILE_MIMETYPE)) {
BEntry ent(&ref); BEntry ent(&ref);
BPath path(&ent); BPath path(&ent);
PrefHandler::Default()->OpenText(path.Path()); PrefHandler::Default()->OpenText(path.Path());
@@ -249,7 +251,7 @@ TermApp::RefsReceived(BMessage* message)
// beep(); // beep();
return; return;
} }
} }
status_t status_t
@@ -258,13 +260,13 @@ TermApp::_MakeTermWindow(BRect &frame)
try { try {
fTermWindow = new TermWindow(frame, fWindowTitle.String(), fArgs); fTermWindow = new TermWindow(frame, fWindowTitle.String(), fArgs);
} catch (int error) { } catch (int error) {
return (status_t)error; return (status_t)error;
} catch (...) { } catch (...) {
return B_ERROR; return B_ERROR;
} }
fTermWindow->Show(); fTermWindow->Show();
return B_OK; return B_OK;
} }
@@ -285,7 +287,7 @@ TermApp::_SwitchTerm()
{ {
team_id myId = be_app->Team(); team_id myId = be_app->Team();
BList teams; BList teams;
be_roster->GetAppList(TERM_SIGNATURE, &teams); be_roster->GetAppList(TERM_SIGNATURE, &teams);
int32 numTerms = teams.CountItems(); int32 numTerms = teams.CountItems();
if (numTerms <= 1) if (numTerms <= 1)
@@ -504,7 +506,7 @@ TermApp::_RegisterTerminal()
//#ifndef B_NETPOSITIVE_APP_SIGNATURE //#ifndef B_NETPOSITIVE_APP_SIGNATURE
//#define B_NETPOSITIVE_APP_SIGNATURE "application/x-vnd.Be-NPOS" //#define B_NETPOSITIVE_APP_SIGNATURE "application/x-vnd.Be-NPOS"
//#endif //#endif
// //
//void //void
@@ -518,7 +520,7 @@ TermApp::_RegisterTerminal()
// message.AddString("be:url", url); // message.AddString("be:url", url);
// be_roster->Launch(B_NETPOSITIVE_APP_SIGNATURE, &message); // be_roster->Launch(B_NETPOSITIVE_APP_SIGNATURE, &message);
// while(!(be_roster->IsRunning(B_NETPOSITIVE_APP_SIGNATURE))) // while(!(be_roster->IsRunning(B_NETPOSITIVE_APP_SIGNATURE)))
// snooze(10000); // snooze(10000);
// //
// // Activate net+ // // Activate net+
@@ -562,17 +564,17 @@ 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")
//" -geom, --geometry set window geometry\n" //" -geom, --geometry set window geometry\n"
//" An example of geometry is \"80x25+100+100\"\n" //" An example of geometry is \"80x25+100+100\"\n"
); );
+7 -7
View File
@@ -96,7 +96,7 @@ TermParse::StartThreads(TerminalBuffer *buffer)
fQuitting = false; fQuitting = false;
fBuffer = buffer; fBuffer = buffer;
status_t status = _InitPtyReader(); status_t status = _InitPtyReader();
if (status < B_OK) { if (status < B_OK) {
fBuffer = NULL; fBuffer = NULL;
@@ -143,7 +143,7 @@ TermParse::_InitTermParse()
if (fParseThread < 0) if (fParseThread < 0)
return fParseThread; return fParseThread;
resume_thread(fParseThread); resume_thread(fParseThread);
return B_OK; return B_OK;
@@ -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);
} }
@@ -332,7 +332,7 @@ TermParse::EscParse()
int32 srcLen; int32 srcLen;
int32 dstLen; int32 dstLen;
long dummyState = 0; long dummyState = 0;
int width = 1; int width = 1;
BAutolock locker(fBuffer); BAutolock locker(fBuffer);
@@ -1026,7 +1026,7 @@ TermParse::EscParse()
default: default:
break; break;
} }
} catch (...) { } catch (...) {
break; break;
} }
} }
+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;
} }