Ticket #5850: TerminalLocalization2.patch

File TerminalLocalization2.patch, 25.0 KB (added by Karvjorm, 12 years ago)

A fixed Terminal localization patch

  • src/apps/terminal/TermWindow.cpp

     
    1616
    1717#include <Alert.h>
    1818#include <Application.h>
     19#include <Catalog.h>
    1920#include <Clipboard.h>
    2021#include <Dragger.h>
     22#include <Locale.h>
    2123#include <Menu.h>
    2224#include <MenuBar.h>
    2325#include <MenuItem.h>
     
    5254const static uint32 kDecreaseFontSize = 'DcFs';
    5355const static uint32 kSetActiveTab = 'STab';
    5456
     57#undef TR_CONTEXT
     58#define TR_CONTEXT "Terminal TermWindow"
    5559
    5660class CustomTermView : public TermView {
    5761public:
     
    253257BMenu *
    254258TermWindow::_MakeEncodingMenu()
    255259{
    256     BMenu *menu = new (std::nothrow) BMenu("Text encoding");
     260    BMenu *menu = new (std::nothrow) BMenu(TR("Text encoding"));
    257261    if (menu == NULL)
    258262        return NULL;
    259263
     
    282286    fMenubar = new BMenuBar(Bounds(), "mbar");
    283287
    284288    // 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"),
    287291        new BMessage(MENU_SWITCH_TERM), B_TAB));
    288     fFilemenu->AddItem(new BMenuItem("New Terminal",
     292    fFilemenu->AddItem(new BMenuItem(TR("New Terminal"),
    289293        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'));
    291295
    292296    fFilemenu->AddSeparatorItem();
    293     fFilemenu->AddItem(new BMenuItem("Page setup" B_UTF8_ELLIPSIS,
     297    fFilemenu->AddItem(new BMenuItem(TR("Page setup" B_UTF8_ELLIPSIS),
    294298        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'));
    296300    fFilemenu->AddSeparatorItem();
    297     fFilemenu->AddItem(new BMenuItem("About Terminal" B_UTF8_ELLIPSIS,
     301    fFilemenu->AddItem(new BMenuItem(TR("About Terminal" B_UTF8_ELLIPSIS),
    298302        new BMessage(B_ABOUT_REQUESTED)));
    299303    fFilemenu->AddSeparatorItem();
    300     fFilemenu->AddItem(new BMenuItem("Close active tab",
     304    fFilemenu->AddItem(new BMenuItem(TR("Close active tab"),
    301305        new BMessage(kCloseView), 'W', B_SHIFT_KEY));
    302     fFilemenu->AddItem(new BMenuItem("Quit",
     306    fFilemenu->AddItem(new BMenuItem(TR("Quit"),
    303307        new BMessage(B_QUIT_REQUESTED), 'Q'));
    304308    fMenubar->AddItem(fFilemenu);
    305309
    306310    // Make Edit Menu.
    307311    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'));
    310314    fEditmenu->AddSeparatorItem();
    311     fEditmenu->AddItem(new BMenuItem("Select all",
     315    fEditmenu->AddItem(new BMenuItem(TR("Select all"),
    312316        new BMessage(B_SELECT_ALL), 'A'));
    313     fEditmenu->AddItem(new BMenuItem("Clear all",
     317    fEditmenu->AddItem(new BMenuItem(TR("Clear all"),
    314318        new BMessage(MENU_CLEAR_ALL), 'L'));
    315319    fEditmenu->AddSeparatorItem();
    316     fEditmenu->AddItem(new BMenuItem("Find" B_UTF8_ELLIPSIS,
     320    fEditmenu->AddItem(new BMenuItem(TR("Find" B_UTF8_ELLIPSIS),
    317321        new BMessage(MENU_FIND_STRING),'F'));
    318     fFindPreviousMenuItem = new BMenuItem("Find previous",
     322    fFindPreviousMenuItem = new BMenuItem(TR("Find previous"),
    319323        new BMessage(MENU_FIND_PREVIOUS), 'G', B_SHIFT_KEY);
    320324    fEditmenu->AddItem(fFindPreviousMenuItem);
    321325    fFindPreviousMenuItem->SetEnabled(false);
    322     fFindNextMenuItem = new BMenuItem("Find next",
     326    fFindNextMenuItem = new BMenuItem(TR("Find next"),
    323327        new BMessage(MENU_FIND_NEXT), 'G');
    324328    fEditmenu->AddItem(fFindNextMenuItem);
    325329    fFindNextMenuItem->SetEnabled(false);
     
    327331    fMenubar->AddItem(fEditmenu);
    328332
    329333    // Make Help Menu.
    330     fHelpmenu = new BMenu("Settings");
     334    fHelpmenu = new BMenu(TR("Settings"));
    331335    fWindowSizeMenu = _MakeWindowSizeMenu();
    332336
    333337    fEncodingmenu = _MakeEncodingMenu();
    334338
    335     fSizeMenu = new BMenu("Text size");
     339    fSizeMenu = new BMenu(TR("Text size"));
    336340
    337     fIncreaseFontSizeMenuItem = new BMenuItem("Increase",
     341    fIncreaseFontSizeMenuItem = new BMenuItem(TR("Increase"),
    338342        new BMessage(kIncreaseFontSize), '+', B_COMMAND_KEY);
    339343
    340     fDecreaseFontSizeMenuItem = new BMenuItem("Decrease",
     344    fDecreaseFontSizeMenuItem = new BMenuItem(TR("Decrease"),
    341345        new BMessage(kDecreaseFontSize), '-', B_COMMAND_KEY);
    342346
    343347    fSizeMenu->AddItem(fIncreaseFontSizeMenuItem);
     
    347351    fHelpmenu->AddItem(fEncodingmenu);
    348352    fHelpmenu->AddItem(fSizeMenu);
    349353    fHelpmenu->AddSeparatorItem();
    350     fHelpmenu->AddItem(new BMenuItem("Settings" B_UTF8_ELLIPSIS,
     354    fHelpmenu->AddItem(new BMenuItem(TR("Settings" B_UTF8_ELLIPSIS),
    351355        new BMessage(MENU_PREF_OPEN)));
    352356    fHelpmenu->AddSeparatorItem();
    353     fHelpmenu->AddItem(new BMenuItem("Save as default",
     357    fHelpmenu->AddItem(new BMenuItem(TR("Save as default"),
    354358        new BMessage(SAVE_AS_DEFAULT)));
    355359    fMenubar->AddItem(fHelpmenu);
    356360
     
    451455
    452456            if (fFindString.Length() == 0) {
    453457                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,
    456460                    NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    457461
    458462                alert->Go();
     
    467471            findresult = _ActiveTermView()->Find(fFindString, fForwardSearch, fMatchCase, fMatchWord);
    468472
    469473            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,
    471475                    NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    472476                alert->SetShortcut(0, B_ESCAPE);
    473477                alert->Go();
     
    488492                (message->what == MENU_FIND_NEXT) == fForwardSearch,
    489493                fMatchCase, fMatchWord);
    490494            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"),
    492496                    NULL, NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
    493497                alert->SetShortcut(0, B_ESCAPE);
    494498                alert->Go();
     
    719723TermWindow::_DoPrint()
    720724{
    721725    if (!fPrintSettings || (_DoPageSetup() != B_OK)) {
    722         (new BAlert("Cancel", "Print cancelled.", "OK"))->Go();
     726        (new BAlert(TR("Cancel"), TR("Print cancelled."), TR("OK")))->Go();
    723727        return;
    724728    }
    725729
     
    978982BMenu*
    979983TermWindow::_MakeWindowSizeMenu()
    980984{
    981     BMenu *menu = new (std::nothrow) BMenu("Window size");
     985    BMenu *menu = new (std::nothrow) BMenu(TR("Window size"));
    982986    if (menu == NULL)
    983987        return NULL;
    984988
     
    10021006    }
    10031007
    10041008    menu->AddSeparatorItem();
    1005     menu->AddItem(new BMenuItem("Full screen", new BMessage(FULLSCREEN),
     1009    menu->AddItem(new BMenuItem(TR("Full screen"), new BMessage(FULLSCREEN),
    10061010        B_ENTER));
    10071011
    10081012    return menu;
  • src/apps/terminal/TermParse.cpp

     
    1818
    1919#include <Autolock.h>
    2020#include <Beep.h>
     21#include <Catalog.h>
     22#include <Locale.h>
    2123#include <Message.h>
    2224#include <UTF8.h>
    2325
     
    4547#define DEFAULT -1
    4648#define NPARAM 10       // Max parameters
    4749
     50#undef TR_CONTEXT
     51#define TR_CONTEXT "Terminal TermParse"
    4852
    4953//! Get char from pty reader buffer.
    5054inline uchar
     
    287291    { NULL, NULL }
    288292    };
    289293    int i;
    290     fprintf(stderr, "groundtable: ");
     294    fprintf(stderr, TR("groundtable: "));
    291295    for (i = 0; tables[i].p; i++) {
    292296        if (tables[i].p == groundtable)
    293297            fprintf(stderr, "%s\t", tables[i].name);
    294298    }
    295     fprintf(stderr, "parsestate: ");
     299    fprintf(stderr, TR("parsestate: "));
    296300    for (i = 0; tables[i].p; i++) {
    297301        if (tables[i].p == parsestate)
    298302            fprintf(stderr, "%s\t", tables[i].name);
    299303    }
    300     fprintf(stderr, "char: 0x%02x (%d)\n", c, c);
     304    fprintf(stderr, TR("char: 0x%02x (%d)\n"), c, c);
    301305}
    302306
    303307
  • src/apps/terminal/TermView.cpp

     
    2727#include <Alert.h>
    2828#include <Application.h>
    2929#include <Beep.h>
     30#include <Catalog.h>
    3031#include <Clipboard.h>
    3132#include <Debug.h>
    3233#include <Directory.h>
    3334#include <Dragger.h>
    3435#include <Input.h>
     36#include <Locale.h>
    3537#include <MenuItem.h>
    3638#include <Message.h>
    3739#include <MessageRunner.h>
     
    8183    SELECT_LINES
    8284};
    8385
     86#undef TR_CONTEXT
     87#define TR_CONTEXT "Terminal TermView"
    8488
    8589static property_info sPropList[] = {
    8690    { "encoding",
     
    14271431    bool hasResizeView = fResizeRunner != NULL;
    14281432    if (!hasResizeView) {
    14291433        // 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"), "");
    14311435        fResizeView->SetAlignment(B_ALIGN_CENTER);
    14321436        fResizeView->SetFont(be_bold_font);
    14331437
     
    18211825    cpMessage->what = kSecondaryMouseDropAction;
    18221826    cpMessage->AddInt8("action", kCopyFiles);
    18231827
    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);
    18301834
    18311835    // if the refs point to different directorys disable the cd menu item
    18321836    bool differentDirs = false;
     
    18541858    if (differentDirs)
    18551859        cdItem->SetEnabled(false);
    18561860
    1857     BPopUpMenu *menu = new BPopUpMenu("Secondary Mouse Button Drop Menu");
     1861    BPopUpMenu *menu = new BPopUpMenu(TR("Secondary mouse button drop menu"));
    18581862    menu->SetAsyncAutoDestruct(true);
    18591863    menu->AddItem(insertItem);
    18601864    menu->AddSeparatorItem();
     
    27642768TermView::AboutRequested()
    27652769{
    27662770    BAlert *alert = new (std::nothrow) BAlert("about",
    2767         "Terminal\n\n"
     2771        TR("Terminal\n\n"
    27682772        "written by Kazuho Okui and Takashi Murai\n"
    27692773        "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"));
    27712775    if (alert != NULL)
    27722776        alert->Go();
    27732777}
  • src/apps/terminal/TermApp.h

     
    3333
    3434
    3535#include <Application.h>
     36#include <Catalog.h>
    3637#include <String.h>
    3738
    3839class Arguments;
     
    7677        BWindow*    fTermWindow;
    7778        BRect       fTermFrame;
    7879        Arguments   *fArgs;
     80        BCatalog    fAppCatalog;
    7981};
    8082
    8183#endif  // TERM_APP_H
  • src/apps/terminal/PrefWindow.cpp

     
    1414#include <Alert.h>
    1515#include <Box.h>
    1616#include <Button.h>
     17#include <Catalog.h>
    1718#include <FilePanel.h>
    1819#include <GroupLayoutBuilder.h>
    1920#include <LayoutBuilder.h>
     21#include <Locale.h>
    2022#include <Path.h>
    2123
    2224#include <stdio.h>
    2325
     26#undef TR_CONTEXT
     27#define TR_CONTEXT "Terminal PrefWindow"
    2428
    2529PrefWindow::PrefWindow(const BMessenger &messenger)
    26     : BWindow(BRect(0, 0, 375, 185), "Terminal settings",
     30    : BWindow(BRect(0, 0, 375, 185), TR("Terminal settings"),
    2731        B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
    2832        B_NOT_RESIZABLE|B_NOT_ZOOMABLE|B_AUTO_UPDATE_SIZE_LIMITS),
    2933    fPreviousPref(new PrefHandler(PrefHandler::Default())),
     
    3438    BLayoutBuilder::Group<>(this, B_VERTICAL)
    3539        .AddGroup(B_VERTICAL)
    3640        .SetInsets(10, 10, 10, 10)
    37             .Add(new AppearancePrefView("Appearance", fTerminalMessenger))
     41            .Add(new AppearancePrefView(TR("Appearance"), fTerminalMessenger))
    3842            .AddGroup(B_HORIZONTAL)
    3943                .Add(fSaveAsFileButton = new BButton("savebutton",
    40                     "Save to file" B_UTF8_ELLIPSIS,
     44                    TR("Save to file" B_UTF8_ELLIPSIS),
    4145                    new BMessage(MSG_SAVEAS_PRESSED), B_WILL_DRAW))
    4246                .AddGlue()
    4347                .Add(fRevertButton = new BButton("revertbutton",
    44                     "Cancel", new BMessage(MSG_REVERT_PRESSED),
     48                    TR("Cancel"), new BMessage(MSG_REVERT_PRESSED),
    4549                    B_WILL_DRAW))
    46                 .Add(fSaveButton = new BButton("okbutton", "OK",
     50                .Add(fSaveButton = new BButton("okbutton", TR("OK"),
    4751                    new BMessage(MSG_SAVE_PRESSED), B_WILL_DRAW))
    4852            .End()
    4953        .End();
     
    7983    if (!fDirty)
    8084        return true;
    8185
    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"),
    8488        B_WIDTH_AS_USUAL, B_OFFSET_SPACING,
    8589        B_WARNING_ALERT);
    8690    alert->SetShortcut(0, B_ESCAPE);
  • src/apps/terminal/Arguments.cpp

     
    99
    1010#include "Arguments.h"
    1111
     12#include <Catalog.h>
     13#include <Locale.h>
    1214
    1315Arguments::Arguments(int defaultArgsNum, const char * const *defaultArgs)
    1416    : fUsageRequested(false),
     
    2830    _SetShellArguments(0, NULL);
    2931}
    3032
     33#undef TR_CONTEXT
     34#define TR_CONTEXT "Terminal arguments parsing"
    3135
    3236void
    3337Arguments::Parse(int argc, const char *const *argv)
     
    7579                argi++;         
    7680            } else {
    7781                // illegal option
    78                 fprintf(stderr, "Unrecognized option \"%s\"\n", arg);
     82                fprintf(stderr, TR("Unrecognized option \"%s\"\n"), arg);
    7983                fUsageRequested = true;
    8084            }
    8185
  • src/apps/terminal/Shell.cpp

     
    2727#include <time.h>
    2828#include <unistd.h>
    2929
     30#include <Catalog.h>
    3031#include <OS.h>
     32#include <Locale.h>
    3133
    3234#include "TermConst.h"
    3335#include "TermParse.h"
     
    316318    tio.c_cc[VSUSP]  = CSUSP;       /* '^Z' */
    317319}
    318320
     321#undef TR_CONTEXT
     322#define TR_CONTEXT "Terminal Shell"
    319323
    320324status_t
    321325Shell::_Spawn(int row, int col, const char *encoding, int argc, const char **argv)
     
    360364            } else {
    361365                // B_BUSY is a normal case
    362366                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));
    364368            }
    365369        }
    366370        closedir(dir);
     
    368372#endif /* __HAIKU__ */
    369373
    370374    if (master < 0) {
    371         fprintf(stderr, "Didn't find any available pseudo ttys.");
     375        fprintf(stderr, TR("Didn't find any available pseudo ttys."));
    372376        return errno;
    373377    }
    374378
     
    376380    if (grantpt(master) != 0 || unlockpt(master) != 0
    377381        || (ttyName = ptsname(master)) == NULL) {
    378382        close(master);
    379         fprintf(stderr, "Failed to init pseudo tty.");
     383        fprintf(stderr, TR("Failed to init pseudo tty."));
    380384        return errno;
    381385    }
    382386#endif /* __HAIKU__ */
     
    411415        if (setsid() < 0) {
    412416            handshake.status = PTY_NG;
    413417            snprintf(handshake.msg, sizeof(handshake.msg),
    414                 "could not set session leader.");
     418                TR("could not set session leader."));
    415419            send_handshake_message(terminalThread, handshake);
    416420            exit(1);
    417421        }
     
    421425        if ((slave = open(ttyName, O_RDWR)) < 0) {
    422426            handshake.status = PTY_NG;
    423427            snprintf(handshake.msg, sizeof(handshake.msg),
    424                 "can't open tty (%s).", ttyName);
     428                TR("can't open tty (%s)."), ttyName);
    425429            send_handshake_message(terminalThread, handshake);
    426430            exit(1);
    427431        }
     
    460464        if (tcsetattr(0, TCSANOW, &tio) == -1) {
    461465            handshake.status = PTY_NG;
    462466            snprintf(handshake.msg, sizeof(handshake.msg),
    463                 "failed set terminal interface (TERMIOS).");
     467                TR("failed set terminal interface (TERMIOS)."));
    464468            send_handshake_message(terminalThread, handshake);
    465469            exit(1);
    466470        }
     
    476480        if (handshake.status != PTY_WS) {
    477481            handshake.status = PTY_NG;
    478482            snprintf(handshake.msg, sizeof(handshake.msg),
    479                 "mismatch handshake.");
     483                TR("mismatch handshake."));
    480484            send_handshake_message(terminalThread, handshake);
    481485            exit(1);
    482486        }
     
    512516         */
    513517
    514518        sleep(1);
    515         const char *spawnAlertMessage = "alert --stop "
    516                         "'Cannot execute \"%s\":\n"
    517                         "\t%s' "
    518                         "'Use default shell' 'Abort'";
     519        BString knonLocalizedPart = "alert --stop ";
     520        const char *kLocalizedPart =
     521            TR("'Cannot execute \"%s\":\n\t%s' 'Use default shell' 'Abort'");
     522        const char *spawnAlertMessage = knonLocalizedPart << kLocalizedPart;
    519523        char errorMessage[256];
    520524        snprintf(errorMessage, sizeof(errorMessage), spawnAlertMessage, argv[0], strerror(errno));
    521525
  • src/apps/terminal/TermApp.cpp

     
    1717#include <unistd.h>
    1818
    1919#include <Alert.h>
     20#include <Catalog.h>
    2021#include <Clipboard.h>
     22#include <Catalog.h>
     23#include <Locale.h>
    2124#include <NodeInfo.h>
    2225#include <Path.h>
    2326#include <Roster.h>
     
    5053    return 0;
    5154}
    5255
    53    
     56#undef TR_CONTEXT
     57#define TR_CONTEXT "Terminal TermApp"
     58
    5459TermApp::TermApp()
    5560    : BApplication(TERM_SIGNATURE),
    5661    fStartFullscreen(false),
    5762    fWindowNumber(-1),
    5863    fTermWindow(NULL),
    59     fArgs(NULL)
     64    fArgs(NULL),
     65    fAppCatalog(NULL)
    6066{
    6167    const char *defaultArgs[2];
    6268    defaultArgs[0] = kDefaultShell;
     
    7076        defaultArgs[0] = passwdStruct.pw_shell;
    7177    }
    7278   
     79    be_locale->GetAppCatalog(&fAppCatalog);
     80   
    7381    fArgs = new Arguments(2, defaultArgs);
    7482   
    75     fWindowTitle = "Terminal";
     83    fWindowTitle = TR("Terminal");
    7684    _RegisterTerminal();
    7785
    7886    if (fWindowNumber > 0)
     
    114122#endif
    115123    action.sa_userdata = this;
    116124    if (sigaction(SIGCHLD, &action, NULL) < 0) {
    117         fprintf(stderr, "sigaction() failed: %s\n", strerror(errno));
     125        fprintf(stderr, TR("sigaction() failed: %s\n"), strerror(errno));
    118126        // continue anyway
    119127    }
    120128
     
    126134    // failed spawn, print stdout and open alert panel
    127135    // TODO: This alert does never show up.
    128136    if (status < B_OK) {
    129         (new BAlert("alert", "Terminal couldn't start the shell. Sorry.",
    130             "OK", NULL, NULL, B_WIDTH_FROM_LABEL,
     137        (new BAlert("alert", TR("Terminal couldn't start the shell. Sorry."),
     138            TR("OK"), NULL, NULL, B_WIDTH_FROM_LABEL,
    131139            B_INFO_ALERT))->Go(NULL);
    132140        PostMessage(B_QUIT_REQUESTED);
    133141        return;
     
    554562void
    555563TermApp::_Usage(char *name)
    556564{
    557     fprintf(stderr, "Haiku Terminal\n"
     565    fprintf(stderr, TR("Haiku Terminal\n"
    558566        "Copyright 2001-2009 Haiku, Inc.\n"
    559567        "Copyright(C) 1999 Kazuho Okui and Takashi Murai.\n"
    560568        "\n"
    561         "Usage: %s [OPTION] [SHELL]\n", name);
     569        "Usage: %s [OPTION] [SHELL]\n"), name);
    562570
    563571    fprintf(stderr,
    564         "  -h,     --help               print this help\n"   
     572        TR("  -h,     --help               print this help\n"   
    565573        //"  -p,     --preference         load preference file\n"
    566574        "  -t,     --title              set window title\n"
    567         "  -f,     --fullscreen         start fullscreen\n"     
     575        "  -f,     --fullscreen         start fullscreen\n")       
    568576        //"  -geom,  --geometry           set window geometry\n"
    569577        //"                               An example of geometry is \"80x25+100+100\"\n"
    570578        );
  • src/apps/terminal/SmartTabView.cpp

     
    1616
    1717#include "SmartTabView.h"
    1818
     19#include <Catalog.h>
     20#include <Locale.h>
    1921#include <MenuItem.h>
    2022#include <Message.h>
    2123#include <Messenger.h>
     
    6062    fInsets.bottom = bottom;
    6163}
    6264
     65#undef TR_CONTEXT
     66#define TR_CONTEXT "Terminal SmartTabView"
    6367
    6468void
    6569SmartTabView::MouseDown(BPoint point)
     
    7680                message->AddInt32("index", tabIndex);
    7781
    7882                BPopUpMenu* popUpMenu = new BPopUpMenu("tab menu");
    79                 popUpMenu->AddItem(new BMenuItem("Close tab", message));
     83                popUpMenu->AddItem(new BMenuItem(TR("Close tab"), message));
    8084                popUpMenu->SetAsyncAutoDestruct(true);
    8185                popUpMenu->SetTargetForItems(BMessenger(this));
    8286                popUpMenu->Go(ConvertToScreen(point), true, true, true);
  • src/apps/terminal/FindWindow.cpp

     
    1010
    1111#include <Box.h>
    1212#include <Button.h>
     13#include <Catalog.h>
    1314#include <CheckBox.h>
    1415#include <ControlLook.h>
    1516#include <GridLayoutBuilder.h>
    1617#include <GroupLayout.h>
    1718#include <GroupLayoutBuilder.h>
     19#include <Locale.h>
    1820#include <RadioButton.h>
    1921#include <String.h>
    2022#include <TextControl.h>
     
    2426const uint32 TOGGLE_FIND_CONTROL = 'MTFG';
    2527const BRect kWindowFrame(10, 30, 250, 200);
    2628
     29#undef TR_CONTEXT
     30#define TR_CONTEXT "Terminal FindWindow"
    2731
    2832FindWindow::FindWindow(BMessenger messenger, const BString& str,
    2933        bool findSelection, bool matchWord, bool matchCase, bool forwardSearch)
    3034    :
    31     BWindow(kWindowFrame, "Find", B_FLOATING_WINDOW,
     35    BWindow(kWindowFrame, TR("Find"), B_FLOATING_WINDOW,
    3236        B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_CLOSE_ON_ESCAPE
    3337        | B_AUTO_UPDATE_SIZE_LIMITS),
    3438    fFindDlgMessenger(messenger)
     
    4448    BView* layoutView = BGroupLayoutBuilder(B_VERTICAL, 5.0)
    4549        .SetInsets(spacing, spacing, spacing, spacing)
    4650        .Add(BGridLayoutBuilder()
    47             .Add(fTextRadio = new BRadioButton("Use text:",
     51            .Add(fTextRadio = new BRadioButton(TR("Use text:"),
    4852                new BMessage(TOGGLE_FIND_CONTROL)), 0, 0)
    4953            .Add(fFindLabel = new BTextControl(NULL, NULL, NULL), 1, 0)
    50             .Add(useSelection = new BRadioButton("Use selection",
     54            .Add(useSelection = new BRadioButton(TR("Use selection"),
    5155                new BMessage(TOGGLE_FIND_CONTROL)), 0, 1))
    5256        .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)))
    5761        .End();
    5862    AddChild(layoutView);
    5963
  • src/apps/terminal/AppearPrefView.cpp

     
    1212#include <stdlib.h>
    1313
    1414#include <Button.h>
     15#include <Catalog.h>
    1516#include <ColorControl.h>
    1617#include <GridLayoutBuilder.h>
    1718#include <GroupLayoutBuilder.h>
    1819#include <LayoutBuilder.h>
     20#include <Locale.h>
    1921#include <Menu.h>
    2022#include <MenuField.h>
    2123#include <MenuItem.h>
     
    2628#include "PrefHandler.h"
    2729#include "TermConst.h"
    2830
     31#undef TR_CONTEXT ""
     32#define TR_CONTEXT "Terminal ApperPrefView"
    2933
    30 
    3134AppearancePrefView::AppearancePrefView(const char* name,
    3235        const BMessenger& messenger)
    3336    : BView(name, B_WILL_DRAW),
     
    6770    BMenu* sizeMenu = _MakeSizeMenu(MSG_HALF_SIZE_CHANGED,
    6871        PrefHandler::Default()->getInt32(PREF_HALF_FONT_SIZE));
    6972   
    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:"),
    7376        _MakeMenu(MSG_COLOR_FIELD_CHANGED, kColorTable,
    7477        kColorTable[0]));
    7578
  • src/apps/terminal/PrefHandler.cpp

     
    1212#include "PrefHandler.h"
    1313#include "TermConst.h"
    1414
     15#include <Catalog.h>
    1516#include <Directory.h>
    1617#include <Entry.h>
    1718#include <File.h>
    1819#include <FindDirectory.h>
    1920#include <Font.h>
    2021#include <GraphicsDefs.h>
     22#include <Locale.h>
    2123#include <Message.h>
    2224#include <NodeInfo.h>
    2325#include <Path.h>
     
    239241    return atof(value);
    240242}
    241243
     244#undef TR_CONTEXT
     245#define TR_CONTEXT "Terminal getString"
    242246
    243247const char*
    244248PrefHandler::getString(const char *key)
    245249{
    246250    const char *buffer;
    247251    if (fContainer.FindString(key, &buffer) != B_OK)
    248         buffer = "Error!";
     252        buffer = TR("Error!");
    249253
    250254    //printf("%x GET %s: %s\n", this, key, buf);
    251255    return buffer;
     
    263267}
    264268
    265269
     270#undef TR_CONTEXT
     271#define TR_CONTEXT "Terminal getRGB"
     272
    266273/** Returns RGB data from given key. */
    267274
    268275rgb_color
     
    274281    if (const char *s = fContainer.FindString(key)) {
    275282        sscanf(s, "%d, %d, %d", &r, &g, &b);
    276283    } else {
    277         fprintf(stderr, "PrefHandler::getRGB(%s) - key not found\n", key);
     284        fprintf(stderr, TR("PrefHandler::getRGB(%s) - key not found\n"), key);
    278285        r = g = b = 0;
    279286    }
    280287