Ticket #7210: WebKit.patch
File WebKit.patch, 67.8 KB (added by , 13 years ago) |
---|
-
WebKit/haiku/WebPositive/URLInputGroup.cpp
5 5 6 6 #include "URLInputGroup.h" 7 7 8 #include <Catalog.h> 8 9 #include <Bitmap.h> 9 10 #include <Button.h> 10 11 #include <ControlLook.h> … … 28 29 #include "TextViewCompleter.h" 29 30 30 31 32 #undef B_TRANSLATE_CONTEXT 33 #define B_TRANSLATE_CONTEXT "URLInputGroup" 34 35 31 36 class URLChoice : public BAutoCompleter::Choice { 32 37 public: 33 38 URLChoice(const BString& choiceText, const BString& displayText, … … 235 240 be_clipboard->Unlock(); 236 241 } 237 242 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)); 242 247 cutItem->SetEnabled(canCutOrCopy); 243 248 copyItem->SetEnabled(canCutOrCopy); 244 249 pasteItem->SetEnabled(canPaste); -
WebKit/haiku/WebPositive/AuthenticationPanel.cpp
28 28 #include "AuthenticationPanel.h" 29 29 30 30 #include <Button.h> 31 #include <Catalog.h> 31 32 #include <CheckBox.h> 32 33 #include <ControlLook.h> 33 34 #include <GridLayoutBuilder.h> … … 40 41 #include <TextControl.h> 41 42 #include <stdio.h> 42 43 44 #undef B_TRANSLATE_CONTEXT 45 #define B_TRANSLATE_CONTEXT "AuthenticationPanel" 46 47 43 48 static const uint32 kMsgPanelOK = 'pnok'; 44 49 static const uint32 kMsgJitter = 'jitr'; 45 50 static const uint32 kHidePassword = 'hdpw'; 46 51 47 52 AuthenticationPanel::AuthenticationPanel(BRect parentFrame) 48 : BWindow(BRect(-1000, -1000, -900, -900), "Authentication Required", 53 : BWindow(BRect(-1000, -1000, -900, -900), 54 B_TRANSLATE("Authentication Required"), 49 55 B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL, 50 56 B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE | B_NOT_ZOOMABLE 51 57 | B_CLOSE_ON_ESCAPE | B_AUTO_UPDATE_SIZE_LIMITS) 52 58 , 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))) 59 72 , m_cancelled(false) 60 , m_exitSemaphore(create_sem(0, "Authentication Panel"))73 , m_exitSemaphore(create_sem(0, B_TRANSLATE("Authentication Panel"))) 61 74 { 62 75 } 63 76 -
WebKit/haiku/WebPositive/DownloadWindow.cpp
31 31 32 32 #include <Alert.h> 33 33 #include <Button.h> 34 #include <Catalog.h> 34 35 #include <ControlLook.h> 35 36 #include <Entry.h> 36 37 #include <File.h> … … 53 54 #include "WebDownload.h" 54 55 #include "WebPage.h" 55 56 57 #undef B_TRANSLATE_CONTEXT 58 #define B_TRANSLATE_CONTEXT "DownloadWindow" 56 59 57 60 enum { 58 61 INIT = 'init', … … 134 137 135 138 DownloadWindow::DownloadWindow(BRect frame, bool visible, 136 139 SettingsMessage* settings) 137 : BWindow(frame, "Downloads",140 : BWindow(frame, B_TRANSLATE("Downloads"), 138 141 B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 139 142 B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS | B_NOT_ZOOMABLE), 140 143 fMinimizeOnClose(false) … … 155 158 fDownloadViewsLayout = downloadsGroupView->GroupLayout(); 156 159 157 160 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"), 160 163 new BMessage(OPEN_DOWNLOADS_FOLDER))); 161 164 BMessage* newWindowMessage = new BMessage(NEW_WINDOW); 162 165 newWindowMessage->AddString("url", ""); 163 BMenuItem* newWindowItem = new BMenuItem( "New browser window",166 BMenuItem* newWindowItem = new BMenuItem(B_TRANSLATE("New browser window"), 164 167 newWindowMessage, 'N'); 165 168 menu->AddItem(newWindowItem); 166 169 newWindowItem->SetTarget(be_app); 167 170 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')); 169 172 menuBar->AddItem(menu); 170 173 171 174 fDownloadsScrollView = new DownloadContainerScrollView(downloadsGroupView); 172 175 173 fRemoveFinishedButton = new BButton( "Remove finished",176 fRemoveFinishedButton = new BButton(B_TRANSLATE("Remove finished"), 174 177 new BMessage(REMOVE_FINISHED_DOWNLOADS)); 175 178 fRemoveFinishedButton->SetEnabled(false); 176 179 177 fRemoveMissingButton = new BButton( "Remove missing",180 fRemoveMissingButton = new BButton(B_TRANSLATE("Remove missing"), 178 181 new BMessage(REMOVE_MISSING_DOWNLOADS)); 179 182 fRemoveMissingButton->SetEnabled(false); 180 183 … … 274 277 if (status == B_OK) 275 278 status = be_roster->Launch(&ref); 276 279 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); 280 283 BAlert* alert = new BAlert("Error opening downloads folder", 281 errorString.String(), "OK");284 errorString.String(), B_TRANSLATE("OK")); 282 285 alert->Go(NULL); 283 286 } 284 287 break; -
WebKit/haiku/WebPositive/BrowserWindow.cpp
53 53 #include <Application.h> 54 54 #include <Bitmap.h> 55 55 #include <Button.h> 56 #include <Catalog.h> 56 57 #include <CheckBox.h> 57 58 #include <Clipboard.h> 58 59 #include <Directory.h> … … 78 79 79 80 #include <stdio.h> 80 81 82 #undef B_TRANSLATE_CONTEXT 83 #define B_TRANSLATE_CONTEXT "BrowserWindow" 81 84 82 85 enum { 83 86 OPEN_LOCATION = 'open', … … 149 152 private: 150 153 void _AddStaticItems() 151 154 { 152 AddItem(new BMenuItem( "Manage bookmarks",155 AddItem(new BMenuItem(B_TRANSLATE("Manage bookmarks"), 153 156 new BMessage(SHOW_BOOKMARKS), 'M'), 0); 154 AddItem(new BMenuItem( "Bookmark this page",157 AddItem(new BMenuItem(B_TRANSLATE("Bookmark this page"), 155 158 new BMessage(CREATE_BOOKMARK), 'B'), 0); 156 159 } 157 160 }; … … 282 285 #else 283 286 BMenu* mainMenu = new BMenuBar("Main menu"); 284 287 #endif 285 BMenu* menu = new BMenu( "Window");288 BMenu* menu = new BMenu(B_TRANSLATE("Window")); 286 289 BMessage* newWindowMessage = new BMessage(NEW_WINDOW); 287 290 newWindowMessage->AddString("url", ""); 288 BMenuItem* newItem = new BMenuItem( "New window", newWindowMessage, 'N');291 BMenuItem* newItem = new BMenuItem(B_TRANSLATE("New window"), newWindowMessage, 'N'); 289 292 menu->AddItem(newItem); 290 293 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'); 292 295 menu->AddItem(newItem); 293 296 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), 295 298 'L')); 296 299 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), 298 301 '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')); 300 303 menu->AddSeparatorItem(); 301 menu->AddItem(new BMenuItem( "Downloads",304 menu->AddItem(new BMenuItem(B_TRANSLATE("Downloads"), 302 305 new BMessage(SHOW_DOWNLOAD_WINDOW), 'D')); 303 menu->AddItem(new BMenuItem( "Settings",306 menu->AddItem(new BMenuItem(B_TRANSLATE("Settings"), 304 307 new BMessage(SHOW_SETTINGS_WINDOW))); 305 BMenuItem* aboutItem = new BMenuItem( "About",308 BMenuItem* aboutItem = new BMenuItem(B_TRANSLATE("About"), 306 309 new BMessage(B_ABOUT_REQUESTED)); 307 310 menu->AddItem(aboutItem); 308 311 aboutItem->SetTarget(be_app); 309 312 menu->AddSeparatorItem(); 310 BMenuItem* quitItem = new BMenuItem( "Quit",313 BMenuItem* quitItem = new BMenuItem(B_TRANSLATE("Quit"), 311 314 new BMessage(B_QUIT_REQUESTED), 'Q'); 312 315 menu->AddItem(quitItem); 313 316 quitItem->SetTarget(be_app); 314 317 mainMenu->AddItem(menu); 315 318 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), 318 321 '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), 320 323 '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), 322 325 'V')); 323 326 menu->AddSeparatorItem(); 324 327 menu->AddItem(new BMenuItem("Find", new BMessage(EDIT_SHOW_FIND_GROUP), 325 328 'F')); 326 menu->AddItem(fFindPreviousMenuItem = new BMenuItem( "Find previous",329 menu->AddItem(fFindPreviousMenuItem = new BMenuItem(B_TRANSLATE("Find previous"), 327 330 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"), 329 332 new BMessage(EDIT_FIND_NEXT), 'G')); 330 333 mainMenu->AddItem(menu); 331 334 fFindPreviousMenuItem->SetEnabled(false); 332 335 fFindNextMenuItem->SetEnabled(false); 333 336 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')); 336 339 menu->AddSeparatorItem(); 337 menu->AddItem(new BMenuItem( "Increase size",340 menu->AddItem(new BMenuItem(B_TRANSLATE("Increase size"), 338 341 new BMessage(ZOOM_FACTOR_INCREASE), '+')); 339 menu->AddItem(new BMenuItem( "Decrease size",342 menu->AddItem(new BMenuItem(B_TRANSLATE("Decrease size"), 340 343 new BMessage(ZOOM_FACTOR_DECREASE), '-')); 341 menu->AddItem(new BMenuItem( "Reset size",344 menu->AddItem(new BMenuItem(B_TRANSLATE("Reset size"), 342 345 new BMessage(ZOOM_FACTOR_RESET), '0')); 343 fZoomTextOnlyMenuItem = new BMenuItem( "Zoom text only",346 fZoomTextOnlyMenuItem = new BMenuItem(B_TRANSLATE("Zoom text only"), 344 347 new BMessage(ZOOM_TEXT_ONLY)); 345 348 fZoomTextOnlyMenuItem->SetMarked(fZoomTextOnly); 346 349 menu->AddItem(fZoomTextOnlyMenuItem); 347 350 348 351 menu->AddSeparatorItem(); 349 fFullscreenItem = new BMenuItem( "Fullscreen",352 fFullscreenItem = new BMenuItem(B_TRANSLATE("Fullscreen"), 350 353 new BMessage(TOGGLE_FULLSCREEN), B_RETURN); 351 354 menu->AddItem(fFullscreenItem); 352 menu->AddItem(new BMenuItem( "Page source",355 menu->AddItem(new BMenuItem(B_TRANSLATE("Page source"), 353 356 new BMessage(SHOW_PAGE_SOURCE), 'U')); 354 357 mainMenu->AddItem(menu); 355 358 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"), 358 361 new BMessage(GO_BACK), B_LEFT_ARROW)); 359 fHistoryMenu->AddItem(fForwardMenuItem = new BMenuItem( "Forward",362 fHistoryMenu->AddItem(fForwardMenuItem = new BMenuItem(B_TRANSLATE("Forward"), 360 363 new BMessage(GO_FORWARD), B_RIGHT_ARROW)); 361 364 fHistoryMenu->AddSeparatorItem(); 362 365 fHistoryMenuFixedItemCount = fHistoryMenu->CountItems(); … … 367 370 if (_BookmarkPath(bookmarkPath) == B_OK 368 371 && get_ref_for_path(bookmarkPath.Path(), &bookmarkRef) == B_OK) { 369 372 BMenu* bookmarkMenu 370 = new BookmarkMenu( "Bookmarks", this, &bookmarkRef);373 = new BookmarkMenu(B_TRANSLATE("Bookmarks"), this, &bookmarkRef); 371 374 mainMenu->AddItem(bookmarkMenu); 372 375 } 373 376 374 377 // 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)); 376 379 fBackButton->SetIcon(201); 377 380 fBackButton->TrimIcon(); 378 381 379 fForwardButton = new IconButton( "Forward", 0, NULL, new BMessage(GO_FORWARD));382 fForwardButton = new IconButton(B_TRANSLATE("Forward"), 0, NULL, new BMessage(GO_FORWARD)); 380 383 fForwardButton->SetIcon(202); 381 384 fForwardButton->TrimIcon(); 382 385 383 fStopButton = new IconButton( "Stop", 0, NULL, new BMessage(STOP));386 fStopButton = new IconButton(B_TRANSLATE("Stop"), 0, NULL, new BMessage(STOP)); 384 387 fStopButton->SetIcon(204); 385 388 fStopButton->TrimIcon(); 386 389 387 fHomeButton = new IconButton( "Home", 0, NULL, new BMessage(HOME));390 fHomeButton = new IconButton(B_TRANSLATE("Home"), 0, NULL, new BMessage(HOME)); 388 391 fHomeButton->SetIcon(206); 389 392 fHomeButton->TrimIcon(); 390 393 if (!fAppSettings->GetValue(kSettingsKeyShowHomeButton, true)) … … 413 416 const float kElementSpacing = 5; 414 417 415 418 // Find group 416 fFindTextControl = new BTextControl("find", "Find:", "",419 fFindTextControl = new BTextControl("find", B_TRANSLATE("Find:"), "", 417 420 new BMessage(EDIT_FIND_NEXT)); 418 421 fFindTextControl->SetModificationMessage(new BMessage(FIND_TEXT_CHANGED)); 419 fFindPreviousButton = new BButton( "Previous",422 fFindPreviousButton = new BButton(B_TRANSLATE("Previous"), 420 423 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"), 423 426 new BMessage(EDIT_HIDE_FIND_GROUP)); 424 fFindCaseSensitiveCheckBox = new BCheckBox( "Match case");427 fFindCaseSensitiveCheckBox = new BCheckBox(B_TRANSLATE("Match case")); 425 428 BGroupLayout* findGroup = BLayoutBuilder::Group<>(B_VERTICAL, 0.0) 426 429 .Add(new BSeparatorView(B_HORIZONTAL, B_PLAIN_BORDER)) 427 430 .Add(BGroupLayoutBuilder(B_HORIZONTAL, kElementSpacing) … … 671 674 BrowsingHistory* history = BrowsingHistory::DefaultInstance(); 672 675 if (history->CountItems() == 0) 673 676 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")); 676 681 if (alert->Go() == 0) 677 682 history->Clear(); 678 683 break; … … 719 724 } 720 725 message->RemoveName("refs"); 721 726 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()); 725 730 BAlert* alert = new BAlert("Open bookmarks confirmation", 726 string.String(), "Cancel", "Open all");731 string.String(), B_TRANSLATE("Cancel"), B_TRANSLATE("Open all")); 727 732 if (alert->Go() == 0) 728 733 break; 729 734 } … … 1222 1227 1223 1228 fURLInputGroup->SetText(url.String()); 1224 1229 1225 BString status( "Requesting: ");1226 status << url;1230 BString status(B_TRANSLATE("Requesting:")); 1231 status << " " << url; 1227 1232 view->WebPage()->SetStatusMessage(status); 1228 1233 } 1229 1234 … … 1237 1242 // This hook is invoked when the load is commited. 1238 1243 fURLInputGroup->SetText(url.String()); 1239 1244 1240 BString status( "Loading: ");1241 status << url;1245 BString status(B_TRANSLATE("Loading:")); 1246 status << " " << url; 1242 1247 view->WebPage()->SetStatusMessage(status); 1243 1248 } 1244 1249 … … 1264 1269 return; 1265 1270 1266 1271 BString status(url); 1267 status << " failed.";1272 status << B_TRANSLATE_WITH_COMMENT(" failed.", "The whole message is \"url failed.\""); 1268 1273 view->WebPage()->SetStatusMessage(status); 1269 1274 if (!fLoadingProgressBar->IsHidden()) 1270 1275 fLoadingProgressBar->Hide(); … … 1278 1283 return; 1279 1284 1280 1285 BString status(url); 1281 status << " finished.";1286 status << B_TRANSLATE_WITH_COMMENT(" finished.", "The whole message is \"url finished.\"");; 1282 1287 view->WebPage()->SetStatusMessage(status); 1283 1288 if (!fLoadingProgressBar->IsHidden()) 1284 1289 fLoadingProgressBar->Hide(); … … 1575 1580 BPath path; 1576 1581 status_t status = _BookmarkPath(path); 1577 1582 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"), 1582 1587 NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); 1583 1588 alert->Go(); 1584 1589 return; … … 1603 1608 // URLs, only for matching file names. 1604 1609 BDirectory directory(path.Path()); 1605 1610 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")); 1610 1614 alert->Go(); 1611 1615 return; 1612 1616 } … … 1694 1698 } 1695 1699 1696 1700 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"), 1701 1705 NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); 1702 1706 alert->Go(); 1703 1707 return; … … 1717 1721 status = be_roster->Launch(&ref); 1718 1722 1719 1723 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"), 1724 1728 NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT); 1725 1729 alert->Go(); 1726 1730 return; … … 1861 1865 return; 1862 1866 1863 1867 int32 count = history->CountItems(); 1864 BMenuItem* clearHistoryItem = new BMenuItem( "Clear history",1868 BMenuItem* clearHistoryItem = new BMenuItem(B_TRANSLATE("Clear history"), 1865 1869 new BMessage(CLEAR_HISTORY)); 1866 1870 clearHistoryItem->SetEnabled(count > 0); 1867 1871 fHistoryMenu->AddItem(clearHistoryItem); … … 1889 1893 BDateTime fiveDaysAgoStart = fourDaysAgoStart; 1890 1894 fiveDaysAgoStart.Date().AddDays(-1); 1891 1895 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")); 1894 1898 BMenu* twoDaysAgoMenu = new BMenu( 1895 1899 twoDaysAgoStart.Date().LongDayName().String()); 1896 1900 BMenu* threeDaysAgoMenu = new BMenu( … … 1899 1903 fourDaysAgoStart.Date().LongDayName().String()); 1900 1904 BMenu* fiveDaysAgoMenu = new BMenu( 1901 1905 fiveDaysAgoStart.Date().LongDayName().String()); 1902 BMenu* earlierMenu = new BMenu( "Earlier");1906 BMenu* earlierMenu = new BMenu(B_TRANSLATE("Earlier")); 1903 1907 1904 1908 for (int32 i = 0; i < count; i++) { 1905 1909 BrowsingHistoryItem historyItem = history->HistoryItemAt(i); … … 2134 2138 { 2135 2139 BString result = url; 2136 2140 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.")); 2138 2145 return result; 2139 2146 } 2140 2147 … … 2203 2210 } 2204 2211 2205 2212 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")); 2210 2216 alert->Go(NULL); 2211 2217 } 2212 2218 } -
WebKit/haiku/WebPositive/tabview/TabManager.h
46 46 47 47 class TabManager { 48 48 public: 49 50 51 virtual~TabManager();49 TabManager(const BMessenger& target, 50 BMessage* newTabMessage); 51 virtual ~TabManager(); 52 52 53 void 53 void SetTarget(const BMessenger& target); 54 54 const BMessenger& Target() const; 55 55 56 56 #if INTEGRATE_MENU_INTO_TAB_BAR 57 BMenu* 57 BMenu* Menu() const; 58 58 #endif 59 59 60 BView* 61 BView* 62 BView* 60 BView* TabGroup() const; 61 BView* GetTabContainerView() const; 62 BView* ContainerView() const; 63 63 64 BView* 65 int32 66 bool 64 BView* ViewForTab(int32 tabIndex) const; 65 int32 TabForView(const BView* containedView) const; 66 bool HasView(const BView* containedView) const; 67 67 68 void 69 void 70 int32 71 void 68 void SelectTab(int32 tabIndex); 69 void SelectTab(const BView* containedView); 70 int32 SelectedTabIndex() const; 71 void CloseTab(int32 tabIndex); 72 72 73 void 74 75 BView* 76 int32 73 void AddTab(BView* view, const char* label, 74 int32 index = -1); 75 BView* RemoveTab(int32 index); 76 int32 CountTabs() const; 77 77 78 void 78 void SetTabLabel(int32 tabIndex, const char* label); 79 79 const BString& TabLabel(int32); 80 void 81 82 void 80 void SetTabIcon(const BView* containedView, 81 const BBitmap* icon); 82 void SetCloseButtonsAvailable(bool available); 83 83 84 84 private: 85 85 #if INTEGRATE_MENU_INTO_TAB_BAR 86 BMenu* 86 BMenu* fMenu; 87 87 #endif 88 88 TabContainerGroup* fTabContainerGroup; 89 89 TabContainerView* fTabContainerView; 90 BView* 90 BView* fContainerView; 91 91 BCardLayout* fCardLayout; 92 TabManagerController* 92 TabManagerController* fController; 93 93 94 BMessenger 94 BMessenger fTarget; 95 95 }; 96 96 97 97 #endif // TAB_MANAGER_H -
WebKit/haiku/WebPositive/tabview/TabView.h
40 40 41 41 class TabView { 42 42 public: 43 44 virtual~TabView();43 TabView(); 44 virtual ~TabView(); 45 45 46 virtual BSizeMinSize();47 virtual BSizePreferredSize();48 virtual BSizeMaxSize();46 virtual BSize MinSize(); 47 virtual BSize PreferredSize(); 48 virtual BSize MaxSize(); 49 49 50 void 51 virtual voidDrawBackground(BView* owner, BRect frame,52 53 54 virtual voidDrawContents(BView* owner, BRect frame,55 56 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); 57 57 58 virtual voidMouseDown(BPoint where, uint32 buttons);59 virtual voidMouseUp(BPoint where);60 virtual voidMouseMoved(BPoint where, uint32 transit,61 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); 62 62 63 void 64 bool 65 void 66 virtual voidUpdate(bool isFirst, bool isLast,67 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); 68 68 69 69 BLayoutItem* LayoutItem() const; 70 void 71 70 void SetContainerView( 71 TabContainerView* containerView); 72 72 TabContainerView* ContainerView() const; 73 73 74 void 74 void SetLabel(const char* label); 75 75 const BString& Label() const; 76 76 77 BRect 77 BRect Frame() const; 78 78 79 79 private: 80 float 80 float _LabelHeight() const; 81 81 82 82 private: 83 83 TabContainerView* fContainerView; 84 84 TabLayoutItem* fLayoutItem; 85 85 86 BString 86 BString fLabel; 87 87 88 bool 89 bool 90 bool 88 bool fIsFirst; 89 bool fIsLast; 90 bool fIsFront; 91 91 }; 92 92 93 93 94 94 class TabLayoutItem : public BAbstractLayoutItem { 95 95 public: 96 96 TabLayoutItem(TabView* parent); 97 97 98 virtual boolIsVisible();99 virtual voidSetVisible(bool visible);98 virtual bool IsVisible(); 99 virtual void SetVisible(bool visible); 100 100 101 virtual BRectFrame();102 virtual voidSetFrame(BRect frame);101 virtual BRect Frame(); 102 virtual void SetFrame(BRect frame); 103 103 104 virtual BView*View();104 virtual BView* View(); 105 105 106 virtual BSizeBaseMinSize();107 virtual BSizeBaseMaxSize();108 virtual BSizeBasePreferredSize();109 virtual BAlignmentBaseAlignment();106 virtual BSize BaseMinSize(); 107 virtual BSize BaseMaxSize(); 108 virtual BSize BasePreferredSize(); 109 virtual BAlignment BaseAlignment(); 110 110 111 TabView* 112 void 113 void 111 TabView* Parent() const; 112 void InvalidateContainer(); 113 void InvalidateContainer(BRect frame); 114 114 private: 115 TabView* 116 BRect 117 bool 115 TabView* fParent; 116 BRect fFrame; 117 bool fVisible; 118 118 }; 119 119 120 120 -
WebKit/haiku/WebPositive/tabview/TabContainerView.h
47 47 }; 48 48 49 49 public: 50 51 virtual 50 TabContainerView(Controller* controller); 51 virtual ~TabContainerView(); 52 52 53 53 virtual BSize MinSize(); 54 54 … … 59 59 virtual void MouseDown(BPoint where); 60 60 virtual void MouseUp(BPoint where); 61 61 virtual void MouseMoved(BPoint where, uint32 transit, 62 62 const BMessage* dragMessage); 63 63 64 64 virtual void DoLayout(); 65 65 66 void 67 void 68 TabView* 69 TabView* 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; 70 70 71 int32 71 int32 IndexOf(TabView* tab) const; 72 72 73 void 74 void 73 void SelectTab(int32 tabIndex); 74 void SelectTab(TabView* tab); 75 75 76 void 76 void SetTabLabel(int32 tabIndex, const char* label); 77 77 78 void 79 int32 80 int32 78 void SetFirstVisibleTabIndex(int32 index); 79 int32 FirstVisibleTabIndex() const; 80 int32 MaxFirstVisibleTabIndex() const; 81 81 82 bool 83 bool 82 bool CanScrollLeft() const; 83 bool CanScrollRight() const; 84 84 85 85 private: 86 TabView* 87 void 88 89 void 90 void 91 float 92 void 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(); 93 93 94 94 private: 95 TabView* 96 bool 97 uint32 98 TabView* 99 Controller* 100 int32 95 TabView* fLastMouseEventTab; 96 bool fMouseDown; 97 uint32 fClickCount; 98 TabView* fSelectedTab; 99 Controller* fController; 100 int32 fFirstVisibleTabIndex; 101 101 }; 102 102 103 103 #endif // TAB_CONTAINER_VIEW_H -
WebKit/haiku/WebPositive/BrowserApp.cpp
41 41 #include "WebView.h" 42 42 #include <Alert.h> 43 43 #include <Autolock.h> 44 #include <Catalog.h> 44 45 #include <Directory.h> 45 46 #include <Entry.h> 46 47 #include <FindDirectory.h> … … 51 52 #include <stdio.h> 52 53 53 54 55 #undef B_TRANSLATE_CONTEXT 56 #define B_TRANSLATE_CONTEXT "BrowserApp" 57 54 58 const char* kApplicationSignature = "application/x-vnd.Haiku-WebPositive"; 55 const char* kApplicationName = "WebPositive";59 const char* kApplicationName = B_TRANSLATE_MARK("WebPositive"); 56 60 static const uint32 PRELOAD_BROWSING_HISTORY = 'plbh'; 57 61 58 62 #define ENABLE_NATIVE_COOKIES 0 … … 86 90 void 87 91 BrowserApp::AboutRequested() 88 92 { 89 BString aboutText( "WebPositive\n\nby Ryan Leavengood, Andrea Anzani, "90 "Maxime Simon, Michael Lotz, Rene Gollent and Stephan Aßmus") ;91 aboutText << "\n\n SVN 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; 92 96 93 97 BAlert* alert = new BAlert("About WebPositive", aboutText.String(), 94 "Sweet!");98 B_TRANSLATE_WITH_COMMENT("Sweet!", "Another word for OK")); 95 99 alert->Go(NULL); 96 100 } 97 101 -
WebKit/haiku/WebPositive/DownloadProgressView.cpp
32 32 #include <Alert.h> 33 33 #include <Bitmap.h> 34 34 #include <Button.h> 35 #include <Catalog.h> 35 36 #include <Clipboard.h> 36 37 #include <Directory.h> 37 38 #include <Entry.h> … … 51 52 #include "StringForSize.h" 52 53 53 54 55 #undef B_TRANSLATE_CONTEXT 56 #define B_TRANSLATE_CONTEXT "Download Progress View" 57 54 58 enum { 55 59 OPEN_DOWNLOAD = 'opdn', 56 60 RESTART_DOWNLOAD = 'rsdn', … … 73 77 public: 74 78 IconView(const BEntry& entry) 75 79 : 76 BView( "Download icon", B_WILL_DRAW),80 BView(B_TRANSLATE("Download icon"), B_WILL_DRAW), 77 81 fIconBitmap(BRect(0, 0, 31, 31), 0, B_RGBA32), 78 82 fDimmedIcon(false) 79 83 { … … 83 87 84 88 IconView() 85 89 : 86 BView( "Download icon", B_WILL_DRAW),90 BView(B_TRANSLATE("Download icon"), B_WILL_DRAW), 87 91 fIconBitmap(BRect(0, 0, 31, 31), 0, B_RGBA32), 88 92 fDimmedIcon(false) 89 93 { … … 93 97 94 98 IconView(BMessage* archive) 95 99 : 96 BView( "Download icon", B_WILL_DRAW),100 BView(B_TRANSLATE("Download icon"), B_WILL_DRAW), 97 101 fIconBitmap(archive), 98 102 fDimmedIcon(true) 99 103 { … … 230 234 if (archive->FindFloat("value", &value) == B_OK) 231 235 fStatusBar->SetTo(value); 232 236 } else 233 fStatusBar = new BStatusBar("download progress", "Download"); 237 fStatusBar = new BStatusBar("download progress", 238 B_TRANSLATE("Download")); 234 239 fStatusBar->SetMaxValue(100); 235 240 fStatusBar->SetBarHeight(12); 236 241 … … 246 251 fIconView = new IconView(); 247 252 248 253 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)); 250 255 else { 251 fTopButton = new SmallButton( "Open", new BMessage(OPEN_DOWNLOAD));256 fTopButton = new SmallButton(B_TRANSLATE("Open"), new BMessage(OPEN_DOWNLOAD)); 252 257 fTopButton->SetEnabled(fDownload == NULL); 253 258 } 254 259 if (fDownload) 255 fBottomButton = new SmallButton( "Cancel", new BMessage(CANCEL_DOWNLOAD));260 fBottomButton = new SmallButton(B_TRANSLATE("Cancel"), new BMessage(CANCEL_DOWNLOAD)); 256 261 else { 257 fBottomButton = new SmallButton( "Remove", new BMessage(REMOVE_DOWNLOAD));262 fBottomButton = new SmallButton(B_TRANSLATE("Remove"), new BMessage(REMOVE_DOWNLOAD)); 258 263 fBottomButton->SetEnabled(fDownload == NULL); 259 264 } 260 265 … … 400 405 status = be_roster->Launch(&ref); 401 406 if (status != B_OK && status != B_ALREADY_RUNNING) { 402 407 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")); 404 410 alert->Go(NULL); 405 411 } 406 412 break; … … 567 573 screenWhere += BPoint(2, 2); 568 574 569 575 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"), 571 577 new BMessage(COPY_URL_TO_CLIPBOARD)); 572 578 copyURL->SetEnabled(fURL.Length() > 0); 573 579 contextMenu->AddItem(copyURL); 574 BMenuItem* openFolder = new BMenuItem( "Open containing folder",580 BMenuItem* openFolder = new BMenuItem(B_TRANSLATE("Open containing folder"), 575 581 new BMessage(OPEN_CONTAINING_FOLDER)); 576 582 contextMenu->AddItem(openFolder); 577 583 … … 617 623 fExpectedSize = fCurrentSize; 618 624 } 619 625 fTopButton->SetEnabled(true); 620 fBottomButton->SetLabel( "Remove");626 fBottomButton->SetLabel(B_TRANSLATE("Remove")); 621 627 fBottomButton->SetMessage(new BMessage(REMOVE_DOWNLOAD)); 622 628 fBottomButton->SetEnabled(true); 623 629 fInfoView->SetText(""); … … 628 634 DownloadProgressView::DownloadCanceled() 629 635 { 630 636 fDownload = NULL; 631 fTopButton->SetLabel( "Restart");637 fTopButton->SetLabel(B_TRANSLATE("Restart")); 632 638 fTopButton->SetMessage(new BMessage(RESTART_DOWNLOAD)); 633 639 fTopButton->SetEnabled(true); 634 fBottomButton->SetLabel( "Remove");640 fBottomButton->SetLabel(B_TRANSLATE("Remove")); 635 641 fBottomButton->SetMessage(new BMessage(REMOVE_DOWNLOAD)); 636 642 fBottomButton->SetEnabled(true); 637 643 fInfoView->SetText(""); … … 705 711 if (sShowSpeed && fBytesPerSecond != 0.0) { 706 712 // Draw speed info 707 713 char sizeBuffer[128]; 708 buffer = "(";714 buffer = B_TRANSLATE("(%1 of %2, %3/s)"); 709 715 // Get strings for current and expected size and remove the unit 710 716 // from the current size string if it's the same as the expected 711 717 // size unit. … … 720 726 expectedSize.String() + expectedSizeUnitPos) == 0) { 721 727 currentSize.Truncate(currentSizeUnitPos); 722 728 } 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()); 730 734 float stringWidth = fInfoView->StringWidth(buffer.String()); 731 735 if (stringWidth < fInfoView->Bounds().Width()) 732 736 fInfoView->SetText(buffer.String()); 733 737 else { 734 738 // 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()); 738 742 stringWidth = fInfoView->StringWidth(buffer.String()); 739 743 if (stringWidth < fInfoView->Bounds().Width()) 740 744 fInfoView->SetText(buffer.String()); … … 757 761 // TODO: Localization of time string... 758 762 if (now < finishTime - secondsPerDay) { 759 763 // 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"), 761 768 2, time->tm_hour, 2, time->tm_min, 762 769 2, time->tm_mon + 1, 2, time->tm_mday, year); 763 770 } 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"), 765 773 2, time->tm_hour, 2, time->tm_min); 766 774 } 767 775 768 BString buffer1( "Finish: ");769 buffer1 << timeText;776 BString buffer1(B_TRANSLATE("Finish:")); 777 buffer1 << " " << timeText; 770 778 finishTime -= now; 771 779 time = gmtime(&finishTime); 772 780 … … 774 782 if (finishTime > secondsPerDay) { 775 783 int64 days = finishTime / secondsPerDay; 776 784 if (days == 1) 777 buffer2 << "Over 1 day";785 buffer2 << B_TRANSLATE("Over 1 day left"); 778 786 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 } 780 793 } else if (finishTime > 60 * 60) { 781 794 int64 hours = finishTime / (60 * 60); 782 795 if (hours == 1) 783 buffer2 << "Over 1 hour";796 buffer2 << B_TRANSLATE("Over 1 hour left"); 784 797 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 } 786 804 } else if (finishTime > 60) { 787 805 int64 minutes = finishTime / 60; 788 806 if (minutes == 1) 789 buffer2 << "Over 1 minute";807 buffer2 << B_TRANSLATE("Over 1 minute left"); 790 808 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 } 792 815 } else { 793 816 if (finishTime == 1) 794 buffer2 << "1 second";817 buffer2 << B_TRANSLATE("1 second left"); 795 818 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 } 797 825 } 798 826 799 buffer2 << " left";800 801 827 buffer = "("; 802 828 buffer << buffer1 << " - " << buffer2 << ")"; 803 829 -
WebKit/haiku/WebPositive/SettingsWindow.cpp
27 27 #include "SettingsWindow.h" 28 28 29 29 #include <Button.h> 30 #include <Catalog.h> 30 31 #include <CheckBox.h> 31 32 #include <ControlLook.h> 32 33 #include <GridLayoutBuilder.h> 33 34 #include <GroupLayout.h> 34 35 #include <GroupLayoutBuilder.h> 35 #include <Locale.h>36 36 #include <MenuItem.h> 37 37 #include <MenuField.h> 38 38 #include <Message.h> -
WebKit/haiku/WebPositive/support/DateTime.h
32 32 33 33 class BTime { 34 34 public: 35 36 37 38 39 40 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(); 41 41 42 42 status_t Archive(BMessage* into) const; 43 43 44 44 bool IsValid() const; 45 45 bool IsValid(const BTime& time) const; 46 46 bool IsValid(int32 hour, int32 minute, int32 second, 47 47 int32 microsecond = 0) const; 48 48 49 static BTime CurrentTime(time_type type);49 static BTime CurrentTime(time_type type); 50 50 51 51 BTime Time() const; 52 52 bool SetTime(const BTime& time); … … 65 65 int32 Millisecond() const; 66 66 int32 Microsecond() const; 67 67 bigtime_t Difference(const BTime& time, 68 68 diff_type type) const; 69 69 70 70 bool operator!=(const BTime& time) const; 71 71 bool operator==(const BTime& time) const; … … 80 80 bigtime_t _Microseconds() const; 81 81 BTime& _AddMicroseconds(bigtime_t microseconds); 82 82 bool _SetTime(bigtime_t hour, bigtime_t minute, 83 83 bigtime_t second, bigtime_t microsecond); 84 84 85 85 private: 86 86 bigtime_t fMicroseconds; … … 89 89 90 90 class BDate { 91 91 public: 92 93 94 95 96 92 BDate(); 93 BDate(const BDate& other); 94 BDate(int32 year, int32 month, int32 day); 95 BDate(const BMessage* archive); 96 ~BDate(); 97 97 98 98 status_t Archive(BMessage* into) const; 99 99 100 100 bool IsValid() const; 101 101 bool IsValid(const BDate& date) const; 102 102 bool IsValid(int32 year, int32 month, 103 103 int32 day) const; 104 104 105 static BDate CurrentDate(time_type type);105 static BDate CurrentDate(time_type type); 106 106 107 107 BDate Date() const; 108 108 bool SetDate(const BDate& date); … … 129 129 int32 DaysInMonth() const; 130 130 131 131 BString ShortDayName() const; 132 static BString ShortDayName(int32 day);132 static BString ShortDayName(int32 day); 133 133 134 134 BString ShortMonthName() const; 135 static BString ShortMonthName(int32 month);135 static BString ShortMonthName(int32 month); 136 136 137 137 BString LongDayName() const; 138 static BString LongDayName(int32 day);138 static BString LongDayName(int32 day); 139 139 140 140 BString LongMonthName() const; 141 static BString LongMonthName(int32 month);141 static BString LongMonthName(int32 month); 142 142 143 143 int32 DateToJulianDay() const; 144 static BDate JulianDayToDate(int32 julianDay);144 static BDate JulianDayToDate(int32 julianDay); 145 145 146 146 bool operator!=(const BDate& date) const; 147 147 bool operator==(const BDate& date) const; … … 156 156 int32 _DaysInMonth(int32 year, int32 month) const; 157 157 bool _SetDate(int32 year, int32 month, int32 day); 158 158 int32 _DateToJulianDay(int32 year, int32 month, 159 159 int32 day) const; 160 160 161 161 private: 162 162 int32 fDay; … … 167 167 168 168 class BDateTime { 169 169 public: 170 171 172 173 170 BDateTime(); 171 BDateTime(const BDate &date, const BTime &time); 172 BDateTime(const BMessage* archive); 173 ~BDateTime(); 174 174 175 175 status_t Archive(BMessage* into) const; 176 176 177 177 bool IsValid() const; 178 178 179 static BDateTime CurrentDateTime(time_type type);179 static BDateTime CurrentDateTime(time_type type); 180 180 void SetDateTime(const BDate &date, const BTime &time); 181 181 182 182 BDate& Date(); 183 const BDate&Date() const;183 const BDate& Date() const; 184 184 void SetDate(const BDate &date); 185 185 186 186 BTime& Time(); 187 const BTime&Time() const;187 const BTime& Time() const; 188 188 void SetTime(const BTime &time); 189 189 190 190 int32 Time_t() const; -
WebKit/haiku/WebPositive/support/FontSelectionView.cpp
14 14 15 15 #include <Box.h> 16 16 #include <Catalog.h> 17 #include <Locale.h>18 17 #include <Looper.h> 19 18 #include <MenuField.h> 20 19 #include <MenuItem.h> -
WebKit/haiku/WebPositive/support/StringForSize.cpp
7 7 8 8 #include <stdio.h> 9 9 10 #include <Catalog.h> 10 11 12 #undef B_TRANSLATE_CONTEXT 13 #define B_TRANSLATE_CONTEXT "String for size" 14 15 11 16 namespace BPrivate { 12 17 13 18 … … 16 21 { 17 22 double kib = size / 1024.0; 18 23 if (kib < 1.0) { 19 snprintf(string, stringSize, "%d bytes", (int)size);24 snprintf(string, stringSize, B_TRANSLATE("%d bytes"), (int)size); 20 25 return string; 21 26 } 22 27 double mib = kib / 1024.0; 23 28 if (mib < 1.0) { 24 snprintf(string, stringSize, "%3.2f KiB", kib);29 snprintf(string, stringSize, B_TRANSLATE("%3.2f KiB"), kib); 25 30 return string; 26 31 } 27 32 double gib = mib / 1024.0; 28 33 if (gib < 1.0) { 29 snprintf(string, stringSize, "%3.2f MiB", mib);34 snprintf(string, stringSize, B_TRANSLATE("%3.2f MiB"), mib); 30 35 return string; 31 36 } 32 37 double tib = gib / 1024.0; 33 38 if (tib < 1.0) { 34 snprintf(string, stringSize, "%3.2f GiB", gib);39 snprintf(string, stringSize, B_TRANSLATE("%3.2f GiB"), gib); 35 40 return string; 36 41 } 37 snprintf(string, stringSize, "%.2f TiB", tib);42 snprintf(string, stringSize, B_TRANSLATE("%.2f TiB"), tib); 38 43 return string; 39 44 } 40 45 -
WebKit/haiku/WebPositive/support/FontSelectionView.h
27 27 28 28 class FontSelectionView : public BHandler { 29 29 public: 30 31 32 33 virtual~FontSelectionView();30 FontSelectionView(const char* name, 31 const char* label, bool separateStyles, 32 const BFont* font = NULL); 33 virtual ~FontSelectionView(); 34 34 35 void 36 virtual voidMessageReceived(BMessage* message);35 void AttachedToLooper(); 36 virtual void MessageReceived(BMessage* message); 37 37 38 void 39 void 38 void SetMessage(BMessage* message); 39 void SetTarget(BHandler* target); 40 40 41 void 42 void 43 void 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; 45 45 46 void 47 void 48 bool 49 bool 46 void SetDefaults(); 47 void Revert(); 48 bool IsDefaultable(); 49 bool IsRevertable(); 50 50 51 void 51 void UpdateFontsMenu(); 52 52 53 53 BLayoutItem* CreateSizesLabelLayoutItem(); 54 54 BLayoutItem* CreateSizesMenuBarLayoutItem(); … … 59 59 BLayoutItem* CreateStylesLabelLayoutItem(); 60 60 BLayoutItem* CreateStylesMenuBarLayoutItem(); 61 61 62 BView* 62 BView* PreviewBox() const; 63 63 64 64 private: 65 void 65 void _Invoke(); 66 66 67 BFont 68 void 69 void 70 void 71 void 72 void 73 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; 74 74 75 75 protected: 76 BMenuField* 77 BMenuField* 78 BMenuField* 79 BPopUpMenu* 80 BPopUpMenu* 81 BPopUpMenu* 76 BMenuField* fFontsMenuField; 77 BMenuField* fStylesMenuField; 78 BMenuField* fSizesMenuField; 79 BPopUpMenu* fFontsMenu; 80 BPopUpMenu* fStylesMenu; 81 BPopUpMenu* fSizesMenu; 82 82 BStringView* fPreviewText; 83 83 84 BFont 85 BFont 84 BFont fSavedFont; 85 BFont fCurrentFont; 86 86 87 BMessage* 88 BHandler* 87 BMessage* fMessage; 88 BHandler* fTarget; 89 89 }; 90 90 91 91 #endif // FONT_SELECTION_VIEW_H -
WebKit/haiku/HaikuLauncher/LauncherApp.cpp
35 35 #include "WebViewConstants.h" 36 36 #include <Alert.h> 37 37 #include <Autolock.h> 38 #include <Catalog.h> 38 39 #include <Entry.h> 39 40 #include <File.h> 40 41 #include <FindDirectory.h> … … 42 43 #include <Screen.h> 43 44 #include <stdio.h> 44 45 46 #undef B_TRANSLATE_CONTEXT 47 #define B_TRANSLATE_CONTEXT "LauncherApp" 48 45 49 const char* kApplicationSignature = "application/x-vnd.RJL-HaikuLauncher"; 46 50 enum { 47 51 LOAD_AT_STARTING = 'lost' … … 65 69 void LauncherApp::AboutRequested() 66 70 { 67 71 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")); 69 74 alert->Go(); 70 75 } 71 76 -
WebKit/haiku/HaikuLauncher/LauncherWindow.cpp
37 37 #include "WebPage.h" 38 38 #include "WebView.h" 39 39 #include "WebViewConstants.h" 40 #include <Catalog.h> 40 41 #include <Button.h> 41 42 #include <Entry.h> 42 43 #include <GridLayoutBuilder.h> … … 53 54 54 55 #include <stdio.h> 55 56 57 #undef B_TRANSLATE_CONTEXT 58 #define B_TRANSLATE_CONTEXT "Launcher Window" 59 56 60 enum { 57 61 OPEN_LOCATION = 'open', 58 62 GO_BACK = 'goba', … … 67 71 }; 68 72 69 73 LauncherWindow::LauncherWindow(BRect frame, ToolbarPolicy toolbarPolicy) 70 : BWebWindow(frame, "HaikuLauncher",74 : BWebWindow(frame, B_TRANSLATE("HaikuLauncher"), 71 75 B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 72 76 B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS) 73 77 { … … 76 80 77 81 LauncherWindow::LauncherWindow(BRect frame, BWebView* webView, 78 82 ToolbarPolicy toolbarPolicy) 79 : BWebWindow(frame, "HaikuLauncher",83 : BWebWindow(frame, B_TRANSLATE("HaikuLauncher"), 80 84 B_DOCUMENT_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL, 81 85 B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS) 82 86 { … … 218 222 219 223 void LauncherWindow::LoadNegotiating(const BString& url, BWebView* view) 220 224 { 221 BString status( "Requesting: ");222 status << url;225 BString status(B_TRANSLATE("Requesting:")); 226 status << " " << url; 223 227 StatusChanged(status, view); 224 228 } 225 229 … … 229 233 if (m_url) 230 234 m_url->SetText(url.String()); 231 235 232 BString status( "Loading: ");233 status << url;236 BString status(B_TRANSLATE("Loading:")); 237 status << " " << url; 234 238 StatusChanged(status, view); 235 239 } 236 240 … … 246 250 void LauncherWindow::LoadFailed(const BString& url, BWebView* view) 247 251 { 248 252 BString status(url); 249 status << " failed.";253 status << B_TRANSLATE(" failed."); 250 254 StatusChanged(status, view); 251 255 if (m_loadingProgressBar && !m_loadingProgressBar->IsHidden()) 252 256 m_loadingProgressBar->Hide(); … … 255 259 void LauncherWindow::LoadFinished(const BString& url, BWebView* view) 256 260 { 257 261 BString status(url); 258 status << " finished.";262 status << B_TRANSLATE(" finished."); 259 263 StatusChanged(status, view); 260 264 if (m_loadingProgressBar && !m_loadingProgressBar->IsHidden()) 261 265 m_loadingProgressBar->Hide(); … … 308 312 if (toolbarPolicy == HaveToolbar) { 309 313 // Menu 310 314 m_menuBar = new BMenuBar("Main menu"); 311 BMenu* menu = new BMenu( "Window");315 BMenu* menu = new BMenu(B_TRANSLATE("Window")); 312 316 BMessage* newWindowMessage = new BMessage(NEW_WINDOW); 313 317 newWindowMessage->AddString("url", ""); 314 BMenuItem* newItem = new BMenuItem( "New", newWindowMessage, 'N');318 BMenuItem* newItem = new BMenuItem(B_TRANSLATE("New"), newWindowMessage, 'N'); 315 319 menu->AddItem(newItem); 316 320 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')); 318 322 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'); 321 325 menu->AddItem(quitItem); 322 326 quitItem->SetTarget(be_app); 323 327 m_menuBar->AddItem(menu); 324 328 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')); 329 333 m_menuBar->AddItem(menu); 330 334 331 335 // 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)); 335 339 336 340 // URL 337 341 m_url = new BTextControl("url", "", "", NULL); 338 342 339 343 // Go 340 m_goButton = new BButton("", "Go", new BMessage(GOTO_URL));344 m_goButton = new BButton("", B_TRANSLATE("Go"), new BMessage(GOTO_URL)); 341 345 342 346 // Status Bar 343 347 m_statusText = new BStringView("status", ""); … … 406 410 BString windowTitle = title; 407 411 if (windowTitle.Length() > 0) 408 412 windowTitle << " - "; 409 windowTitle << "HaikuLauncher";413 windowTitle << B_TRANSLATE("HaikuLauncher"); 410 414 SetTitle(windowTitle.String()); 411 415 } -
WebKit/haiku/WebCoreSupport/FrameLoaderClientHaiku.cpp
68 68 69 69 #include <Alert.h> 70 70 #include <Bitmap.h> 71 #include <Catalog.h> 71 72 #include <Entry.h> 72 73 #include <Message.h> 73 74 #include <MimeType.h> … … 83 84 # define TRACE(x...) 84 85 #endif 85 86 87 #undef B_TRANSLATE_CONTEXT 88 #define B_TRANSLATE_CONTEXT "Frame Loader Client Haiku" 89 90 86 91 namespace WebCore { 87 92 88 93 FrameLoaderClientHaiku::FrameLoaderClientHaiku(BWebPage* webPage, BWebFrame* webFrame) … … 198 203 void FrameLoaderClientHaiku::dispatchDidReceiveAuthenticationChallenge(DocumentLoader*, unsigned long, const AuthenticationChallenge& challenge) 199 204 { 200 205 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(); 203 213 switch (space.authenticationScheme()) { 204 214 case ProtectionSpaceAuthenticationSchemeHTTPBasic: 205 text += "Basic (data will be sent as plain text)";215 text += B_TRANSLATE("Basic (data will be sent as plain text)"); 206 216 break; 207 217 case ProtectionSpaceAuthenticationSchemeHTTPDigest: 208 text += "Digest (data will not be sent plain text)";218 text += B_TRANSLATE("Digest (data will not be sent plain text)"); 209 219 break; 210 220 default: 211 text += "Unknown (possibly plaintext)";221 text += B_TRANSLATE("Unknown (possibly plaintext)"); 212 222 break; 213 223 } 214 224 … … 767 777 CALLED(); 768 778 notImplemented(); 769 779 ResourceError error = ResourceError(String(), WebKitErrorCannotShowURL, 770 request.url().string(), "Load request cancelled");780 request.url().string(), B_TRANSLATE("Load request cancelled")); 771 781 error.setIsCancellation(true); 772 782 return error; 773 783 } … … 777 787 CALLED(); 778 788 notImplemented(); 779 789 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")); 781 791 } 782 792 783 793 WebCore::ResourceError FrameLoaderClientHaiku::cannotShowURLError(const WebCore::ResourceRequest& request) … … 785 795 CALLED(); 786 796 notImplemented(); 787 797 return ResourceError(String(), WebKitErrorCannotShowURL, 788 request.url().string(), "URL cannot be shown");798 request.url().string(), B_TRANSLATE("URL cannot be shown")); 789 799 } 790 800 791 801 WebCore::ResourceError FrameLoaderClientHaiku::interruptForPolicyChangeError(const WebCore::ResourceRequest& request) … … 793 803 CALLED(); 794 804 notImplemented(); 795 805 ResourceError error = ResourceError(String(), WebKitErrorFrameLoadInterruptedByPolicyChange, 796 request.url().string(), "Frame load was interrupted");806 request.url().string(), B_TRANSLATE("Frame load was interrupted")); 797 807 error.setIsCancellation(true); 798 808 return error; 799 809 } … … 807 817 // it could remember doing so and then we could ask here if we are the main frame, 808 818 // have no content, but did download something -- then we could asked to be closed. 809 819 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")); 811 821 } 812 822 813 823 WebCore::ResourceError FrameLoaderClientHaiku::fileDoesNotExistError(const WebCore::ResourceResponse& response) … … 815 825 CALLED(); 816 826 notImplemented(); 817 827 return ResourceError(String(), WebKitErrorCannotShowURL, 818 response.url().string(), "File does not exist");828 response.url().string(), B_TRANSLATE("File does not exist")); 819 829 } 820 830 821 831 ResourceError FrameLoaderClientHaiku::pluginWillHandleLoadError(const ResourceResponse& response) … … 823 833 CALLED(); 824 834 notImplemented(); 825 835 return ResourceError(String(), WebKitErrorPlugInWillHandleLoad, 826 response.url().string(), "Plugin will handle load");836 response.url().string(), B_TRANSLATE("Plugin will handle load")); 827 837 } 828 838 829 839 bool FrameLoaderClientHaiku::shouldFallBack(const WebCore::ResourceError& error) -
WebKit/haiku/WebCoreSupport/ContextMenuClientHaiku.cpp
38 38 #include "ResourceRequest.h" 39 39 #include "WebPage.h" 40 40 41 #include <Catalog.h> 41 42 43 #undef B_TRANSLATE_CONTEXT 44 #define B_TRANSLATE_CONTEXT "Context menu client Haiku" 45 42 46 namespace WebCore { 43 47 44 48 ContextMenuClientHaiku::ContextMenuClientHaiku(BWebPage* webPage) … … 79 83 String encoded = encodeWithURLEscapeSequences(searchString); 80 84 encoded.replace("%20", "+"); 81 85 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")); 83 88 url.append(encoded); 84 89 85 90 ResourceRequest request = ResourceRequest(url); -
WebKit/haiku/API/WebWindow.cpp
39 39 #include <Application.h> 40 40 #include <Bitmap.h> 41 41 #include <Button.h> 42 #include <Catalog.h> 42 43 #include <GridLayoutBuilder.h> 43 44 #include <GroupLayout.h> 44 45 #include <GroupLayoutBuilder.h> … … 47 48 48 49 #include <stdio.h> 49 50 51 #undef B_TRANSLATE_CONTEXT 52 #define B_TRANSLATE_CONTEXT "Web Window" 53 50 54 enum { 51 55 ICON_FOR_URL_RECEIVED = 'icfu' 52 56 }; … … 336 340 if (!resizable) 337 341 flags |= B_NOT_RESIZABLE; 338 342 339 BWebWindow* window = new BWebWindow(windowFrame, "WebKit window",343 BWebWindow* window = new BWebWindow(windowFrame, B_TRANSLATE("WebKit window"), 340 344 look, feel, flags); 341 345 342 346 window->AddChild(view); … … 373 377 void BWebWindow::MainDocumentError(const BString& failingURL, 374 378 const BString& localizedDescription, BWebView* view) 375 379 { 376 BString errorString( "Error loading ");377 errorString << failingURL;380 BString errorString(B_TRANSLATE("Error loading")); 381 errorString << " " << failingURL; 378 382 errorString << ":\n\n"; 379 383 errorString << localizedDescription; 380 384 BAlert* alert = new BAlert("Main document error", errorString.String(), 381 "OK");385 B_TRANSLATE("OK")); 382 386 alert->Go(NULL); 383 387 } 384 388 -
WebKit/Jamfile
64 64 SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku WebCoreSupport ] ; 65 65 66 66 SharedLibrary libwebkit.so : 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 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 86 86 87 88 89 90 91 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) 93 93 ; 94 94 95 DoCatalogs libwebkit.so : 96 x-vnd.Haiku-libwebkit.so 97 : 98 WebWindow.cpp 99 ContextMenuClientHaiku.cpp 100 FrameLoaderClientHaiku.cpp 101 ; 95 102 96 103 #----------------------------------------------------------------------------- 97 104 # HaikuLauncher … … 99 106 SEARCH_SOURCE += [ FDirName $(TOP) WebKit haiku HaikuLauncher ] ; 100 107 101 108 Application HaikuLauncher : 102 103 109 LauncherApp.cpp 110 LauncherWindow.cpp 104 111 105 106 107 108 109 110 be bsd network stdc++ translation 111 112 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 113 120 ; 114 121 122 DoCatalogs HaikuLauncher : 123 x-vnd.RJL-HaikuLauncher 124 : 125 LauncherApp.cpp 126 LauncherWindow.cpp 127 ; 115 128 129 116 130 #----------------------------------------------------------------------------- 117 131 # WebPositive 118 132 #----------------------------------------------------------------------------- … … 128 142 129 143 130 144 Application WebPositive : 131 132 133 134 135 136 145 # autocompletion 146 AutoCompleter.cpp 147 AutoCompleterDefaultImpl.cpp 148 TextViewCompleter.cpp 149 # support 150 BaseURL.cpp 137 151 BitmapButton.cpp 138 152 DateTime.cpp 139 153 FontSelectionView.cpp … … 144 158 TabContainerView.cpp 145 159 TabManager.cpp 146 160 TabView.cpp 147 161 # WebPositive 148 162 AuthenticationPanel.cpp 149 150 163 BrowserApp.cpp 164 BrowserWindow.cpp 151 165 BrowsingHistory.cpp 152 166 CredentialsStorage.cpp 153 167 DownloadProgressView.cpp 154 168 DownloadWindow.cpp 155 169 SettingsKeys.cpp 156 157 158 170 SettingsWindow.cpp 171 svn_revision.cpp 172 URLInputGroup.cpp 159 173 160 161 162 163 164 165 be bsd locale localestub network stdc++ tracker translation 166 167 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 168 182 ; 183 184 DoCatalogs 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 ;