Ticket #7210: WebKit.patch

File WebKit.patch, 67.8 KB (added by Karvjorm, 13 years ago)

First WebKit localization

  • WebKit/haiku/WebPositive/URLInputGroup.cpp

     
    55
    66#include "URLInputGroup.h"
    77
     8#include <Catalog.h>
    89#include <Bitmap.h>
    910#include <Button.h>
    1011#include <ControlLook.h>
     
    2829#include "TextViewCompleter.h"
    2930
    3031
     32#undef B_TRANSLATE_CONTEXT
     33#define B_TRANSLATE_CONTEXT "URLInputGroup"
     34
     35
    3136class URLChoice : public BAutoCompleter::Choice {
    3237public:
    3338    URLChoice(const BString& choiceText, const BString& displayText,
     
    235240            be_clipboard->Unlock();
    236241        }
    237242
    238         BMenuItem* cutItem = new BMenuItem("Cut", new BMessage(B_CUT));
    239         BMenuItem* copyItem = new BMenuItem("Copy", new BMessage(B_COPY));
    240         BMenuItem* pasteItem = new BMenuItem("Paste", new BMessage(B_PASTE));
    241         BMenuItem* clearItem = new BMenuItem("Clear", new BMessage(MSG_CLEAR));
     243        BMenuItem* cutItem = new BMenuItem(B_TRANSLATE("Cut"), new BMessage(B_CUT));
     244        BMenuItem* copyItem = new BMenuItem(B_TRANSLATE("Copy"), new BMessage(B_COPY));
     245        BMenuItem* pasteItem = new BMenuItem(B_TRANSLATE("Paste"), new BMessage(B_PASTE));
     246        BMenuItem* clearItem = new BMenuItem(B_TRANSLATE("Clear"), new BMessage(MSG_CLEAR));
    242247        cutItem->SetEnabled(canCutOrCopy);
    243248        copyItem->SetEnabled(canCutOrCopy);
    244249        pasteItem->SetEnabled(canPaste);
  • WebKit/haiku/WebPositive/AuthenticationPanel.cpp

     
    2828#include "AuthenticationPanel.h"
    2929
    3030#include <Button.h>
     31#include <Catalog.h>
    3132#include <CheckBox.h>
    3233#include <ControlLook.h>
    3334#include <GridLayoutBuilder.h>
     
    4041#include <TextControl.h>
    4142#include <stdio.h>
    4243
     44#undef B_TRANSLATE_CONTEXT
     45#define B_TRANSLATE_CONTEXT "AuthenticationPanel"
     46
     47
    4348static const uint32 kMsgPanelOK = 'pnok';
    4449static const uint32 kMsgJitter = 'jitr';
    4550static const uint32 kHidePassword = 'hdpw';
    4651
    4752AuthenticationPanel::AuthenticationPanel(BRect parentFrame)
    48     : BWindow(BRect(-1000, -1000, -900, -900), "Authentication Required",
     53    : BWindow(BRect(-1000, -1000, -900, -900),
     54        B_TRANSLATE("Authentication Required"),
    4955        B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
    5056        B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE
    5157            | B_CLOSE_ON_ESCAPE | B_AUTO_UPDATE_SIZE_LIMITS)
    5258    , m_parentWindowFrame(parentFrame)
    53     , m_usernameTextControl(new BTextControl("user", "Username:", "", NULL))
    54     , m_passwordTextControl(new BTextControl("pass", "Password:", "", NULL))
    55     , m_hidePasswordCheckBox(new BCheckBox("hide", "Hide password text", new BMessage(kHidePassword)))
    56     , m_rememberCredentialsCheckBox(new BCheckBox("remember", "Remember username and password for this site", NULL))
    57     , m_okButton(new BButton("ok", "OK", new BMessage(kMsgPanelOK)))
    58     , m_cancelButton(new BButton("cancel", "Cancel", new BMessage(B_QUIT_REQUESTED)))
     59    , m_usernameTextControl(new BTextControl("user",
     60        B_TRANSLATE("Username:"), "", NULL))
     61    , m_passwordTextControl(new BTextControl("pass",
     62        B_TRANSLATE("Password:"), "", NULL))
     63    , m_hidePasswordCheckBox(new BCheckBox("hide",
     64        B_TRANSLATE("Hide password text"), new BMessage(kHidePassword)))
     65    , m_rememberCredentialsCheckBox(new BCheckBox("remember",
     66        B_TRANSLATE("Remember username and password for this site"),
     67        NULL))
     68    , m_okButton(new BButton("ok", B_TRANSLATE("OK"),
     69        new BMessage(kMsgPanelOK)))
     70    , m_cancelButton(new BButton("cancel", B_TRANSLATE("Cancel"),
     71        new BMessage(B_QUIT_REQUESTED)))
    5972    , m_cancelled(false)
    60     , m_exitSemaphore(create_sem(0, "Authentication Panel"))
     73    , m_exitSemaphore(create_sem(0, B_TRANSLATE("Authentication Panel")))
    6174{
    6275}
    6376
  • WebKit/haiku/WebPositive/DownloadWindow.cpp

     
    3131
    3232#include <Alert.h>
    3333#include <Button.h>
     34#include <Catalog.h>
    3435#include <ControlLook.h>
    3536#include <Entry.h>
    3637#include <File.h>
     
    5354#include "WebDownload.h"
    5455#include "WebPage.h"
    5556
     57#undef B_TRANSLATE_CONTEXT
     58#define B_TRANSLATE_CONTEXT "DownloadWindow"
    5659
    5760enum {
    5861    INIT = 'init',
     
    134137
    135138DownloadWindow::DownloadWindow(BRect frame, bool visible,
    136139        SettingsMessage* settings)
    137     : BWindow(frame, "Downloads",
     140    : BWindow(frame, B_TRANSLATE("Downloads"),
    138141        B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
    139142        B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE),
    140143    fMinimizeOnClose(false)
     
    155158    fDownloadViewsLayout = downloadsGroupView->GroupLayout();
    156159
    157160    BMenuBar* menuBar = new BMenuBar("Menu bar");
    158     BMenu* menu = new BMenu("Downloads");
    159     menu->AddItem(new BMenuItem("Open downloads folder",
     161    BMenu* menu = new BMenu(B_TRANSLATE("Downloads"));
     162    menu->AddItem(new BMenuItem(B_TRANSLATE("Open downloads folder"),
    160163        new BMessage(OPEN_DOWNLOADS_FOLDER)));
    161164    BMessage* newWindowMessage = new BMessage(NEW_WINDOW);
    162165    newWindowMessage->AddString("url", "");
    163     BMenuItem* newWindowItem = new BMenuItem("New browser window",
     166    BMenuItem* newWindowItem = new BMenuItem(B_TRANSLATE("New browser window"),
    164167        newWindowMessage, 'N');
    165168    menu->AddItem(newWindowItem);
    166169    newWindowItem->SetTarget(be_app);
    167170    menu->AddSeparatorItem();
    168     menu->AddItem(new BMenuItem("Hide", new BMessage(B_QUIT_REQUESTED), 'D'));
     171    menu->AddItem(new BMenuItem(B_TRANSLATE("Hide"), new BMessage(B_QUIT_REQUESTED), 'D'));
    169172    menuBar->AddItem(menu);
    170173
    171174    fDownloadsScrollView = new DownloadContainerScrollView(downloadsGroupView);
    172175
    173     fRemoveFinishedButton = new BButton("Remove finished",
     176    fRemoveFinishedButton = new BButton(B_TRANSLATE("Remove finished"),
    174177        new BMessage(REMOVE_FINISHED_DOWNLOADS));
    175178    fRemoveFinishedButton->SetEnabled(false);
    176179
    177     fRemoveMissingButton = new BButton("Remove missing",
     180    fRemoveMissingButton = new BButton(B_TRANSLATE("Remove missing"),
    178181        new BMessage(REMOVE_MISSING_DOWNLOADS));
    179182    fRemoveMissingButton->SetEnabled(false);
    180183
     
    274277            if (status == B_OK)
    275278                status = be_roster->Launch(&ref);
    276279            if (status != B_OK && status != B_ALREADY_RUNNING) {
    277                 BString errorString("The downloads folder could not be "
    278                     "opened.\n\n");
    279                 errorString << "Error: " << strerror(status);
     280                BString errorString(B_TRANSLATE("The downloads folder could not be "
     281                    "opened.\n\nError:"));
     282                errorString << " " << strerror(status);
    280283                BAlert* alert = new BAlert("Error opening downloads folder",
    281                     errorString.String(), "OK");
     284                    errorString.String(), B_TRANSLATE("OK"));
    282285                alert->Go(NULL);
    283286            }
    284287            break;
  • WebKit/haiku/WebPositive/BrowserWindow.cpp

     
    5353#include <Application.h>
    5454#include <Bitmap.h>
    5555#include <Button.h>
     56#include <Catalog.h>
    5657#include <CheckBox.h>
    5758#include <Clipboard.h>
    5859#include <Directory.h>
     
    7879
    7980#include <stdio.h>
    8081
     82#undef B_TRANSLATE_CONTEXT
     83#define B_TRANSLATE_CONTEXT "BrowserWindow"
    8184
    8285enum {
    8386    OPEN_LOCATION                               = 'open',
     
    149152private:
    150153    void _AddStaticItems()
    151154    {
    152         AddItem(new BMenuItem("Manage bookmarks",
     155        AddItem(new BMenuItem(B_TRANSLATE("Manage bookmarks"),
    153156            new BMessage(SHOW_BOOKMARKS), 'M'), 0);
    154         AddItem(new BMenuItem("Bookmark this page",
     157        AddItem(new BMenuItem(B_TRANSLATE("Bookmark this page"),
    155158            new BMessage(CREATE_BOOKMARK), 'B'), 0);
    156159    }
    157160};
     
    282285#else
    283286    BMenu* mainMenu = new BMenuBar("Main menu");
    284287#endif
    285     BMenu* menu = new BMenu("Window");
     288    BMenu* menu = new BMenu(B_TRANSLATE("Window"));
    286289    BMessage* newWindowMessage = new BMessage(NEW_WINDOW);
    287290    newWindowMessage->AddString("url", "");
    288     BMenuItem* newItem = new BMenuItem("New window", newWindowMessage, 'N');
     291    BMenuItem* newItem = new BMenuItem(B_TRANSLATE("New window"), newWindowMessage, 'N');
    289292    menu->AddItem(newItem);
    290293    newItem->SetTarget(be_app);
    291     newItem = new BMenuItem("New tab", new BMessage(*newTabMessage), 'T');
     294    newItem = new BMenuItem(B_TRANSLATE("New tab"), new BMessage(*newTabMessage), 'T');
    292295    menu->AddItem(newItem);
    293296    newItem->SetTarget(be_app);
    294     menu->AddItem(new BMenuItem("Open location", new BMessage(OPEN_LOCATION),
     297    menu->AddItem(new BMenuItem(B_TRANSLATE("Open location"), new BMessage(OPEN_LOCATION),
    295298        'L'));
    296299    menu->AddSeparatorItem();
    297     menu->AddItem(new BMenuItem("Close window", new BMessage(B_QUIT_REQUESTED),
     300    menu->AddItem(new BMenuItem(B_TRANSLATE("Close window"), new BMessage(B_QUIT_REQUESTED),
    298301        'W', B_SHIFT_KEY));
    299     menu->AddItem(new BMenuItem("Close tab", new BMessage(CLOSE_TAB), 'W'));
     302    menu->AddItem(new BMenuItem(B_TRANSLATE("Close tab"), new BMessage(CLOSE_TAB), 'W'));
    300303    menu->AddSeparatorItem();
    301     menu->AddItem(new BMenuItem("Downloads",
     304    menu->AddItem(new BMenuItem(B_TRANSLATE("Downloads"),
    302305        new BMessage(SHOW_DOWNLOAD_WINDOW), 'D'));
    303     menu->AddItem(new BMenuItem("Settings",
     306    menu->AddItem(new BMenuItem(B_TRANSLATE("Settings"),
    304307        new BMessage(SHOW_SETTINGS_WINDOW)));
    305     BMenuItem* aboutItem = new BMenuItem("About",
     308    BMenuItem* aboutItem = new BMenuItem(B_TRANSLATE("About"),
    306309        new BMessage(B_ABOUT_REQUESTED));
    307310    menu->AddItem(aboutItem);
    308311    aboutItem->SetTarget(be_app);
    309312    menu->AddSeparatorItem();
    310     BMenuItem* quitItem = new BMenuItem("Quit",
     313    BMenuItem* quitItem = new BMenuItem(B_TRANSLATE("Quit"),
    311314        new BMessage(B_QUIT_REQUESTED), 'Q');
    312315    menu->AddItem(quitItem);
    313316    quitItem->SetTarget(be_app);
    314317    mainMenu->AddItem(menu);
    315318
    316     menu = new BMenu("Edit");
    317     menu->AddItem(fCutMenuItem = new BMenuItem("Cut", new BMessage(B_CUT),
     319    menu = new BMenu(B_TRANSLATE("Edit"));
     320    menu->AddItem(fCutMenuItem = new BMenuItem(B_TRANSLATE("Cut"), new BMessage(B_CUT),
    318321        'X'));
    319     menu->AddItem(fCopyMenuItem = new BMenuItem("Copy", new BMessage(B_COPY),
     322    menu->AddItem(fCopyMenuItem = new BMenuItem(B_TRANSLATE("Copy"), new BMessage(B_COPY),
    320323        'C'));
    321     menu->AddItem(fPasteMenuItem = new BMenuItem("Paste", new BMessage(B_PASTE),
     324    menu->AddItem(fPasteMenuItem = new BMenuItem(B_TRANSLATE("Paste"), new BMessage(B_PASTE),
    322325        'V'));
    323326    menu->AddSeparatorItem();
    324327    menu->AddItem(new BMenuItem("Find", new BMessage(EDIT_SHOW_FIND_GROUP),
    325328        'F'));
    326     menu->AddItem(fFindPreviousMenuItem = new BMenuItem("Find previous",
     329    menu->AddItem(fFindPreviousMenuItem = new BMenuItem(B_TRANSLATE("Find previous"),
    327330        new BMessage(EDIT_FIND_PREVIOUS), 'G', B_SHIFT_KEY));
    328     menu->AddItem(fFindNextMenuItem = new BMenuItem("Find next",
     331    menu->AddItem(fFindNextMenuItem = new BMenuItem(B_TRANSLATE("Find next"),
    329332        new BMessage(EDIT_FIND_NEXT), 'G'));
    330333    mainMenu->AddItem(menu);
    331334    fFindPreviousMenuItem->SetEnabled(false);
    332335    fFindNextMenuItem->SetEnabled(false);
    333336
    334     menu = new BMenu("View");
    335     menu->AddItem(new BMenuItem("Reload", new BMessage(RELOAD), 'R'));
     337    menu = new BMenu(B_TRANSLATE("View"));
     338    menu->AddItem(new BMenuItem(B_TRANSLATE("Reload"), new BMessage(RELOAD), 'R'));
    336339    menu->AddSeparatorItem();
    337     menu->AddItem(new BMenuItem("Increase size",
     340    menu->AddItem(new BMenuItem(B_TRANSLATE("Increase size"),
    338341        new BMessage(ZOOM_FACTOR_INCREASE), '+'));
    339     menu->AddItem(new BMenuItem("Decrease size",
     342    menu->AddItem(new BMenuItem(B_TRANSLATE("Decrease size"),
    340343        new BMessage(ZOOM_FACTOR_DECREASE), '-'));
    341     menu->AddItem(new BMenuItem("Reset size",
     344    menu->AddItem(new BMenuItem(B_TRANSLATE("Reset size"),
    342345        new BMessage(ZOOM_FACTOR_RESET), '0'));
    343     fZoomTextOnlyMenuItem = new BMenuItem("Zoom text only",
     346    fZoomTextOnlyMenuItem = new BMenuItem(B_TRANSLATE("Zoom text only"),
    344347        new BMessage(ZOOM_TEXT_ONLY));
    345348    fZoomTextOnlyMenuItem->SetMarked(fZoomTextOnly);
    346349    menu->AddItem(fZoomTextOnlyMenuItem);
    347350
    348351    menu->AddSeparatorItem();
    349     fFullscreenItem = new BMenuItem("Fullscreen",
     352    fFullscreenItem = new BMenuItem(B_TRANSLATE("Fullscreen"),
    350353        new BMessage(TOGGLE_FULLSCREEN), B_RETURN);
    351354    menu->AddItem(fFullscreenItem);
    352     menu->AddItem(new BMenuItem("Page source",
     355    menu->AddItem(new BMenuItem(B_TRANSLATE("Page source"),
    353356        new BMessage(SHOW_PAGE_SOURCE), 'U'));
    354357    mainMenu->AddItem(menu);
    355358
    356     fHistoryMenu = new BMenu("History");
    357     fHistoryMenu->AddItem(fBackMenuItem = new BMenuItem("Back",
     359    fHistoryMenu = new BMenu(B_TRANSLATE("History"));
     360    fHistoryMenu->AddItem(fBackMenuItem = new BMenuItem(B_TRANSLATE("Back"),
    358361        new BMessage(GO_BACK), B_LEFT_ARROW));
    359     fHistoryMenu->AddItem(fForwardMenuItem = new BMenuItem("Forward",
     362    fHistoryMenu->AddItem(fForwardMenuItem = new BMenuItem(B_TRANSLATE("Forward"),
    360363        new BMessage(GO_FORWARD), B_RIGHT_ARROW));
    361364    fHistoryMenu->AddSeparatorItem();
    362365    fHistoryMenuFixedItemCount = fHistoryMenu->CountItems();
     
    367370    if (_BookmarkPath(bookmarkPath) == B_OK
    368371        && get_ref_for_path(bookmarkPath.Path(), &bookmarkRef) == B_OK) {
    369372        BMenu* bookmarkMenu
    370             = new BookmarkMenu("Bookmarks", this, &bookmarkRef);
     373            = new BookmarkMenu(B_TRANSLATE("Bookmarks"), this, &bookmarkRef);
    371374        mainMenu->AddItem(bookmarkMenu);
    372375    }
    373376
    374377    // Back, Forward, Stop & Home buttons
    375     fBackButton = new IconButton("Back", 0, NULL, new BMessage(GO_BACK));
     378    fBackButton = new IconButton(B_TRANSLATE("Back"), 0, NULL, new BMessage(GO_BACK));
    376379    fBackButton->SetIcon(201);
    377380    fBackButton->TrimIcon();
    378381
    379     fForwardButton = new IconButton("Forward", 0, NULL, new BMessage(GO_FORWARD));
     382    fForwardButton = new IconButton(B_TRANSLATE("Forward"), 0, NULL, new BMessage(GO_FORWARD));
    380383    fForwardButton->SetIcon(202);
    381384    fForwardButton->TrimIcon();
    382385
    383     fStopButton = new IconButton("Stop", 0, NULL, new BMessage(STOP));
     386    fStopButton = new IconButton(B_TRANSLATE("Stop"), 0, NULL, new BMessage(STOP));
    384387    fStopButton->SetIcon(204);
    385388    fStopButton->TrimIcon();
    386389
    387     fHomeButton = new IconButton("Home", 0, NULL, new BMessage(HOME));
     390    fHomeButton = new IconButton(B_TRANSLATE("Home"), 0, NULL, new BMessage(HOME));
    388391    fHomeButton->SetIcon(206);
    389392    fHomeButton->TrimIcon();
    390393    if (!fAppSettings->GetValue(kSettingsKeyShowHomeButton, true))
     
    413416    const float kElementSpacing = 5;
    414417
    415418    // Find group
    416     fFindTextControl = new BTextControl("find", "Find:", "",
     419    fFindTextControl = new BTextControl("find", B_TRANSLATE("Find:"), "",
    417420        new BMessage(EDIT_FIND_NEXT));
    418421    fFindTextControl->SetModificationMessage(new BMessage(FIND_TEXT_CHANGED));
    419     fFindPreviousButton = new BButton("Previous",
     422    fFindPreviousButton = new BButton(B_TRANSLATE("Previous"),
    420423        new BMessage(EDIT_FIND_PREVIOUS));
    421     fFindNextButton = new BButton("Next", new BMessage(EDIT_FIND_NEXT));
    422     fFindCloseButton = new BButton("Close",
     424    fFindNextButton = new BButton(B_TRANSLATE("Next"), new BMessage(EDIT_FIND_NEXT));
     425    fFindCloseButton = new BButton(B_TRANSLATE("Close"),
    423426        new BMessage(EDIT_HIDE_FIND_GROUP));
    424     fFindCaseSensitiveCheckBox = new BCheckBox("Match case");
     427    fFindCaseSensitiveCheckBox = new BCheckBox(B_TRANSLATE("Match case"));
    425428    BGroupLayout* findGroup = BLayoutBuilder::Group<>(B_VERTICAL, 0.0)
    426429        .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER))
    427430        .Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing)
     
    671674            BrowsingHistory* history = BrowsingHistory::DefaultInstance();
    672675            if (history->CountItems() == 0)
    673676                break;
    674             BAlert* alert = new BAlert("Confirmation", "Do you really want to "
    675                 "clear the browsing history?", "Clear", "Cancel");
     677            BAlert* alert = new BAlert("Confirmation",
     678                B_TRANSLATE("Do you really want to "
     679                "clear the browsing history?"),
     680                B_TRANSLATE("Clear"), B_TRANSLATE("Cancel"));
    676681            if (alert->Go() == 0)
    677682                history->Clear();
    678683            break;
     
    719724            }
    720725            message->RemoveName("refs");
    721726            if (addedCount > 10) {
    722                 BString string;
    723                 string << "Do you want to open " << addedCount;
    724                 string << " bookmarks all at once?";
     727                BString aCount(addedCount);
     728                BString string("Do you want to open %1 bookmarks all at once?");
     729                string.ReplaceFirst("%1", aCount.String());
    725730                BAlert* alert = new BAlert("Open bookmarks confirmation",
    726                     string.String(), "Cancel", "Open all");
     731                    string.String(), B_TRANSLATE("Cancel"), B_TRANSLATE("Open all"));
    727732                if (alert->Go() == 0)
    728733                    break;
    729734            }
     
    12221227
    12231228    fURLInputGroup->SetText(url.String());
    12241229
    1225     BString status("Requesting: ");
    1226     status << url;
     1230    BString status(B_TRANSLATE("Requesting:"));
     1231    status << " " << url;
    12271232    view->WebPage()->SetStatusMessage(status);
    12281233}
    12291234
     
    12371242    // This hook is invoked when the load is commited.
    12381243    fURLInputGroup->SetText(url.String());
    12391244
    1240     BString status("Loading: ");
    1241     status << url;
     1245    BString status(B_TRANSLATE("Loading:"));
     1246    status << " " << url;
    12421247    view->WebPage()->SetStatusMessage(status);
    12431248}
    12441249
     
    12641269        return;
    12651270
    12661271    BString status(url);
    1267     status << " failed.";
     1272    status << B_TRANSLATE_WITH_COMMENT(" failed.", "The whole message is \"url failed.\"");
    12681273    view->WebPage()->SetStatusMessage(status);
    12691274    if (!fLoadingProgressBar->IsHidden())
    12701275        fLoadingProgressBar->Hide();
     
    12781283        return;
    12791284
    12801285    BString status(url);
    1281     status << " finished.";
     1286    status << B_TRANSLATE_WITH_COMMENT(" finished.", "The whole message is \"url finished.\"");;
    12821287    view->WebPage()->SetStatusMessage(status);
    12831288    if (!fLoadingProgressBar->IsHidden())
    12841289        fLoadingProgressBar->Hide();
     
    15751580    BPath path;
    15761581    status_t status = _BookmarkPath(path);
    15771582    if (status != B_OK) {
    1578         BString message("There was an error retrieving the bookmark "
    1579             "folder.\n\n");
    1580         message << "Error: " << strerror(status);
    1581         BAlert* alert = new BAlert("Bookmark error", message.String(), "OK",
     1583        BString message(B_TRANSLATE("There was an error retrieving "
     1584          "the bookmark folder.\n\nError:"));
     1585        message << " " << strerror(status);
     1586        BAlert* alert = new BAlert("Bookmark error", message.String(), B_TRANSLATE("OK"),
    15821587            NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
    15831588        alert->Go();
    15841589        return;
     
    16031608    // URLs, only for matching file names.
    16041609    BDirectory directory(path.Path());
    16051610    if (status == B_OK && _CheckBookmarkExists(directory, bookmarkName, url)) {
    1606         BString message("A bookmark for this page (");
    1607         message << bookmarkName;
    1608         message << ") already exists.";
    1609         BAlert* alert = new BAlert("Bookmark info", message.String(), "OK");
     1611        BString message("A bookmark for this page (%1) already exists.");
     1612        message.ReplaceFirst("%1", bookmarkName);
     1613        BAlert* alert = new BAlert("Bookmark info", message.String(), B_TRANSLATE("OK"));
    16101614        alert->Go();
    16111615        return;
    16121616    }
     
    16941698    }
    16951699
    16961700    if (status != B_OK) {
    1697         BString message("There was an error creating the bookmark "
    1698             "file.\n\n");
    1699         message << "Error: " << strerror(status);
    1700         BAlert* alert = new BAlert("Bookmark error", message.String(), "OK",
     1701        BString message(B_TRANSLATE("There was an error creating the bookmark "
     1702            "file.\n\nError:"));
     1703        message << " " << strerror(status);
     1704        BAlert* alert = new BAlert("Bookmark error", message.String(), B_TRANSLATE("OK"),
    17011705            NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
    17021706        alert->Go();
    17031707        return;
     
    17171721        status = be_roster->Launch(&ref);
    17181722
    17191723    if (status != B_OK && status != B_ALREADY_RUNNING) {
    1720         BString message("There was an error trying to show the Bookmarks "
    1721             "folder.\n\n");
    1722         message << "Error: " << strerror(status);
    1723         BAlert* alert = new BAlert("Bookmark error", message.String(), "OK",
     1724        BString message(B_TRANSLATE("There was an error trying to "
     1725          "show the Bookmarks folder.\n\nError:"));
     1726        message << " " << strerror(status);
     1727        BAlert* alert = new BAlert("Bookmark error", message.String(), B_TRANSLATE("OK"),
    17241728            NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
    17251729        alert->Go();
    17261730        return;
     
    18611865        return;
    18621866
    18631867    int32 count = history->CountItems();
    1864     BMenuItem* clearHistoryItem = new BMenuItem("Clear history",
     1868    BMenuItem* clearHistoryItem = new BMenuItem(B_TRANSLATE("Clear history"),
    18651869        new BMessage(CLEAR_HISTORY));
    18661870    clearHistoryItem->SetEnabled(count > 0);
    18671871    fHistoryMenu->AddItem(clearHistoryItem);
     
    18891893    BDateTime fiveDaysAgoStart = fourDaysAgoStart;
    18901894    fiveDaysAgoStart.Date().AddDays(-1);
    18911895
    1892     BMenu* todayMenu = new BMenu("Today");
    1893     BMenu* yesterdayMenu = new BMenu("Yesterday");
     1896    BMenu* todayMenu = new BMenu(B_TRANSLATE("Today"));
     1897    BMenu* yesterdayMenu = new BMenu(B_TRANSLATE("Yesterday"));
    18941898    BMenu* twoDaysAgoMenu = new BMenu(
    18951899        twoDaysAgoStart.Date().LongDayName().String());
    18961900    BMenu* threeDaysAgoMenu = new BMenu(
     
    18991903        fourDaysAgoStart.Date().LongDayName().String());
    19001904    BMenu* fiveDaysAgoMenu = new BMenu(
    19011905        fiveDaysAgoStart.Date().LongDayName().String());
    1902     BMenu* earlierMenu = new BMenu("Earlier");
     1906    BMenu* earlierMenu = new BMenu(B_TRANSLATE("Earlier"));
    19031907
    19041908    for (int32 i = 0; i < count; i++) {
    19051909        BrowsingHistoryItem historyItem = history->HistoryItemAt(i);
     
    21342138{
    21352139    BString result = url;
    21362140    if (url.FindFirst(".") == B_ERROR || url.FindFirst(" ") != B_ERROR)
    2137         result.Prepend("http://www.google.com/search?q=");
     2141        result.Prepend(
     2142          B_TRANSLATE_WITH_COMMENT("http://www.google.com/search?q=",
     2143            "Replace google.com with google.de in German, etc., "
     2144            "do not touch any other text."));
    21382145    return result;
    21392146}
    21402147
     
    22032210    }
    22042211
    22052212    if (ret != B_OK) {
    2206         char buffer[1024];
    2207         snprintf(buffer, sizeof(buffer), "Failed to show the "
    2208             "page source: %s\n", strerror(ret));
    2209         BAlert* alert = new BAlert("Page source error", buffer, "OK");
     2213        BString str1(B_TRANSLATE("Failed to show the page source:"));
     2214        str1 << " " << strerror(ret) << "\n";
     2215        BAlert* alert = new BAlert("Page source error", buffer, B_TRANSLATE("OK"));
    22102216        alert->Go(NULL);
    22112217    }
    22122218}
  • WebKit/haiku/WebPositive/tabview/TabManager.h

     
    4646
    4747class TabManager {
    4848public:
    49                                 TabManager(const BMessenger& target,
    50                                     BMessage* newTabMessage);
    51     virtual                     ~TabManager();
     49                            TabManager(const BMessenger& target,
     50                            BMessage* newTabMessage);
     51      virtual               ~TabManager();
    5252
    53             void                SetTarget(const BMessenger& target);
     53            void            SetTarget(const BMessenger& target);
    5454            const BMessenger&   Target() const;
    5555
    5656#if INTEGRATE_MENU_INTO_TAB_BAR
    57             BMenu*              Menu() const;
     57            BMenu*          Menu() const;
    5858#endif
    5959
    60             BView*              TabGroup() const;
    61             BView*              GetTabContainerView() const;
    62             BView*              ContainerView() const;
     60            BView*          TabGroup() const;
     61            BView*          GetTabContainerView() const;
     62            BView*          ContainerView() const;
    6363
    64             BView*              ViewForTab(int32 tabIndex) const;
    65             int32               TabForView(const BView* containedView) const;
    66             bool                HasView(const BView* containedView) const;
     64            BView*          ViewForTab(int32 tabIndex) const;
     65            int32           TabForView(const BView* containedView) const;
     66            bool            HasView(const BView* containedView) const;
    6767
    68             void                SelectTab(int32 tabIndex);
    69             void                SelectTab(const BView* containedView);
    70             int32               SelectedTabIndex() const;
    71             void                CloseTab(int32 tabIndex);
     68            void            SelectTab(int32 tabIndex);
     69            void            SelectTab(const BView* containedView);
     70            int32           SelectedTabIndex() const;
     71            void            CloseTab(int32 tabIndex);
    7272
    73             void                AddTab(BView* view, const char* label,
    74                                     int32 index = -1);
    75             BView*              RemoveTab(int32 index);
    76             int32               CountTabs() const;
     73            void            AddTab(BView* view, const char* label,
     74                            int32 index = -1);
     75            BView*          RemoveTab(int32 index);
     76            int32           CountTabs() const;
    7777
    78             void                SetTabLabel(int32 tabIndex, const char* label);
     78            void            SetTabLabel(int32 tabIndex, const char* label);
    7979    const   BString&            TabLabel(int32);
    80             void                SetTabIcon(const BView* containedView,
    81                                     const BBitmap* icon);
    82             void                SetCloseButtonsAvailable(bool available);
     80            void            SetTabIcon(const BView* containedView,
     81                            const BBitmap* icon);
     82            void            SetCloseButtonsAvailable(bool available);
    8383
    8484private:
    8585#if INTEGRATE_MENU_INTO_TAB_BAR
    86             BMenu*              fMenu;
     86            BMenu*          fMenu;
    8787#endif
    8888            TabContainerGroup*  fTabContainerGroup;
    8989            TabContainerView*   fTabContainerView;
    90             BView*              fContainerView;
     90            BView*          fContainerView;
    9191            BCardLayout*        fCardLayout;
    92             TabManagerController* fController;
     92            TabManagerController*   fController;
    9393
    94             BMessenger          fTarget;
     94            BMessenger      fTarget;
    9595};
    9696
    9797#endif // TAB_MANAGER_H
  • WebKit/haiku/WebPositive/tabview/TabView.h

     
    4040
    4141class TabView {
    4242public:
    43                                 TabView();
    44     virtual                     ~TabView();
     43                        TabView();
     44      virtual               ~TabView();
    4545
    46     virtual BSize               MinSize();
    47     virtual BSize               PreferredSize();
    48     virtual BSize               MaxSize();
     46      virtual   BSize           MinSize();
     47      virtual   BSize           PreferredSize();
     48      virtual   BSize           MaxSize();
    4949
    50             void                Draw(BRect updateRect);
    51     virtual void                DrawBackground(BView* owner, BRect frame,
    52                                     const BRect& updateRect, bool isFirst,
    53                                     bool isLast, bool isFront);
    54     virtual void                DrawContents(BView* owner, BRect frame,
    55                                     const BRect& updateRect, bool isFirst,
    56                                     bool isLast, bool isFront);
     50            void            Draw(BRect updateRect);
     51      virtual   void            DrawBackground(BView* owner, BRect frame,
     52                            const BRect& updateRect, bool isFirst,
     53                            bool isLast, bool isFront);
     54      virtual   void            DrawContents(BView* owner, BRect frame,
     55                            const BRect& updateRect, bool isFirst,
     56                            bool isLast, bool isFront);
    5757
    58     virtual void                MouseDown(BPoint where, uint32 buttons);
    59     virtual void                MouseUp(BPoint where);
    60     virtual void                MouseMoved(BPoint where, uint32 transit,
    61                                     const BMessage* dragMessage);
     58      virtual   void            MouseDown(BPoint where, uint32 buttons);
     59      virtual   void            MouseUp(BPoint where);
     60      virtual   void            MouseMoved(BPoint where, uint32 transit,
     61                            const BMessage* dragMessage);
    6262
    63             void                SetIsFront(bool isFront);
    64             bool                IsFront() const;
    65             void                SetIsLast(bool isLast);
    66     virtual void                Update(bool isFirst, bool isLast,
    67                                     bool isFront);
     63            void            SetIsFront(bool isFront);
     64            bool            IsFront() const;
     65            void            SetIsLast(bool isLast);
     66      virtual   void            Update(bool isFirst, bool isLast,
     67                            bool isFront);
    6868
    6969            BLayoutItem*        LayoutItem() const;
    70             void                SetContainerView(
    71                                     TabContainerView* containerView);
     70            void            SetContainerView(
     71                            TabContainerView* containerView);
    7272            TabContainerView*   ContainerView() const;
    7373
    74             void                SetLabel(const char* label);
     74            void            SetLabel(const char* label);
    7575            const BString&      Label() const;
    7676
    77             BRect               Frame() const;
     77            BRect           Frame() const;
    7878
    7979private:
    80             float               _LabelHeight() const;
     80            float           _LabelHeight() const;
    8181
    8282private:
    8383            TabContainerView*   fContainerView;
    8484            TabLayoutItem*      fLayoutItem;
    8585
    86             BString             fLabel;
     86            BString         fLabel;
    8787
    88             bool                fIsFirst;
    89             bool                fIsLast;
    90             bool                fIsFront;
     88            bool            fIsFirst;
     89            bool            fIsLast;
     90            bool            fIsFront;
    9191};
    9292
    9393
    9494class TabLayoutItem : public BAbstractLayoutItem {
    9595public:
    96                                 TabLayoutItem(TabView* parent);
     96                        TabLayoutItem(TabView* parent);
    9797
    98     virtual bool                IsVisible();
    99     virtual void                SetVisible(bool visible);
     98      virtual   bool            IsVisible();
     99      virtual   void            SetVisible(bool visible);
    100100
    101     virtual BRect               Frame();
    102     virtual void                SetFrame(BRect frame);
     101      virtual   BRect           Frame();
     102      virtual   void            SetFrame(BRect frame);
    103103
    104     virtual BView*              View();
     104      virtual   BView*          View();
    105105
    106     virtual BSize               BaseMinSize();
    107     virtual BSize               BaseMaxSize();
    108     virtual BSize               BasePreferredSize();
    109     virtual BAlignment          BaseAlignment();
     106      virtual   BSize           BaseMinSize();
     107      virtual   BSize           BaseMaxSize();
     108      virtual   BSize           BasePreferredSize();
     109      virtual   BAlignment      BaseAlignment();
    110110
    111             TabView*            Parent() const;
    112             void                InvalidateContainer();
    113             void                InvalidateContainer(BRect frame);
     111            TabView*        Parent() const;
     112            void            InvalidateContainer();
     113            void            InvalidateContainer(BRect frame);
    114114private:
    115             TabView*            fParent;
    116             BRect               fFrame;
    117             bool                fVisible;
     115            TabView*        fParent;
     116            BRect           fFrame;
     117            bool            fVisible;
    118118};
    119119
    120120
  • WebKit/haiku/WebPositive/tabview/TabContainerView.h

     
    4747    };
    4848
    4949public:
    50                                 TabContainerView(Controller* controller);
    51     virtual                     ~TabContainerView();
     50                        TabContainerView(Controller* controller);
     51    virtual                 ~TabContainerView();
    5252
    5353    virtual BSize               MinSize();
    5454
     
    5959    virtual void                MouseDown(BPoint where);
    6060    virtual void                MouseUp(BPoint where);
    6161    virtual void                MouseMoved(BPoint where, uint32 transit,
    62                                     const BMessage* dragMessage);
     62                            const BMessage* dragMessage);
    6363
    6464    virtual void                DoLayout();
    6565
    66             void                AddTab(const char* label, int32 index = -1);
    67             void                AddTab(TabView* tab, int32 index = -1);
    68             TabView*            RemoveTab(int32 index);
    69             TabView*            TabAt(int32 index) const;
     66            void            AddTab(const char* label, int32 index = -1);
     67            void            AddTab(TabView* tab, int32 index = -1);
     68            TabView*        RemoveTab(int32 index);
     69            TabView*        TabAt(int32 index) const;
    7070
    71             int32               IndexOf(TabView* tab) const;
     71            int32           IndexOf(TabView* tab) const;
    7272
    73             void                SelectTab(int32 tabIndex);
    74             void                SelectTab(TabView* tab);
     73            void            SelectTab(int32 tabIndex);
     74            void            SelectTab(TabView* tab);
    7575
    76             void                SetTabLabel(int32 tabIndex, const char* label);
     76            void            SetTabLabel(int32 tabIndex, const char* label);
    7777
    78             void                SetFirstVisibleTabIndex(int32 index);
    79             int32               FirstVisibleTabIndex() const;
    80             int32               MaxFirstVisibleTabIndex() const;
     78            void            SetFirstVisibleTabIndex(int32 index);
     79            int32           FirstVisibleTabIndex() const;
     80            int32           MaxFirstVisibleTabIndex() const;
    8181
    82             bool                CanScrollLeft() const;
    83             bool                CanScrollRight() const;
     82            bool            CanScrollLeft() const;
     83            bool            CanScrollRight() const;
    8484
    8585private:
    86             TabView*            _TabAt(const BPoint& where) const;
    87             void                _MouseMoved(BPoint where, uint32 transit,
    88                                     const BMessage* dragMessage);
    89             void                _ValidateTabVisibility();
    90             void                _UpdateTabVisibility();
    91             float               _AvailableWidthForTabs() const;
    92             void                _SendFakeMouseMoved();
     86            TabView*        _TabAt(const BPoint& where) const;
     87            void            _MouseMoved(BPoint where, uint32 transit,
     88                            const BMessage* dragMessage);
     89            void            _ValidateTabVisibility();
     90            void            _UpdateTabVisibility();
     91            float           _AvailableWidthForTabs() const;
     92            void            _SendFakeMouseMoved();
    9393
    9494private:
    95             TabView*            fLastMouseEventTab;
    96             bool                fMouseDown;
    97             uint32              fClickCount;
    98             TabView*            fSelectedTab;
    99             Controller*         fController;
    100             int32               fFirstVisibleTabIndex;
     95            TabView*        fLastMouseEventTab;
     96            bool            fMouseDown;
     97            uint32          fClickCount;
     98            TabView*        fSelectedTab;
     99            Controller*     fController;
     100            int32           fFirstVisibleTabIndex;
    101101};
    102102
    103103#endif // TAB_CONTAINER_VIEW_H
  • WebKit/haiku/WebPositive/BrowserApp.cpp

     
    4141#include "WebView.h"
    4242#include <Alert.h>
    4343#include <Autolock.h>
     44#include <Catalog.h>
    4445#include <Directory.h>
    4546#include <Entry.h>
    4647#include <FindDirectory.h>
     
    5152#include <stdio.h>
    5253
    5354
     55#undef B_TRANSLATE_CONTEXT
     56#define B_TRANSLATE_CONTEXT "BrowserApp"
     57
    5458const char* kApplicationSignature = "application/x-vnd.Haiku-WebPositive";
    55 const char* kApplicationName = "WebPositive";
     59const char* kApplicationName = B_TRANSLATE_MARK("WebPositive");
    5660static const uint32 PRELOAD_BROWSING_HISTORY = 'plbh';
    5761
    5862#define ENABLE_NATIVE_COOKIES 0
     
    8690void
    8791BrowserApp::AboutRequested()
    8892{
    89     BString aboutText("WebPositive\n\nby Ryan Leavengood, Andrea Anzani, "
    90         "Maxime Simon, Michael Lotz, Rene Gollent and Stephan Aßmus");
    91     aboutText << "\n\nSVN revision: " << kSVNRevision;
     93    BString aboutText(B_TRANSLATE("WebPositive\n\nby Ryan Leavengood, Andrea Anzani, "
     94        "Maxime Simon, Michael Lotz, Rene Gollent and Stephan Aßmus"));
     95    aboutText << "\n\n" << B_TRANSLATE("SVN revision:") << " " << kSVNRevision;
    9296
    9397    BAlert* alert = new BAlert("About WebPositive", aboutText.String(),
    94         "Sweet!");
     98        B_TRANSLATE_WITH_COMMENT("Sweet!", "Another word for OK"));
    9599    alert->Go(NULL);
    96100}
    97101
  • WebKit/haiku/WebPositive/DownloadProgressView.cpp

     
    3232#include <Alert.h>
    3333#include <Bitmap.h>
    3434#include <Button.h>
     35#include <Catalog.h>
    3536#include <Clipboard.h>
    3637#include <Directory.h>
    3738#include <Entry.h>
     
    5152#include "StringForSize.h"
    5253
    5354
     55#undef B_TRANSLATE_CONTEXT
     56#define B_TRANSLATE_CONTEXT "Download Progress View"
     57
    5458enum {
    5559    OPEN_DOWNLOAD           = 'opdn',
    5660    RESTART_DOWNLOAD        = 'rsdn',
     
    7377public:
    7478    IconView(const BEntry& entry)
    7579        :
    76         BView("Download icon", B_WILL_DRAW),
     80        BView(B_TRANSLATE("Download icon"), B_WILL_DRAW),
    7781        fIconBitmap(BRect(0, 0, 31, 31), 0, B_RGBA32),
    7882        fDimmedIcon(false)
    7983    {
     
    8387
    8488    IconView()
    8589        :
    86         BView("Download icon", B_WILL_DRAW),
     90        BView(B_TRANSLATE("Download icon"), B_WILL_DRAW),
    8791        fIconBitmap(BRect(0, 0, 31, 31), 0, B_RGBA32),
    8892        fDimmedIcon(false)
    8993    {
     
    9397
    9498    IconView(BMessage* archive)
    9599        :
    96         BView("Download icon", B_WILL_DRAW),
     100        BView(B_TRANSLATE("Download icon"), B_WILL_DRAW),
    97101        fIconBitmap(archive),
    98102        fDimmedIcon(true)
    99103    {
     
    230234        if (archive->FindFloat("value", &value) == B_OK)
    231235            fStatusBar->SetTo(value);
    232236    } else
    233         fStatusBar = new BStatusBar("download progress", "Download");
     237        fStatusBar = new BStatusBar("download progress",
     238            B_TRANSLATE("Download"));
    234239    fStatusBar->SetMaxValue(100);
    235240    fStatusBar->SetBarHeight(12);
    236241
     
    246251        fIconView = new IconView();
    247252
    248253    if (!fDownload && (fStatusBar->CurrentValue() < 100 || !entry.Exists()))
    249         fTopButton = new SmallButton("Restart", new BMessage(RESTART_DOWNLOAD));
     254        fTopButton = new SmallButton(B_TRANSLATE("Restart"), new BMessage(RESTART_DOWNLOAD));
    250255    else {
    251         fTopButton = new SmallButton("Open", new BMessage(OPEN_DOWNLOAD));
     256        fTopButton = new SmallButton(B_TRANSLATE("Open"), new BMessage(OPEN_DOWNLOAD));
    252257        fTopButton->SetEnabled(fDownload == NULL);
    253258    }
    254259    if (fDownload)
    255         fBottomButton = new SmallButton("Cancel", new BMessage(CANCEL_DOWNLOAD));
     260        fBottomButton = new SmallButton(B_TRANSLATE("Cancel"), new BMessage(CANCEL_DOWNLOAD));
    256261    else {
    257         fBottomButton = new SmallButton("Remove", new BMessage(REMOVE_DOWNLOAD));
     262        fBottomButton = new SmallButton(B_TRANSLATE("Remove"), new BMessage(REMOVE_DOWNLOAD));
    258263        fBottomButton->SetEnabled(fDownload == NULL);
    259264    }
    260265
     
    400405                status = be_roster->Launch(&ref);
    401406            if (status != B_OK && status != B_ALREADY_RUNNING) {
    402407                BAlert* alert = new BAlert("Open download error",
    403                     "The download could not be opened.", "OK");
     408                    B_TRANSLATE("The download could not be "
     409                    "opened."), B_TRANSLATE("OK"));
    404410                alert->Go(NULL);
    405411            }
    406412            break;
     
    567573    screenWhere += BPoint(2, 2);
    568574
    569575    BPopUpMenu* contextMenu = new BPopUpMenu("download context");
    570     BMenuItem* copyURL = new BMenuItem("Copy URL to clipboard",
     576    BMenuItem* copyURL = new BMenuItem(B_TRANSLATE("Copy URL to clipboard"),
    571577        new BMessage(COPY_URL_TO_CLIPBOARD));
    572578    copyURL->SetEnabled(fURL.Length() > 0);
    573579    contextMenu->AddItem(copyURL);
    574     BMenuItem* openFolder = new BMenuItem("Open containing folder",
     580    BMenuItem* openFolder = new BMenuItem(B_TRANSLATE("Open containing folder"),
    575581        new BMessage(OPEN_CONTAINING_FOLDER));
    576582    contextMenu->AddItem(openFolder);
    577583
     
    617623        fExpectedSize = fCurrentSize;
    618624    }
    619625    fTopButton->SetEnabled(true);
    620     fBottomButton->SetLabel("Remove");
     626    fBottomButton->SetLabel(B_TRANSLATE("Remove"));
    621627    fBottomButton->SetMessage(new BMessage(REMOVE_DOWNLOAD));
    622628    fBottomButton->SetEnabled(true);
    623629    fInfoView->SetText("");
     
    628634DownloadProgressView::DownloadCanceled()
    629635{
    630636    fDownload = NULL;
    631     fTopButton->SetLabel("Restart");
     637    fTopButton->SetLabel(B_TRANSLATE("Restart"));
    632638    fTopButton->SetMessage(new BMessage(RESTART_DOWNLOAD));
    633639    fTopButton->SetEnabled(true);
    634     fBottomButton->SetLabel("Remove");
     640    fBottomButton->SetLabel(B_TRANSLATE("Remove"));
    635641    fBottomButton->SetMessage(new BMessage(REMOVE_DOWNLOAD));
    636642    fBottomButton->SetEnabled(true);
    637643    fInfoView->SetText("");
     
    705711    if (sShowSpeed && fBytesPerSecond != 0.0) {
    706712        // Draw speed info
    707713        char sizeBuffer[128];
    708         buffer = "(";
     714        buffer = B_TRANSLATE("(%1 of %2, %3/s)");
    709715        // Get strings for current and expected size and remove the unit
    710716        // from the current size string if it's the same as the expected
    711717        // size unit.
     
    720726                expectedSize.String() + expectedSizeUnitPos) == 0) {
    721727            currentSize.Truncate(currentSizeUnitPos);
    722728        }
    723         buffer << currentSize;
    724         buffer << " of ";
    725         buffer << expectedSize;
    726         buffer << ", ";
    727         buffer << string_for_size(fBytesPerSecond, sizeBuffer,
    728             sizeof(sizeBuffer));
    729         buffer << "/s)";
     729        buffer.ReplaceFirst("%1", currentSize);
     730        buffer.ReplaceFirst("%2", expectedSize);
     731        BString str9(string_for_size(fBytesPerSecond, sizeBuffer,
     732            sizeof(sizeBuffer)));
     733        buffer.ReplaceFirst("%3", str9.String());
    730734        float stringWidth = fInfoView->StringWidth(buffer.String());
    731735        if (stringWidth < fInfoView->Bounds().Width())
    732736            fInfoView->SetText(buffer.String());
    733737        else {
    734738            // complete string too wide, try with shorter version
    735             buffer << string_for_size(fBytesPerSecond, sizeBuffer,
    736                 sizeof(sizeBuffer));
    737             buffer << "/s";
     739            BString str0(string_for_size(fBytesPerSecond, sizeBuffer,
     740                sizeof(sizeBuffer)));
     741            buffer.ReplaceFirst("%3", str0.String());
    738742            stringWidth = fInfoView->StringWidth(buffer.String());
    739743            if (stringWidth < fInfoView->Bounds().Width())
    740744                fInfoView->SetText(buffer.String());
     
    757761        // TODO: Localization of time string...
    758762        if (now < finishTime - secondsPerDay) {
    759763            // process is going to take more than a day!
    760             sprintf(timeText, "%0*d:%0*d %0*d/%0*d/%ld",
     764            sprintf(timeText,
     765                B_TRANSLATE_WITH_COMMENT(
     766                "%0*d:%0*d %0*d/%0*d/%ld",
     767                "You can localize the date string"),
    761768                2, time->tm_hour, 2, time->tm_min,
    762769                2, time->tm_mon + 1, 2, time->tm_mday, year);
    763770        } else {
    764             sprintf(timeText, "%0*d:%0*d",
     771            sprintf(timeText, B_TRANSLATE_WITH_COMMENT("%0*d:%0*d",
     772                "You can localize the hour:minutes string"),
    765773                2, time->tm_hour, 2, time->tm_min);
    766774        }
    767775
    768         BString buffer1("Finish: ");
    769         buffer1 << timeText;
     776        BString buffer1(B_TRANSLATE("Finish:"));
     777        buffer1 << " " << timeText;
    770778        finishTime -= now;
    771779        time = gmtime(&finishTime);
    772780
     
    774782        if (finishTime > secondsPerDay) {
    775783            int64 days = finishTime / secondsPerDay;
    776784            if (days == 1)
    777                 buffer2 << "Over 1 day";
     785                buffer2 << B_TRANSLATE("Over 1 day left");
    778786            else
    779                 buffer2 << "Over " << days << " days";
     787            {
     788              BString str1(days);
     789              BString str2(B_TRANSLATE("Over %1 days left"));
     790              str2.ReplaceFirst("%2", str1.String());
     791              buffer2 << str2.String();
     792            }
    780793        } else if (finishTime > 60 * 60) {
    781794            int64 hours = finishTime / (60 * 60);
    782795            if (hours == 1)
    783                 buffer2 << "Over 1 hour";
     796                buffer2 << B_TRANSLATE("Over 1 hour left");
    784797            else
    785                 buffer2 << "Over " << hours << " hours";
     798            {
     799              BString str3(hours);
     800              BString str4(B_TRANSLATE("Over %2 hours left"));
     801              str4.ReplaceFirst("%2", str3.String());
     802              buffer2 << str4.String();
     803            }
    786804        } else if (finishTime > 60) {
    787805            int64 minutes = finishTime / 60;
    788806            if (minutes == 1)
    789                 buffer2 << "Over 1 minute";
     807                buffer2 << B_TRANSLATE("Over 1 minute left");
    790808            else
    791                 buffer2 << minutes << " minutes";
     809            {
     810              BString str5(minutes);
     811              BString str6(B_TRANSLATE("%3 minutes left"));
     812              str6.ReplaceFirst("%3", str5.String());
     813              buffer2 << str6.String();
     814            }
    792815        } else {
    793816            if (finishTime == 1)
    794                 buffer2 << "1 second";
     817                buffer2 << B_TRANSLATE("1 second left");
    795818            else
    796                 buffer2 << finishTime << " seconds";
     819            {
     820              BString str7(finishTime);
     821              BString str8("%4 seconds left");
     822              str8.ReplaceFirst("%4", str7.String());
     823              buffer2 << str8.String();
     824            }
    797825        }
    798826
    799         buffer2 << " left";
    800 
    801827        buffer = "(";
    802828        buffer << buffer1 << " - " << buffer2 << ")";
    803829
  • WebKit/haiku/WebPositive/SettingsWindow.cpp

     
    2727#include "SettingsWindow.h"
    2828
    2929#include <Button.h>
     30#include <Catalog.h>
    3031#include <CheckBox.h>
    3132#include <ControlLook.h>
    3233#include <GridLayoutBuilder.h>
    3334#include <GroupLayout.h>
    3435#include <GroupLayoutBuilder.h>
    35 #include <Locale.h>
    3636#include <MenuItem.h>
    3737#include <MenuField.h>
    3838#include <Message.h>
  • WebKit/haiku/WebPositive/support/DateTime.h

     
    3232
    3333class BTime {
    3434public:
    35                                 BTime();
    36                                 BTime(const BTime& other);
    37                                 BTime(int32 hour, int32 minute, int32 second,
    38                                     int32 microsecond = 0);
    39                                 BTime(const BMessage* archive);
    40                                 ~BTime();
     35                            BTime();
     36                            BTime(const BTime& other);
     37                            BTime(int32 hour, int32 minute, int32 second,
     38                                int32 microsecond = 0);
     39                            BTime(const BMessage* archive);
     40                            ~BTime();
    4141
    4242            status_t            Archive(BMessage* into) const;
    4343
    4444            bool                IsValid() const;
    4545            bool                IsValid(const BTime& time) const;
    4646            bool                IsValid(int32 hour, int32 minute, int32 second,
    47                                     int32 microsecond = 0) const;
     47                                int32 microsecond = 0) const;
    4848
    49     static  BTime               CurrentTime(time_type type);
     49      static    BTime               CurrentTime(time_type type);
    5050
    5151            BTime               Time() const;
    5252            bool                SetTime(const BTime& time);
     
    6565            int32               Millisecond() const;
    6666            int32               Microsecond() const;
    6767            bigtime_t           Difference(const BTime& time,
    68                                     diff_type type) const;
     68                                diff_type type) const;
    6969
    7070            bool                operator!=(const BTime& time) const;
    7171            bool                operator==(const BTime& time) const;
     
    8080            bigtime_t           _Microseconds() const;
    8181            BTime&              _AddMicroseconds(bigtime_t microseconds);
    8282            bool                _SetTime(bigtime_t hour, bigtime_t minute,
    83                                     bigtime_t second, bigtime_t microsecond);
     83                                bigtime_t second, bigtime_t microsecond);
    8484
    8585private:
    8686            bigtime_t           fMicroseconds;
     
    8989
    9090class BDate {
    9191public:
    92                                 BDate();
    93                                 BDate(const BDate& other);
    94                                 BDate(int32 year, int32 month, int32 day);
    95                                 BDate(const BMessage* archive);
    96                                 ~BDate();
     92                            BDate();
     93                            BDate(const BDate& other);
     94                            BDate(int32 year, int32 month, int32 day);
     95                            BDate(const BMessage* archive);
     96                            ~BDate();
    9797
    9898            status_t            Archive(BMessage* into) const;
    9999
    100100            bool                IsValid() const;
    101101            bool                IsValid(const BDate& date) const;
    102102            bool                IsValid(int32 year, int32 month,
    103                                     int32 day) const;
     103                                int32 day) const;
    104104
    105     static  BDate               CurrentDate(time_type type);
     105      static    BDate               CurrentDate(time_type type);
    106106
    107107            BDate               Date() const;
    108108            bool                SetDate(const BDate& date);
     
    129129            int32               DaysInMonth() const;
    130130
    131131            BString             ShortDayName() const;
    132     static  BString             ShortDayName(int32 day);
     132      static    BString             ShortDayName(int32 day);
    133133
    134134            BString             ShortMonthName() const;
    135     static  BString             ShortMonthName(int32 month);
     135      static    BString             ShortMonthName(int32 month);
    136136
    137137            BString             LongDayName() const;
    138     static  BString             LongDayName(int32 day);
     138      static    BString             LongDayName(int32 day);
    139139
    140140            BString             LongMonthName() const;
    141     static  BString             LongMonthName(int32 month);
     141      static    BString             LongMonthName(int32 month);
    142142
    143143            int32               DateToJulianDay() const;
    144     static  BDate               JulianDayToDate(int32 julianDay);
     144      static    BDate               JulianDayToDate(int32 julianDay);
    145145
    146146            bool                operator!=(const BDate& date) const;
    147147            bool                operator==(const BDate& date) const;
     
    156156            int32               _DaysInMonth(int32 year, int32 month) const;
    157157            bool                _SetDate(int32 year, int32 month, int32 day);
    158158            int32               _DateToJulianDay(int32 year, int32 month,
    159                                     int32 day) const;
     159                                int32 day) const;
    160160
    161161private:
    162162            int32               fDay;
     
    167167
    168168class BDateTime {
    169169public:
    170                                 BDateTime();
    171                                 BDateTime(const BDate &date, const BTime &time);
    172                                 BDateTime(const BMessage* archive);
    173                                 ~BDateTime();
     170                            BDateTime();
     171                            BDateTime(const BDate &date, const BTime &time);
     172                            BDateTime(const BMessage* archive);
     173                            ~BDateTime();
    174174
    175175            status_t            Archive(BMessage* into) const;
    176176
    177177            bool                IsValid() const;
    178178
    179     static  BDateTime           CurrentDateTime(time_type type);
     179      static    BDateTime           CurrentDateTime(time_type type);
    180180            void                SetDateTime(const BDate &date, const BTime &time);
    181181
    182182            BDate&              Date();
    183             const BDate&        Date() const;
     183          const BDate&              Date() const;
    184184            void                SetDate(const BDate &date);
    185185
    186186            BTime&              Time();
    187             const BTime&        Time() const;
     187          const BTime&              Time() const;
    188188            void                SetTime(const BTime &time);
    189189
    190190            int32               Time_t() const;
  • WebKit/haiku/WebPositive/support/FontSelectionView.cpp

     
    1414
    1515#include <Box.h>
    1616#include <Catalog.h>
    17 #include <Locale.h>
    1817#include <Looper.h>
    1918#include <MenuField.h>
    2019#include <MenuItem.h>
  • WebKit/haiku/WebPositive/support/StringForSize.cpp

     
    77
    88#include <stdio.h>
    99
     10#include <Catalog.h>
    1011
     12#undef B_TRANSLATE_CONTEXT
     13#define B_TRANSLATE_CONTEXT "String for size"
     14
     15
    1116namespace BPrivate {
    1217
    1318
     
    1621{
    1722    double kib = size / 1024.0;
    1823    if (kib < 1.0) {
    19         snprintf(string, stringSize, "%d bytes", (int)size);
     24        snprintf(string, stringSize, B_TRANSLATE("%d bytes"), (int)size);
    2025        return string;
    2126    }
    2227    double mib = kib / 1024.0;
    2328    if (mib < 1.0) {
    24         snprintf(string, stringSize, "%3.2f KiB", kib);
     29        snprintf(string, stringSize, B_TRANSLATE("%3.2f KiB"), kib);
    2530        return string;
    2631    }
    2732    double gib = mib / 1024.0;
    2833    if (gib < 1.0) {
    29         snprintf(string, stringSize, "%3.2f MiB", mib);
     34        snprintf(string, stringSize, B_TRANSLATE("%3.2f MiB"), mib);
    3035        return string;
    3136    }
    3237    double tib = gib / 1024.0;
    3338    if (tib < 1.0) {
    34         snprintf(string, stringSize, "%3.2f GiB", gib);
     39        snprintf(string, stringSize, B_TRANSLATE("%3.2f GiB"), gib);
    3540        return string;
    3641    }
    37     snprintf(string, stringSize, "%.2f TiB", tib);
     42    snprintf(string, stringSize, B_TRANSLATE("%.2f TiB"), tib);
    3843    return string;
    3944}
    4045
  • WebKit/haiku/WebPositive/support/FontSelectionView.h

     
    2727
    2828class FontSelectionView : public BHandler {
    2929public:
    30                                 FontSelectionView(const char* name,
    31                                     const char* label, bool separateStyles,
    32                                     const BFont* font = NULL);
    33     virtual                     ~FontSelectionView();
     30                        FontSelectionView(const char* name,
     31                            const char* label, bool separateStyles,
     32                            const BFont* font = NULL);
     33        virtual             ~FontSelectionView();
    3434
    35             void                AttachedToLooper();
    36     virtual void                MessageReceived(BMessage* message);
     35            void            AttachedToLooper();
     36        virtual void            MessageReceived(BMessage* message);
    3737
    38             void                SetMessage(BMessage* message);
    39             void                SetTarget(BHandler* target);
     38            void            SetMessage(BMessage* message);
     39            void            SetTarget(BHandler* target);
    4040
    41             void                SetFont(const BFont& font, float size);
    42             void                SetFont(const BFont& font);
    43             void                SetSize(float size);
    44             const BFont&        Font() const;
     41            void            SetFont(const BFont& font, float size);
     42            void            SetFont(const BFont& font);
     43            void            SetSize(float size);
     44        const BFont&            Font() const;
    4545
    46             void                SetDefaults();
    47             void                Revert();
    48             bool                IsDefaultable();
    49             bool                IsRevertable();
     46            void            SetDefaults();
     47            void            Revert();
     48            bool            IsDefaultable();
     49            bool            IsRevertable();
    5050
    51             void                UpdateFontsMenu();
     51            void            UpdateFontsMenu();
    5252
    5353            BLayoutItem*        CreateSizesLabelLayoutItem();
    5454            BLayoutItem*        CreateSizesMenuBarLayoutItem();
     
    5959            BLayoutItem*        CreateStylesLabelLayoutItem();
    6060            BLayoutItem*        CreateStylesMenuBarLayoutItem();
    6161
    62             BView*              PreviewBox() const;
     62            BView*          PreviewBox() const;
    6363           
    6464private:
    65             void                _Invoke();
     65            void            _Invoke();
    6666
    67             BFont               _DefaultFont() const;
    68             void                _SelectCurrentFont(bool select);
    69             void                _SelectCurrentSize(bool select);
    70             void                _UpdateFontPreview();
    71             void                _BuildSizesMenu();
    72             void                _AddStylesToMenu(const BFont& font,
    73                                     BMenu* menu) const;
     67            BFont           _DefaultFont() const;
     68            void            _SelectCurrentFont(bool select);
     69            void            _SelectCurrentSize(bool select);
     70            void            _UpdateFontPreview();
     71            void            _BuildSizesMenu();
     72            void            _AddStylesToMenu(const BFont& font,
     73                            BMenu* menu) const;
    7474
    7575protected:
    76             BMenuField*         fFontsMenuField;
    77             BMenuField*         fStylesMenuField;
    78             BMenuField*         fSizesMenuField;
    79             BPopUpMenu*         fFontsMenu;
    80             BPopUpMenu*         fStylesMenu;
    81             BPopUpMenu*         fSizesMenu;
     76            BMenuField*     fFontsMenuField;
     77            BMenuField*     fStylesMenuField;
     78            BMenuField*     fSizesMenuField;
     79            BPopUpMenu*     fFontsMenu;
     80            BPopUpMenu*     fStylesMenu;
     81            BPopUpMenu*     fSizesMenu;
    8282            BStringView*        fPreviewText;
    8383
    84             BFont               fSavedFont;
    85             BFont               fCurrentFont;
     84            BFont           fSavedFont;
     85            BFont           fCurrentFont;
    8686
    87             BMessage*           fMessage;
    88             BHandler*           fTarget;
     87            BMessage*       fMessage;
     88            BHandler*       fTarget;
    8989};
    9090
    9191#endif  // FONT_SELECTION_VIEW_H
  • WebKit/haiku/HaikuLauncher/LauncherApp.cpp

     
    3535#include "WebViewConstants.h"
    3636#include <Alert.h>
    3737#include <Autolock.h>
     38#include <Catalog.h>
    3839#include <Entry.h>
    3940#include <File.h>
    4041#include <FindDirectory.h>
     
    4243#include <Screen.h>
    4344#include <stdio.h>
    4445
     46#undef B_TRANSLATE_CONTEXT
     47#define B_TRANSLATE_CONTEXT "LauncherApp"
     48
    4549const char* kApplicationSignature = "application/x-vnd.RJL-HaikuLauncher";
    4650enum {
    4751    LOAD_AT_STARTING = 'lost'
     
    6569void LauncherApp::AboutRequested()
    6670{
    6771    BAlert* alert = new BAlert("About HaikuLauncher",
    68         "For testing WebKit...\n\nby Ryan Leavengood", "Sweet!");
     72        B_TRANSLATE("For testing WebKit...\n\nby Ryan Leavengood"),
     73    B_TRANSLATE_WITH_COMMENT("Sweet!", "Another word for OK"));
    6974    alert->Go();
    7075}
    7176
  • WebKit/haiku/HaikuLauncher/LauncherWindow.cpp

     
    3737#include "WebPage.h"
    3838#include "WebView.h"
    3939#include "WebViewConstants.h"
     40#include <Catalog.h>
    4041#include <Button.h>
    4142#include <Entry.h>
    4243#include <GridLayoutBuilder.h>
     
    5354
    5455#include <stdio.h>
    5556
     57#undef B_TRANSLATE_CONTEXT
     58#define B_TRANSLATE_CONTEXT "Launcher Window"
     59
    5660enum {
    5761    OPEN_LOCATION = 'open',
    5862    GO_BACK = 'goba',
     
    6771};
    6872
    6973LauncherWindow::LauncherWindow(BRect frame, ToolbarPolicy toolbarPolicy)
    70     : BWebWindow(frame, "HaikuLauncher",
     74    : BWebWindow(frame, B_TRANSLATE("HaikuLauncher"),
    7175        B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
    7276        B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS)
    7377{
     
    7680
    7781LauncherWindow::LauncherWindow(BRect frame, BWebView* webView,
    7882        ToolbarPolicy toolbarPolicy)
    79     : BWebWindow(frame, "HaikuLauncher",
     83    : BWebWindow(frame, B_TRANSLATE("HaikuLauncher"),
    8084        B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
    8185        B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS)
    8286{
     
    218222
    219223void LauncherWindow::LoadNegotiating(const BString& url, BWebView* view)
    220224{
    221     BString status("Requesting: ");
    222     status << url;
     225    BString status(B_TRANSLATE("Requesting:"));
     226    status << " " << url;
    223227    StatusChanged(status, view);
    224228}
    225229
     
    229233    if (m_url)
    230234        m_url->SetText(url.String());
    231235
    232     BString status("Loading: ");
    233     status << url;
     236    BString status(B_TRANSLATE("Loading:"));
     237    status << " " << url;
    234238    StatusChanged(status, view);
    235239}
    236240
     
    246250void LauncherWindow::LoadFailed(const BString& url, BWebView* view)
    247251{
    248252    BString status(url);
    249     status << " failed.";
     253    status << B_TRANSLATE(" failed.");
    250254    StatusChanged(status, view);
    251255    if (m_loadingProgressBar && !m_loadingProgressBar->IsHidden())
    252256        m_loadingProgressBar->Hide();
     
    255259void LauncherWindow::LoadFinished(const BString& url, BWebView* view)
    256260{
    257261    BString status(url);
    258     status << " finished.";
     262    status << B_TRANSLATE(" finished.");
    259263    StatusChanged(status, view);
    260264    if (m_loadingProgressBar && !m_loadingProgressBar->IsHidden())
    261265        m_loadingProgressBar->Hide();
     
    308312    if (toolbarPolicy == HaveToolbar) {
    309313        // Menu
    310314        m_menuBar = new BMenuBar("Main menu");
    311         BMenu* menu = new BMenu("Window");
     315        BMenu* menu = new BMenu(B_TRANSLATE("Window"));
    312316        BMessage* newWindowMessage = new BMessage(NEW_WINDOW);
    313317        newWindowMessage->AddString("url", "");
    314         BMenuItem* newItem = new BMenuItem("New", newWindowMessage, 'N');
     318        BMenuItem* newItem = new BMenuItem(B_TRANSLATE("New"), newWindowMessage, 'N');
    315319        menu->AddItem(newItem);
    316320        newItem->SetTarget(be_app);
    317         menu->AddItem(new BMenuItem("Open location", new BMessage(OPEN_LOCATION), 'L'));
     321        menu->AddItem(new BMenuItem(B_TRANSLATE("Open location"), new BMessage(OPEN_LOCATION), 'L'));
    318322        menu->AddSeparatorItem();
    319         menu->AddItem(new BMenuItem("Close", new BMessage(B_QUIT_REQUESTED), 'W', B_SHIFT_KEY));
    320         BMenuItem* quitItem = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q');
     323        menu->AddItem(new BMenuItem(B_TRANSLATE("Close"), new BMessage(B_QUIT_REQUESTED), 'W', B_SHIFT_KEY));
     324        BMenuItem* quitItem = new BMenuItem(B_TRANSLATE("Quit"), new BMessage(B_QUIT_REQUESTED), 'Q');
    321325        menu->AddItem(quitItem);
    322326        quitItem->SetTarget(be_app);
    323327        m_menuBar->AddItem(menu);
    324328
    325         menu = new BMenu("Text");
    326         menu->AddItem(new BMenuItem("Increase size", new BMessage(TEXT_SIZE_INCREASE), '+'));
    327         menu->AddItem(new BMenuItem("Decrease size", new BMessage(TEXT_SIZE_DECREASE), '-'));
    328         menu->AddItem(new BMenuItem("Reset size", new BMessage(TEXT_SIZE_RESET), '0'));
     329        menu = new BMenu(B_TRANSLATE("Text"));
     330        menu->AddItem(new BMenuItem(B_TRANSLATE("Increase size"), new BMessage(TEXT_SIZE_INCREASE), '+'));
     331        menu->AddItem(new BMenuItem(B_TRANSLATE("Decrease size"), new BMessage(TEXT_SIZE_DECREASE), '-'));
     332        menu->AddItem(new BMenuItem(B_TRANSLATE("Reset size"), new BMessage(TEXT_SIZE_RESET), '0'));
    329333        m_menuBar->AddItem(menu);
    330334
    331335        // Back, Forward & Stop
    332         m_BackButton = new BButton("Back", new BMessage(GO_BACK));
    333         m_ForwardButton = new BButton("Forward", new BMessage(GO_FORWARD));
    334         m_StopButton = new BButton("Stop", new BMessage(STOP));
     336        m_BackButton = new BButton(B_TRANSLATE("Back"), new BMessage(GO_BACK));
     337        m_ForwardButton = new BButton(B_TRANSLATE("Forward"), new BMessage(GO_FORWARD));
     338        m_StopButton = new BButton(B_TRANSLATE("Stop"), new BMessage(STOP));
    335339
    336340        // URL
    337341        m_url = new BTextControl("url", "", "", NULL);
    338342
    339343        // Go
    340         m_goButton = new BButton("", "Go", new BMessage(GOTO_URL));
     344        m_goButton = new BButton("", B_TRANSLATE("Go"), new BMessage(GOTO_URL));
    341345
    342346        // Status Bar
    343347        m_statusText = new BStringView("status", "");
     
    406410    BString windowTitle = title;
    407411    if (windowTitle.Length() > 0)
    408412        windowTitle << " - ";
    409     windowTitle << "HaikuLauncher";
     413    windowTitle << B_TRANSLATE("HaikuLauncher");
    410414    SetTitle(windowTitle.String());
    411415}
  • WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp

     
    6868
    6969#include <Alert.h>
    7070#include <Bitmap.h>
     71#include <Catalog.h>
    7172#include <Entry.h>
    7273#include <Message.h>
    7374#include <MimeType.h>
     
    8384#    define TRACE(x...)
    8485#endif
    8586
     87#undef B_TRANSLATE_CONTEXT
     88#define B_TRANSLATE_CONTEXT "Frame Loader Client Haiku"
     89
     90
    8691namespace WebCore {
    8792
    8893FrameLoaderClientHaiku::FrameLoaderClientHaiku(BWebPage* webPage, BWebFrame* webFrame)
     
    198203void FrameLoaderClientHaiku::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge& challenge)
    199204{
    200205    const ProtectionSpace& space = challenge.protectionSpace();
    201     String text = "Host \"" + space.host() + "\" requests authentication for realm \"" + space.realm() + "\"\n";
    202     text += "Authentication Scheme: ";
     206    BString str1(B_TRANSLATE("Host \"%1\" requests authentication for realm \"%2\"\n"));
     207    str1.ReplaceFirst("%1", space.host());
     208    str1.ReplaceFirst("%2", space.realm());
     209    String text = str1.String();
     210    BString str2(B_TRANSLATE("Authentication Scheme:"));
     211    str2 << " ";
     212    text += str2.String();
    203213    switch (space.authenticationScheme()) {
    204214    case ProtectionSpaceAuthenticationSchemeHTTPBasic:
    205         text += "Basic (data will be sent as plain text)";
     215        text += B_TRANSLATE("Basic (data will be sent as plain text)");
    206216        break;
    207217    case ProtectionSpaceAuthenticationSchemeHTTPDigest:
    208         text += "Digest (data will not be sent plain text)";
     218        text += B_TRANSLATE("Digest (data will not be sent plain text)");
    209219        break;
    210220    default:
    211         text += "Unknown (possibly plaintext)";
     221        text += B_TRANSLATE("Unknown (possibly plaintext)");
    212222        break;
    213223    }
    214224
     
    767777    CALLED();
    768778    notImplemented();
    769779    ResourceError error = ResourceError(String(), WebKitErrorCannotShowURL,
    770                                         request.url().string(), "Load request cancelled");
     780                                        request.url().string(), B_TRANSLATE("Load request cancelled"));
    771781    error.setIsCancellation(true);
    772782    return error;
    773783}
     
    777787    CALLED();
    778788    notImplemented();
    779789    return ResourceError(String(), WebKitErrorCannotUseRestrictedPort,
    780                          request.url().string(), "Not allowed to use restricted network port");
     790                         request.url().string(), B_TRANSLATE("Not allowed to use restricted network port"));
    781791}
    782792
    783793WebCore::ResourceError FrameLoaderClientHaiku::cannotShowURLError(const WebCore::ResourceRequest& request)
     
    785795    CALLED();
    786796    notImplemented();
    787797    return ResourceError(String(), WebKitErrorCannotShowURL,
    788                          request.url().string(), "URL cannot be shown");
     798                         request.url().string(), B_TRANSLATE("URL cannot be shown"));
    789799}
    790800
    791801WebCore::ResourceError FrameLoaderClientHaiku::interruptForPolicyChangeError(const WebCore::ResourceRequest& request)
     
    793803    CALLED();
    794804    notImplemented();
    795805    ResourceError error = ResourceError(String(), WebKitErrorFrameLoadInterruptedByPolicyChange,
    796                                         request.url().string(), "Frame load was interrupted");
     806                                        request.url().string(), B_TRANSLATE("Frame load was interrupted"));
    797807    error.setIsCancellation(true);
    798808    return error;
    799809}
     
    807817    // it could remember doing so and then we could ask here if we are the main frame,
    808818    // have no content, but did download something -- then we could asked to be closed.
    809819    return ResourceError(String(), WebKitErrorCannotShowMIMEType,
    810                          response.url().string(), "Content with the specified MIME type cannot be shown");
     820                         response.url().string(), B_TRANSLATE("Content with the specified MIME type cannot be shown"));
    811821}
    812822
    813823WebCore::ResourceError FrameLoaderClientHaiku::fileDoesNotExistError(const WebCore::ResourceResponse& response)
     
    815825    CALLED();
    816826    notImplemented();
    817827    return ResourceError(String(), WebKitErrorCannotShowURL,
    818                          response.url().string(), "File does not exist");
     828                         response.url().string(), B_TRANSLATE("File does not exist"));
    819829}
    820830
    821831ResourceError FrameLoaderClientHaiku::pluginWillHandleLoadError(const ResourceResponse& response)
     
    823833    CALLED();
    824834    notImplemented();
    825835    return ResourceError(String(), WebKitErrorPlugInWillHandleLoad,
    826                          response.url().string(), "Plugin will handle load");
     836                         response.url().string(), B_TRANSLATE("Plugin will handle load"));
    827837}
    828838
    829839bool FrameLoaderClientHaiku::shouldFallBack(const WebCore::ResourceError& error)
  • WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp

     
    3838#include "ResourceRequest.h"
    3939#include "WebPage.h"
    4040
     41#include <Catalog.h>
    4142
     43#undef B_TRANSLATE_CONTEXT
     44#define B_TRANSLATE_CONTEXT "Context menu client Haiku"
     45
    4246namespace WebCore {
    4347
    4448ContextMenuClientHaiku::ContextMenuClientHaiku(BWebPage* webPage)
     
    7983    String encoded = encodeWithURLEscapeSequences(searchString);
    8084    encoded.replace("%20", "+");
    8185   
    82     String url("http://www.google.com/search?q=");
     86    String url(B_TRANSLATE_WITH_COMMENT("http://www.google.com/search?q=",
     87    "You can localize this by changing google.com to google.de, for example"));
    8388    url.append(encoded);
    8489
    8590    ResourceRequest request = ResourceRequest(url);
  • WebKit/haiku/API/WebWindow.cpp

     
    3939#include <Application.h>
    4040#include <Bitmap.h>
    4141#include <Button.h>
     42#include <Catalog.h>
    4243#include <GridLayoutBuilder.h>
    4344#include <GroupLayout.h>
    4445#include <GroupLayoutBuilder.h>
     
    4748
    4849#include <stdio.h>
    4950
     51#undef B_TRANSLATE_CONTEXT
     52#define B_TRANSLATE_CONTEXT "Web Window"
     53
    5054enum {
    5155    ICON_FOR_URL_RECEIVED = 'icfu'
    5256};
     
    336340    if (!resizable)
    337341        flags |= B_NOT_RESIZABLE;
    338342
    339     BWebWindow* window = new BWebWindow(windowFrame, "WebKit window",
     343    BWebWindow* window = new BWebWindow(windowFrame, B_TRANSLATE("WebKit window"),
    340344        look, feel, flags);
    341345
    342346    window->AddChild(view);
     
    373377void BWebWindow::MainDocumentError(const BString& failingURL,
    374378    const BString& localizedDescription, BWebView* view)
    375379{
    376     BString errorString("Error loading ");
    377     errorString << failingURL;
     380    BString errorString(B_TRANSLATE("Error loading"));
     381    errorString << " " << failingURL;
    378382    errorString << ":\n\n";
    379383    errorString << localizedDescription;
    380384    BAlert* alert = new BAlert("Main document error", errorString.String(),
    381         "OK");
     385        B_TRANSLATE("OK"));
    382386    alert->Go(NULL);
    383387}
    384388
  • WebKit/Jamfile

     
    6464SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku WebCoreSupport ] ;
    6565
    6666SharedLibrary libwebkit.so :
    67     # WebCoreSupport
    68     ChromeClientHaiku.cpp
    69     ContextMenuClientHaiku.cpp
    70     CookieJarClientHaiku.cpp
    71     DragClientHaiku.cpp
    72     EditorClientHaiku.cpp
    73     FrameLoaderClientHaiku.cpp
    74     InspectorClientHaiku.cpp
    75     # API
    76     NetworkCookie.cpp
    77     NetworkCookieJar.cpp
    78     WebDownload.cpp
    79     WebDownloadPrivate.cpp
    80     WebFrame.cpp
    81     WebPage.cpp
    82     WebSettings.cpp
    83     WebSettingsPrivate.cpp
    84     WebView.cpp
    85     WebWindow.cpp
     67    # WebCoreSupport
     68    ChromeClientHaiku.cpp
     69    ContextMenuClientHaiku.cpp
     70    CookieJarClientHaiku.cpp
     71    DragClientHaiku.cpp
     72    EditorClientHaiku.cpp
     73    FrameLoaderClientHaiku.cpp
     74    InspectorClientHaiku.cpp
     75    # API
     76    NetworkCookie.cpp
     77    NetworkCookieJar.cpp
     78    WebDownload.cpp
     79    WebDownloadPrivate.cpp
     80    WebFrame.cpp
     81    WebPage.cpp
     82    WebSettings.cpp
     83    WebSettingsPrivate.cpp
     84    WebView.cpp
     85    WebWindow.cpp
    8686
    87     :
    88     libjavascriptcore.so libwebcore.so
    89     # Other required libraries
    90     icuuc stdc++
    91     # Haiku libraries
    92     be translation tracker
     87    :
     88    libjavascriptcore.so libwebcore.so
     89    # Other required libraries
     90    icuuc stdc++
     91    # Haiku libraries
     92    be translation tracker $(HAIKU_LOCALE_LIBS)
    9393;
    9494
     95DoCatalogs libwebkit.so :
     96    x-vnd.Haiku-libwebkit.so
     97    :
     98    WebWindow.cpp
     99    ContextMenuClientHaiku.cpp
     100    FrameLoaderClientHaiku.cpp
     101;
    95102
    96103#-----------------------------------------------------------------------------
    97104# HaikuLauncher
     
    99106SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku HaikuLauncher ] ;
    100107
    101108Application HaikuLauncher :
    102     LauncherApp.cpp
    103     LauncherWindow.cpp
     109    LauncherApp.cpp
     110    LauncherWindow.cpp
    104111
    105     :
    106     libjavascriptcore.so libwebcore.so libwebkit.so
    107     # Other required libraries
    108     curl icuuc icudt png sqlite3 xml2 z
    109     # Haiku libraries
    110     be bsd network stdc++ translation
    111     :
    112     Launcher.rdef
     112    :
     113    libjavascriptcore.so libwebcore.so libwebkit.so
     114    # Other required libraries
     115    curl icuuc icudt png sqlite3 xml2 z
     116    # Haiku libraries
     117    be bsd network stdc++ translation $(HAIKU_LOCALE_LIBS)
     118    :
     119    Launcher.rdef
    113120;
    114121
     122DoCatalogs HaikuLauncher :
     123    x-vnd.RJL-HaikuLauncher
     124    :
     125    LauncherApp.cpp
     126    LauncherWindow.cpp   
     127;
    115128
     129
    116130#-----------------------------------------------------------------------------
    117131# WebPositive
    118132#-----------------------------------------------------------------------------
     
    128142
    129143
    130144Application WebPositive :
    131     # autocompletion
    132     AutoCompleter.cpp
    133     AutoCompleterDefaultImpl.cpp
    134     TextViewCompleter.cpp
    135     # support
    136     BaseURL.cpp
     145    # autocompletion
     146    AutoCompleter.cpp
     147    AutoCompleterDefaultImpl.cpp
     148    TextViewCompleter.cpp
     149    # support
     150    BaseURL.cpp
    137151    BitmapButton.cpp
    138152    DateTime.cpp
    139153    FontSelectionView.cpp
     
    144158    TabContainerView.cpp
    145159    TabManager.cpp
    146160    TabView.cpp
    147     # WebPositive
     161    # WebPositive
    148162    AuthenticationPanel.cpp
    149     BrowserApp.cpp
    150     BrowserWindow.cpp
     163    BrowserApp.cpp
     164    BrowserWindow.cpp
    151165    BrowsingHistory.cpp
    152166    CredentialsStorage.cpp
    153167    DownloadProgressView.cpp
    154168    DownloadWindow.cpp
    155169    SettingsKeys.cpp
    156     SettingsWindow.cpp
    157     svn_revision.cpp
    158     URLInputGroup.cpp
     170    SettingsWindow.cpp
     171    svn_revision.cpp
     172    URLInputGroup.cpp
    159173
    160     :
    161     libjavascriptcore.so libwebcore.so libwebkit.so
    162     # Other required libraries
    163     curl icuuc icudata png sqlite3 xml2 z
    164     # Haiku libraries
    165     be bsd locale localestub network stdc++ tracker translation
    166     :
    167     WebPositive.rdef
     174    :
     175    libjavascriptcore.so libwebcore.so libwebkit.so
     176    # Other required libraries
     177    curl icuuc icudata png sqlite3 xml2 z
     178    # Haiku libraries
     179    be bsd locale localestub network stdc++ tracker translation $(HAIKU_LOCALE_LIBS)
     180    :
     181    WebPositive.rdef
    168182;
     183
     184DoCatalogs WebPositive :
     185    x-vnd.Haiku-WebPositive
     186    :
     187    FontSelectionView.cpp
     188    StringForSize.cpp
     189    AuthenticationPanel.cpp
     190    BrowserApp.cpp
     191    BrowserWindow.cpp
     192    DownloadProgressView.cpp
     193    DownloadWindow.cpp
     194    SettingsWindow.cpp
     195    URLInputGroup.cpp
     196;