Ticket #5850: TerminalLocalizationRevision36520.patch
File TerminalLocalizationRevision36520.patch, 24.2 KB (added by , 15 years ago) |
---|
-
src/apps/terminal/TermWindow.cpp
16 16 17 17 #include <Alert.h> 18 18 #include <Application.h> 19 #include <Catalog.h> 19 20 #include <Clipboard.h> 20 21 #include <Dragger.h> 22 #include <Locale.h> 21 23 #include <Menu.h> 22 24 #include <MenuBar.h> 23 25 #include <MenuItem.h> … … 52 54 const static uint32 kDecreaseFontSize = 'DcFs'; 53 55 const static uint32 kSetActiveTab = 'STab'; 54 56 57 #undef TR_CONTEXT 58 #define TR_CONTEXT "Terminal TermWindow" 55 59 56 60 class CustomTermView : public TermView { 57 61 public: … … 253 257 BMenu * 254 258 TermWindow::_MakeEncodingMenu() 255 259 { 256 BMenu *menu = new (std::nothrow) BMenu( "Text encoding");260 BMenu *menu = new (std::nothrow) BMenu(TR("Text encoding")); 257 261 if (menu == NULL) 258 262 return NULL; 259 263 … … 282 286 fMenubar = new BMenuBar(Bounds(), "mbar"); 283 287 284 288 // Make File Menu. 285 fFilemenu = new BMenu( "Terminal");286 fFilemenu->AddItem(new BMenuItem( "Switch Terminals",289 fFilemenu = new BMenu(TR("Terminal")); 290 fFilemenu->AddItem(new BMenuItem(TR("Switch Terminals"), 287 291 new BMessage(MENU_SWITCH_TERM), B_TAB)); 288 fFilemenu->AddItem(new BMenuItem( "New Terminal",292 fFilemenu->AddItem(new BMenuItem(TR("New Terminal"), 289 293 new BMessage(MENU_NEW_TERM), 'N')); 290 fFilemenu->AddItem(new BMenuItem( "New tab", new BMessage(kNewTab), 'T'));294 fFilemenu->AddItem(new BMenuItem(TR("New tab"), new BMessage(kNewTab), 'T')); 291 295 292 296 fFilemenu->AddSeparatorItem(); 293 fFilemenu->AddItem(new BMenuItem( "Page setup" B_UTF8_ELLIPSIS,297 fFilemenu->AddItem(new BMenuItem(TR("Page setup" B_UTF8_ELLIPSIS), 294 298 new BMessage(MENU_PAGE_SETUP))); 295 fFilemenu->AddItem(new BMenuItem( "Print", new BMessage(MENU_PRINT),'P'));299 fFilemenu->AddItem(new BMenuItem(TR("Print"), new BMessage(MENU_PRINT),'P')); 296 300 fFilemenu->AddSeparatorItem(); 297 fFilemenu->AddItem(new BMenuItem( "About Terminal" B_UTF8_ELLIPSIS,301 fFilemenu->AddItem(new BMenuItem(TR("About Terminal" B_UTF8_ELLIPSIS), 298 302 new BMessage(B_ABOUT_REQUESTED))); 299 303 fFilemenu->AddSeparatorItem(); 300 fFilemenu->AddItem(new BMenuItem( "Close active tab",304 fFilemenu->AddItem(new BMenuItem(TR("Close active tab"), 301 305 new BMessage(kCloseView), 'W', B_SHIFT_KEY)); 302 fFilemenu->AddItem(new BMenuItem( "Quit",306 fFilemenu->AddItem(new BMenuItem(TR("Quit"), 303 307 new BMessage(B_QUIT_REQUESTED), 'Q')); 304 308 fMenubar->AddItem(fFilemenu); 305 309 306 310 // Make Edit Menu. 307 311 fEditmenu = new BMenu("Edit"); 308 fEditmenu->AddItem(new BMenuItem( "Copy", new BMessage(B_COPY),'C'));309 fEditmenu->AddItem(new BMenuItem( "Paste", new BMessage(B_PASTE),'V'));312 fEditmenu->AddItem(new BMenuItem(TR("Copy"), new BMessage(B_COPY),'C')); 313 fEditmenu->AddItem(new BMenuItem(TR("Paste"), new BMessage(B_PASTE),'V')); 310 314 fEditmenu->AddSeparatorItem(); 311 fEditmenu->AddItem(new BMenuItem( "Select all",315 fEditmenu->AddItem(new BMenuItem(TR("Select all"), 312 316 new BMessage(B_SELECT_ALL), 'A')); 313 fEditmenu->AddItem(new BMenuItem( "Clear all",317 fEditmenu->AddItem(new BMenuItem(TR("Clear all"), 314 318 new BMessage(MENU_CLEAR_ALL), 'L')); 315 319 fEditmenu->AddSeparatorItem(); 316 fEditmenu->AddItem(new BMenuItem( "Find" B_UTF8_ELLIPSIS,320 fEditmenu->AddItem(new BMenuItem(TR("Find" B_UTF8_ELLIPSIS), 317 321 new BMessage(MENU_FIND_STRING),'F')); 318 fFindPreviousMenuItem = new BMenuItem( "Find previous",322 fFindPreviousMenuItem = new BMenuItem(TR("Find previous"), 319 323 new BMessage(MENU_FIND_PREVIOUS), 'G', B_SHIFT_KEY); 320 324 fEditmenu->AddItem(fFindPreviousMenuItem); 321 325 fFindPreviousMenuItem->SetEnabled(false); 322 fFindNextMenuItem = new BMenuItem( "Find next",326 fFindNextMenuItem = new BMenuItem(TR("Find next"), 323 327 new BMessage(MENU_FIND_NEXT), 'G'); 324 328 fEditmenu->AddItem(fFindNextMenuItem); 325 329 fFindNextMenuItem->SetEnabled(false); … … 327 331 fMenubar->AddItem(fEditmenu); 328 332 329 333 // Make Help Menu. 330 fHelpmenu = new BMenu( "Settings");334 fHelpmenu = new BMenu(TR("Settings")); 331 335 fWindowSizeMenu = _MakeWindowSizeMenu(); 332 336 333 337 fEncodingmenu = _MakeEncodingMenu(); 334 338 335 fSizeMenu = new BMenu( "Text size");339 fSizeMenu = new BMenu(TR("Text size")); 336 340 337 fIncreaseFontSizeMenuItem = new BMenuItem( "Increase",341 fIncreaseFontSizeMenuItem = new BMenuItem(TR("Increase"), 338 342 new BMessage(kIncreaseFontSize), '+', B_COMMAND_KEY); 339 343 340 fDecreaseFontSizeMenuItem = new BMenuItem( "Decrease",344 fDecreaseFontSizeMenuItem = new BMenuItem(TR("Decrease"), 341 345 new BMessage(kDecreaseFontSize), '-', B_COMMAND_KEY); 342 346 343 347 fSizeMenu->AddItem(fIncreaseFontSizeMenuItem); … … 347 351 fHelpmenu->AddItem(fEncodingmenu); 348 352 fHelpmenu->AddItem(fSizeMenu); 349 353 fHelpmenu->AddSeparatorItem(); 350 fHelpmenu->AddItem(new BMenuItem( "Settings" B_UTF8_ELLIPSIS,354 fHelpmenu->AddItem(new BMenuItem(TR("Settings" B_UTF8_ELLIPSIS), 351 355 new BMessage(MENU_PREF_OPEN))); 352 356 fHelpmenu->AddSeparatorItem(); 353 fHelpmenu->AddItem(new BMenuItem( "Save as default",357 fHelpmenu->AddItem(new BMenuItem(TR("Save as default"), 354 358 new BMessage(SAVE_AS_DEFAULT))); 355 359 fMenubar->AddItem(fHelpmenu); 356 360 … … 451 455 452 456 if (fFindString.Length() == 0) { 453 457 const char* errorMsg = !fFindSelection 454 ? "No search string was entered." : "Nothing is selected.";455 BAlert* alert = new BAlert( "Find failed", errorMsg, "OK", NULL,458 ? TR("No search string was entered.") : TR("Nothing is selected."); 459 BAlert* alert = new BAlert(TR("Find failed"), errorMsg, TR("OK"), NULL, 456 460 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 457 461 458 462 alert->Go(); … … 467 471 findresult = _ActiveTermView()->Find(fFindString, fForwardSearch, fMatchCase, fMatchWord); 468 472 469 473 if (!findresult) { 470 BAlert *alert = new BAlert( "Find failed", "Text not found.", "OK", NULL,474 BAlert *alert = new BAlert(TR("Find failed"), TR("Text not found."), TR("OK"), NULL, 471 475 NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 472 476 alert->SetShortcut(0, B_ESCAPE); 473 477 alert->Go(); … … 488 492 (message->what == MENU_FIND_NEXT) == fForwardSearch, 489 493 fMatchCase, fMatchWord); 490 494 if (!findresult) { 491 BAlert *alert = new BAlert( "Find failed", "Not found.", "OK",495 BAlert *alert = new BAlert(TR("Find failed"), TR("Not found."), TR("OK"), 492 496 NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); 493 497 alert->SetShortcut(0, B_ESCAPE); 494 498 alert->Go(); … … 719 723 TermWindow::_DoPrint() 720 724 { 721 725 if (!fPrintSettings || (_DoPageSetup() != B_OK)) { 722 (new BAlert( "Cancel", "Print cancelled.", "OK"))->Go();726 (new BAlert(TR("Cancel"), TR("Print cancelled."), TR("OK")))->Go(); 723 727 return; 724 728 } 725 729 … … 978 982 BMenu* 979 983 TermWindow::_MakeWindowSizeMenu() 980 984 { 981 BMenu *menu = new (std::nothrow) BMenu( "Window size");985 BMenu *menu = new (std::nothrow) BMenu(TR("Window size")); 982 986 if (menu == NULL) 983 987 return NULL; 984 988 … … 1002 1006 } 1003 1007 1004 1008 menu->AddSeparatorItem(); 1005 menu->AddItem(new BMenuItem( "Full screen", new BMessage(FULLSCREEN),1009 menu->AddItem(new BMenuItem(TR("Full screen"), new BMessage(FULLSCREEN), 1006 1010 B_ENTER)); 1007 1011 1008 1012 return menu; -
src/apps/terminal/TermParse.cpp
18 18 19 19 #include <Autolock.h> 20 20 #include <Beep.h> 21 #include <Catalog.h> 22 #include <Locale.h> 21 23 #include <Message.h> 22 24 #include <UTF8.h> 23 25 … … 45 47 #define DEFAULT -1 46 48 #define NPARAM 10 // Max parameters 47 49 50 #undef TR_CONTEXT 51 #define TR_CONTEXT "Terminal TermParse" 48 52 49 53 //! Get char from pty reader buffer. 50 54 inline uchar … … 287 291 { NULL, NULL } 288 292 }; 289 293 int i; 290 fprintf(stderr, "groundtable: ");294 fprintf(stderr, TR("groundtable: ")); 291 295 for (i = 0; tables[i].p; i++) { 292 296 if (tables[i].p == groundtable) 293 297 fprintf(stderr, "%s\t", tables[i].name); 294 298 } 295 fprintf(stderr, "parsestate: ");299 fprintf(stderr, TR("parsestate: ")); 296 300 for (i = 0; tables[i].p; i++) { 297 301 if (tables[i].p == parsestate) 298 302 fprintf(stderr, "%s\t", tables[i].name); 299 303 } 300 fprintf(stderr, "char: 0x%02x (%d)\n", c, c);304 fprintf(stderr, TR("char: 0x%02x (%d)\n"), c, c); 301 305 } 302 306 303 307 -
src/apps/terminal/TermView.cpp
27 27 #include <Alert.h> 28 28 #include <Application.h> 29 29 #include <Beep.h> 30 #include <Catalog.h> 30 31 #include <Clipboard.h> 31 32 #include <Debug.h> 32 33 #include <Directory.h> 33 34 #include <Dragger.h> 34 35 #include <Input.h> 36 #include <Locale.h> 35 37 #include <MenuItem.h> 36 38 #include <Message.h> 37 39 #include <MessageRunner.h> … … 81 83 SELECT_LINES 82 84 }; 83 85 86 #undef TR_CONTEXT 87 #define TR_CONTEXT "Terminal TermView" 84 88 85 89 static property_info sPropList[] = { 86 90 { "encoding", … … 1427 1431 bool hasResizeView = fResizeRunner != NULL; 1428 1432 if (!hasResizeView) { 1429 1433 // show the current size in a view 1430 fResizeView = new BStringView(BRect(100, 100, 300, 140), "size", "");1434 fResizeView = new BStringView(BRect(100, 100, 300, 140), TR("size"), ""); 1431 1435 fResizeView->SetAlignment(B_ALIGN_CENTER); 1432 1436 fResizeView->SetFont(be_bold_font); 1433 1437 … … 1821 1825 cpMessage->what = kSecondaryMouseDropAction; 1822 1826 cpMessage->AddInt8("action", kCopyFiles); 1823 1827 1824 BMenuItem* insertItem = new BMenuItem( "Insert path", insertMessage);1825 BMenuItem* cdItem = new BMenuItem( "Change directory", cdMessage);1826 BMenuItem* lnItem = new BMenuItem( "Create link here", lnMessage);1827 BMenuItem* mvItem = new BMenuItem( "Move here", mvMessage);1828 BMenuItem* cpItem = new BMenuItem( "Copy here", cpMessage);1829 BMenuItem* chItem = new BMenuItem( "Cancel", NULL);1828 BMenuItem* insertItem = new BMenuItem(TR("Insert path"), insertMessage); 1829 BMenuItem* cdItem = new BMenuItem(TR("Change directory"), cdMessage); 1830 BMenuItem* lnItem = new BMenuItem(TR("Create link here"), lnMessage); 1831 BMenuItem* mvItem = new BMenuItem(TR("Move here"), mvMessage); 1832 BMenuItem* cpItem = new BMenuItem(TR("Copy here"), cpMessage); 1833 BMenuItem* chItem = new BMenuItem(TR("Cancel"), NULL); 1830 1834 1831 1835 // if the refs point to different directorys disable the cd menu item 1832 1836 bool differentDirs = false; … … 1854 1858 if (differentDirs) 1855 1859 cdItem->SetEnabled(false); 1856 1860 1857 BPopUpMenu *menu = new BPopUpMenu( "Secondary Mouse Button Drop Menu");1861 BPopUpMenu *menu = new BPopUpMenu(TR("Secondary Mouse Button Drop Menu")); 1858 1862 menu->SetAsyncAutoDestruct(true); 1859 1863 menu->AddItem(insertItem); 1860 1864 menu->AddSeparatorItem(); … … 2764 2768 TermView::AboutRequested() 2765 2769 { 2766 2770 BAlert *alert = new (std::nothrow) BAlert("about", 2767 "Terminal\n\n"2771 TR("Terminal\n\n" 2768 2772 "written by Kazuho Okui and Takashi Murai\n" 2769 2773 "updated by Kian Duffy and others\n\n" 2770 "Copyright " B_UTF8_COPYRIGHT "2003-2009, Haiku.\n" , "OK");2774 "Copyright " B_UTF8_COPYRIGHT "2003-2009, Haiku.\n"), TR("OK")); 2771 2775 if (alert != NULL) 2772 2776 alert->Go(); 2773 2777 } -
src/apps/terminal/PrefWindow.cpp
14 14 #include <Alert.h> 15 15 #include <Box.h> 16 16 #include <Button.h> 17 #include <Catalog.h> 17 18 #include <FilePanel.h> 18 19 #include <GroupLayoutBuilder.h> 19 20 #include <LayoutBuilder.h> 21 #include <Locale.h> 20 22 #include <Path.h> 21 23 22 24 #include <stdio.h> 23 25 26 #undef TR_CONTEXT 27 #define TR_CONTEXT "Terminal PrefWindow" 24 28 25 29 PrefWindow::PrefWindow(const BMessenger &messenger) 26 : BWindow(BRect(0, 0, 375, 185), "Terminal settings",30 : BWindow(BRect(0, 0, 375, 185), TR("Terminal settings"), 27 31 B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 28 32 B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_AUTO_UPDATE_SIZE_LIMITS), 29 33 fPreviousPref(new PrefHandler(PrefHandler::Default())), … … 34 38 BLayoutBuilder::Group<>(this, B_VERTICAL) 35 39 .AddGroup(B_VERTICAL) 36 40 .SetInsets(10, 10, 10, 10) 37 .Add(new AppearancePrefView( "Appearance", fTerminalMessenger))41 .Add(new AppearancePrefView(TR("Appearance"), fTerminalMessenger)) 38 42 .AddGroup(B_HORIZONTAL) 39 43 .Add(fSaveAsFileButton = new BButton("savebutton", 40 "Save to file" B_UTF8_ELLIPSIS,44 TR("Save to file" B_UTF8_ELLIPSIS), 41 45 new BMessage(MSG_SAVEAS_PRESSED), B_WILL_DRAW)) 42 46 .AddGlue() 43 47 .Add(fRevertButton = new BButton("revertbutton", 44 "Cancel", new BMessage(MSG_REVERT_PRESSED),48 TR("Cancel"), new BMessage(MSG_REVERT_PRESSED), 45 49 B_WILL_DRAW)) 46 .Add(fSaveButton = new BButton("okbutton", "OK",50 .Add(fSaveButton = new BButton("okbutton", TR("OK"), 47 51 new BMessage(MSG_SAVE_PRESSED), B_WILL_DRAW)) 48 52 .End() 49 53 .End(); … … 79 83 if (!fDirty) 80 84 return true; 81 85 82 BAlert *alert = new BAlert("", "Save changes to this settings panel?",83 "Cancel", "Don't save", "Save",86 BAlert *alert = new BAlert("", TR("Save changes to this settings panel?"), 87 TR("Cancel"), TR("Don't save"), TR("Save"), 84 88 B_WIDTH_AS_USUAL, B_OFFSET_SPACING, 85 89 B_WARNING_ALERT); 86 90 alert->SetShortcut(0, B_ESCAPE); -
src/apps/terminal/Arguments.cpp
9 9 10 10 #include "Arguments.h" 11 11 12 #include <Catalog.h> 13 #include <Locale.h> 12 14 13 15 Arguments::Arguments(int defaultArgsNum, const char * const *defaultArgs) 14 16 : fUsageRequested(false), … … 28 30 _SetShellArguments(0, NULL); 29 31 } 30 32 33 #undef TR_CONTEXT 34 #define TR_CONTEXT "Terminal arguments parsing" 31 35 32 36 void 33 37 Arguments::Parse(int argc, const char *const *argv) … … 75 79 argi++; 76 80 } else { 77 81 // illegal option 78 fprintf(stderr, "Unrecognized option \"%s\"\n", arg);82 fprintf(stderr, TR("Unrecognized option \"%s\"\n"), arg); 79 83 fUsageRequested = true; 80 84 } 81 85 -
src/apps/terminal/Shell.cpp
27 27 #include <time.h> 28 28 #include <unistd.h> 29 29 30 #include <Catalog.h> 30 31 #include <OS.h> 32 #include <Locale.h> 31 33 32 34 #include "TermConst.h" 33 35 #include "TermParse.h" … … 316 318 tio.c_cc[VSUSP] = CSUSP; /* '^Z' */ 317 319 } 318 320 321 #undef TR_CONTEXT 322 #define TR_CONTEXT "Terminal Shell" 319 323 320 324 status_t 321 325 Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **argv) … … 360 364 } else { 361 365 // B_BUSY is a normal case 362 366 if (errno != B_BUSY) 363 fprintf(stderr, "could not open %s: %s\n", ptyName, strerror(errno));367 fprintf(stderr, TR("could not open %s: %s\n"), ptyName, strerror(errno)); 364 368 } 365 369 } 366 370 closedir(dir); … … 368 372 #endif /* __HAIKU__ */ 369 373 370 374 if (master < 0) { 371 fprintf(stderr, "Didn't find any available pseudo ttys.");375 fprintf(stderr, TR("Didn't find any available pseudo ttys.")); 372 376 return errno; 373 377 } 374 378 … … 376 380 if (grantpt(master) != 0 || unlockpt(master) != 0 377 381 || (ttyName = ptsname(master)) == NULL) { 378 382 close(master); 379 fprintf(stderr, "Failed to init pseudo tty.");383 fprintf(stderr, TR("Failed to init pseudo tty.")); 380 384 return errno; 381 385 } 382 386 #endif /* __HAIKU__ */ … … 411 415 if (setsid() < 0) { 412 416 handshake.status = PTY_NG; 413 417 snprintf(handshake.msg, sizeof(handshake.msg), 414 "could not set session leader.");418 TR("could not set session leader.")); 415 419 send_handshake_message(terminalThread, handshake); 416 420 exit(1); 417 421 } … … 421 425 if ((slave = open(ttyName, O_RDWR)) < 0) { 422 426 handshake.status = PTY_NG; 423 427 snprintf(handshake.msg, sizeof(handshake.msg), 424 "can't open tty (%s).", ttyName);428 TR("can't open tty (%s)."), ttyName); 425 429 send_handshake_message(terminalThread, handshake); 426 430 exit(1); 427 431 } … … 460 464 if (tcsetattr(0, TCSANOW, &tio) == -1) { 461 465 handshake.status = PTY_NG; 462 466 snprintf(handshake.msg, sizeof(handshake.msg), 463 "failed set terminal interface (TERMIOS).");467 TR("failed set terminal interface (TERMIOS).")); 464 468 send_handshake_message(terminalThread, handshake); 465 469 exit(1); 466 470 } … … 476 480 if (handshake.status != PTY_WS) { 477 481 handshake.status = PTY_NG; 478 482 snprintf(handshake.msg, sizeof(handshake.msg), 479 "mismatch handshake.");483 TR("mismatch handshake.")); 480 484 send_handshake_message(terminalThread, handshake); 481 485 exit(1); 482 486 } … … 512 516 */ 513 517 514 518 sleep(1); 515 const char *spawnAlertMessage = "alert --stop "519 const char *spawnAlertMessage = TR("alert --stop " 516 520 "'Cannot execute \"%s\":\n" 517 521 "\t%s' " 518 "'Use default shell' 'Abort'" ;522 "'Use default shell' 'Abort'"); 519 523 char errorMessage[256]; 520 524 snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, argv[0], strerror(errno)); 521 525 -
src/apps/terminal/TermApp.cpp
17 17 #include <unistd.h> 18 18 19 19 #include <Alert.h> 20 #include <Catalog.h> 20 21 #include <Clipboard.h> 22 #include <Catalog.h> 21 23 #include <NodeInfo.h> 22 24 #include <Path.h> 23 25 #include <Roster.h> … … 50 52 return 0; 51 53 } 52 54 53 55 #undef TR_CONTEXT 56 #define TR_CONTEXT "Terminal TermApp" 57 54 58 TermApp::TermApp() 55 59 : BApplication(TERM_SIGNATURE), 56 60 fStartFullscreen(false), … … 72 76 73 77 fArgs = new Arguments(2, defaultArgs); 74 78 75 fWindowTitle = "Terminal";79 fWindowTitle = TR("Terminal"); 76 80 _RegisterTerminal(); 77 81 78 82 if (fWindowNumber > 0) … … 114 118 #endif 115 119 action.sa_userdata = this; 116 120 if (sigaction(SIGCHLD, &action, NULL) < 0) { 117 fprintf(stderr, "sigaction() failed: %s\n", strerror(errno));121 fprintf(stderr, TR("sigaction() failed: %s\n"), strerror(errno)); 118 122 // continue anyway 119 123 } 120 124 … … 126 130 // failed spawn, print stdout and open alert panel 127 131 // TODO: This alert does never show up. 128 132 if (status < B_OK) { 129 (new BAlert("alert", "Terminal couldn't start the shell. Sorry.",130 "OK", NULL, NULL, B_WIDTH_FROM_LABEL,133 (new BAlert("alert", TR("Terminal couldn't start the shell. Sorry."), 134 TR("OK"), NULL, NULL, B_WIDTH_FROM_LABEL, 131 135 B_INFO_ALERT))->Go(NULL); 132 136 PostMessage(B_QUIT_REQUESTED); 133 137 return; … … 554 558 void 555 559 TermApp::_Usage(char *name) 556 560 { 557 fprintf(stderr, "Haiku Terminal\n"561 fprintf(stderr, TR("Haiku Terminal\n" 558 562 "Copyright 2001-2009 Haiku, Inc.\n" 559 563 "Copyright(C) 1999 Kazuho Okui and Takashi Murai.\n" 560 564 "\n" 561 "Usage: %s [OPTION] [SHELL]\n" , name);565 "Usage: %s [OPTION] [SHELL]\n"), name); 562 566 563 567 fprintf(stderr, 564 " -h, --help print this help\n"568 TR(" -h, --help print this help\n" 565 569 //" -p, --preference load preference file\n" 566 570 " -t, --title set window title\n" 567 " -f, --fullscreen start fullscreen\n" 571 " -f, --fullscreen start fullscreen\n") 568 572 //" -geom, --geometry set window geometry\n" 569 573 //" An example of geometry is \"80x25+100+100\"\n" 570 574 ); -
src/apps/terminal/SmartTabView.cpp
16 16 17 17 #include "SmartTabView.h" 18 18 19 #include <Catalog.h> 20 #include <Locale.h> 19 21 #include <MenuItem.h> 20 22 #include <Message.h> 21 23 #include <Messenger.h> … … 60 62 fInsets.bottom = bottom; 61 63 } 62 64 65 #undef TR_CONTEXT 66 #define TR_CONTEXT "Terminal SmartTabView" 63 67 64 68 void 65 69 SmartTabView::MouseDown(BPoint point) … … 76 80 message->AddInt32("index", tabIndex); 77 81 78 82 BPopUpMenu* popUpMenu = new BPopUpMenu("tab menu"); 79 popUpMenu->AddItem(new BMenuItem( "Close tab", message));83 popUpMenu->AddItem(new BMenuItem(TR("Close tab"), message)); 80 84 popUpMenu->SetAsyncAutoDestruct(true); 81 85 popUpMenu->SetTargetForItems(BMessenger(this)); 82 86 popUpMenu->Go(ConvertToScreen(point), true, true, true); -
src/apps/terminal/FindWindow.cpp
10 10 11 11 #include <Box.h> 12 12 #include <Button.h> 13 #include <Catalog.h> 13 14 #include <CheckBox.h> 14 15 #include <ControlLook.h> 15 16 #include <GridLayoutBuilder.h> 16 17 #include <GroupLayout.h> 17 18 #include <GroupLayoutBuilder.h> 19 #include <Locale.h> 18 20 #include <RadioButton.h> 19 21 #include <String.h> 20 22 #include <TextControl.h> … … 24 26 const uint32 TOGGLE_FIND_CONTROL = 'MTFG'; 25 27 const BRect kWindowFrame(10, 30, 250, 200); 26 28 29 #undef TR_CONTEXT 30 #define TR_CONTEXT "Terminal FindWindow" 27 31 28 32 FindWindow::FindWindow(BMessenger messenger, const BString& str, 29 33 bool findSelection, bool matchWord, bool matchCase, bool forwardSearch) 30 34 : 31 BWindow(kWindowFrame, "Find", B_FLOATING_WINDOW,35 BWindow(kWindowFrame, TR("Find"), B_FLOATING_WINDOW, 32 36 B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE 33 37 | B_AUTO_UPDATE_SIZE_LIMITS), 34 38 fFindDlgMessenger(messenger) … … 44 48 BView* layoutView = BGroupLayoutBuilder(B_VERTICAL, 5.0) 45 49 .SetInsets(spacing, spacing, spacing, spacing) 46 50 .Add(BGridLayoutBuilder() 47 .Add(fTextRadio = new BRadioButton( "Use text:",51 .Add(fTextRadio = new BRadioButton(TR("Use text:"), 48 52 new BMessage(TOGGLE_FIND_CONTROL)), 0, 0) 49 53 .Add(fFindLabel = new BTextControl(NULL, NULL, NULL), 1, 0) 50 .Add(useSelection = new BRadioButton( "Use selection",54 .Add(useSelection = new BRadioButton(TR("Use selection"), 51 55 new BMessage(TOGGLE_FIND_CONTROL)), 0, 1)) 52 56 .Add(separator) 53 .Add(fForwardSearchBox = new BCheckBox( "Search forward"))54 .Add(fMatchCaseBox = new BCheckBox( "Match case"))55 .Add(fMatchWordBox = new BCheckBox( "Match word"))56 .Add(fFindButton = new BButton( "Find", new BMessage(MSG_FIND)))57 .Add(fForwardSearchBox = new BCheckBox(TR("Search forward"))) 58 .Add(fMatchCaseBox = new BCheckBox(TR("Match case"))) 59 .Add(fMatchWordBox = new BCheckBox(TR("Match word"))) 60 .Add(fFindButton = new BButton(TR("Find"), new BMessage(MSG_FIND))) 57 61 .End(); 58 62 AddChild(layoutView); 59 63 -
src/apps/terminal/AppearPrefView.cpp
12 12 #include <stdlib.h> 13 13 14 14 #include <Button.h> 15 #include <Catalog.h> 15 16 #include <ColorControl.h> 16 17 #include <GridLayoutBuilder.h> 17 18 #include <GroupLayoutBuilder.h> 18 19 #include <LayoutBuilder.h> 20 #include <Locale.h> 19 21 #include <Menu.h> 20 22 #include <MenuField.h> 21 23 #include <MenuItem.h> … … 26 28 #include "PrefHandler.h" 27 29 #include "TermConst.h" 28 30 31 #undef TR_CONTEXT "" 32 #define TR_CONTEXT "Terminal ApperPrefView" 29 33 30 31 34 AppearancePrefView::AppearancePrefView(const char* name, 32 35 const BMessenger& messenger) 33 36 : BView(name, B_WILL_DRAW), … … 67 70 BMenu* sizeMenu = _MakeSizeMenu(MSG_HALF_SIZE_CHANGED, 68 71 PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE)); 69 72 70 fFont = new BMenuField( "Font:", fontMenu);71 fFontSize = new BMenuField( "Size:", sizeMenu);72 fColorField = new BMenuField( "Color:",73 fFont = new BMenuField(TR("Font:"), fontMenu); 74 fFontSize = new BMenuField(TR("Size:"), sizeMenu); 75 fColorField = new BMenuField(TR("Color:"), 73 76 _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable, 74 77 kColorTable[0])); 75 78 -
src/apps/terminal/PrefHandler.cpp
12 12 #include "PrefHandler.h" 13 13 #include "TermConst.h" 14 14 15 #include <Catalog.h> 15 16 #include <Directory.h> 16 17 #include <Entry.h> 17 18 #include <File.h> 18 19 #include <FindDirectory.h> 19 20 #include <Font.h> 20 21 #include <GraphicsDefs.h> 22 #include <Locale.h> 21 23 #include <Message.h> 22 24 #include <NodeInfo.h> 23 25 #include <Path.h> … … 239 241 return atof(value); 240 242 } 241 243 244 #undef TR_CONTEXT 245 #define TR_CONTEXT "Terminal getString" 242 246 243 247 const char* 244 248 PrefHandler::getString(const char *key) 245 249 { 246 250 const char *buffer; 247 251 if (fContainer.FindString(key, &buffer) != B_OK) 248 buffer = "Error!";252 buffer = TR("Error!"); 249 253 250 254 //printf("%x GET %s: %s\n", this, key, buf); 251 255 return buffer; … … 263 267 } 264 268 265 269 270 #undef TR_CONTEXT 271 #define TR_CONTEXT "Terminal getRGB" 272 266 273 /** Returns RGB data from given key. */ 267 274 268 275 rgb_color … … 274 281 if (const char *s = fContainer.FindString(key)) { 275 282 sscanf(s, "%d, %d, %d", &r, &g, &b); 276 283 } else { 277 fprintf(stderr, "PrefHandler::getRGB(%s) - key not found\n", key);284 fprintf(stderr, TR("PrefHandler::getRGB(%s) - key not found\n"), key); 278 285 r = g = b = 0; 279 286 } 280 287