Ticket #5916: diskprobeLocalization.patch
File diskprobeLocalization.patch, 38.8 KB (added by , 14 years ago) |
---|
-
src/apps/diskprobe/ProbeView.cpp
6 6 7 7 #include "ProbeView.h" 8 8 9 #include <fs_attr.h> 9 10 #include <stdio.h> 10 11 #include <stdlib.h> 11 12 #include <string.h> 12 13 14 #include <Alert.h> 13 15 #include <Application.h> 14 #include <Window.h>15 #include <Clipboard.h>16 16 #include <Autolock.h> 17 #include <MessageQueue.h> 18 #include <TextControl.h> 19 #include <StringView.h> 20 #include <Slider.h> 17 #include <Beep.h> 21 18 #include <Bitmap.h> 19 #include <Box.h> 22 20 #include <Button.h> 23 #include <Box.h> 21 #include <Catalog.h> 22 #include <Clipboard.h> 23 #include <Directory.h> 24 #include <Entry.h> 25 #include <ExpressionParser.h> 26 #include <Locale.h> 24 27 #include <MenuBar.h> 25 28 #include <MenuItem.h> 26 #include <ScrollView.h> 27 #include <Alert.h> 28 #include <String.h> 29 #include <Entry.h> 30 #include <Path.h> 29 #include <MessageQueue.h> 31 30 #include <NodeInfo.h> 32 31 #include <Node.h> 33 32 #include <NodeMonitor.h> 34 #include <Directory.h> 33 #include <Path.h> 34 #include <PrintJob.h> 35 #include <ScrollView.h> 36 #include <StringView.h> 37 #include <Slider.h> 38 #include <String.h> 39 #include <TextControl.h> 35 40 #include <Volume.h> 36 #include <fs_attr.h> 37 #include <PrintJob.h> 38 #include <Beep.h> 41 #include <Window.h> 39 42 40 #include <ExpressionParser.h>41 42 43 #include "DataView.h" 43 44 #include "DiskProbe.h" 44 45 #include "TypeEditors.h" … … 50 51 // (even in Dano/Zeta) 51 52 #endif 52 53 54 #undef TR_CONTEXT 55 #define TR_CONTEXT "ProbeView" 56 53 57 static const uint32 kMsgSliderUpdate = 'slup'; 54 58 static const uint32 kMsgPositionUpdate = 'poup'; 55 59 static const uint32 kMsgLastPosition = 'lpos'; … … 495 499 496 500 BStringView *stringView = new BStringView(BRect(50, 6, rect.right, 20), 497 501 B_EMPTY_STRING, editor.IsAttribute() 498 ? "Attribute: " : editor.IsDevice() ? "Device: " : "File: "); 502 ? TR("Attribute: ") 503 : editor.IsDevice() 504 ? TR("Device: ") 505 : TR("File: ")); 499 506 stringView->SetFont(&boldFont); 500 507 stringView->ResizeToPreferred(); 501 508 AddChild(stringView); … … 519 526 if (editor.IsAttribute()) { 520 527 top += 3; 521 528 stringView = new BStringView(BRect(50, top, frame.right, top + 15), 522 B_EMPTY_STRING, "Attribute type: ");529 B_EMPTY_STRING, TR("Attribute type: ")); 523 530 stringView->SetFont(&boldFont); 524 531 stringView->ResizeToPreferred(); 525 532 AddChild(stringView); … … 546 553 fTypeControl = NULL; 547 554 548 555 stringView = new BStringView(BRect(50, top, frame.right, top + 15), 549 B_EMPTY_STRING, "Block: ");556 B_EMPTY_STRING, TR("Block: ")); 550 557 stringView->SetFont(&boldFont); 551 558 stringView->ResizeToPreferred(); 552 559 AddChild(stringView); … … 567 574 rect.left = rect.right + 4; 568 575 rect.right = rect.left + 75; 569 576 rect.OffsetBy(0, 2); 570 fSizeView = new BStringView(rect, B_EMPTY_STRING, "of 0x0");577 fSizeView = new BStringView(rect, B_EMPTY_STRING, TR("of 0x0")); 571 578 fSizeView->SetFont(&plainFont); 572 579 AddChild(fSizeView); 573 580 UpdateFileSizeView(); 574 581 575 582 rect.left = rect.right + 4; 576 583 rect.right = frame.right; 577 stringView = new BStringView(rect, B_EMPTY_STRING, "Offset: ");584 stringView = new BStringView(rect, B_EMPTY_STRING, TR("Offset: ")); 578 585 stringView->SetFont(&boldFont); 579 586 stringView->ResizeToPreferred(); 580 587 AddChild(stringView); … … 590 597 rect.left = rect.right + 4; 591 598 rect.right = frame.right; 592 599 stringView = new BStringView(rect, B_EMPTY_STRING, editor.IsAttribute() 593 ? "Attribute offset: ": editor.IsDevice()594 ? "Device offset: " : "File offset: ");600 ? TR("Attribute offset: ") : editor.IsDevice() 601 ? TR("Device offset: ") : TR("File offset: ")); 595 602 stringView->SetFont(&boldFont); 596 603 stringView->ResizeToPreferred(); 597 604 AddChild(stringView); … … 729 736 HeaderView::UpdateFileSizeView() 730 737 { 731 738 char buffer[64]; 732 strcpy(buffer, "of ");739 strcpy(buffer, TR("of ")); 733 740 FormatValue(buffer + 3, sizeof(buffer) - 3, 734 741 (fFileSize + fBlockSize - 1) / fBlockSize); 735 742 fSizeView->SetText(buffer); … … 1091 1098 if (system_time() > startTime + 8000000LL) { 1092 1099 // If the user had to wait more than 8 seconds for the result, 1093 1100 // we are trying to please him with a requester... 1094 (new BAlert( "DiskProbe request",1095 "Could not find search string.", "OK", NULL, NULL,1101 (new BAlert(TR("DiskProbe request"), 1102 TR("Could not find search string."), TR("OK"), NULL, NULL, 1096 1103 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL); 1097 1104 } else 1098 1105 beep(); … … 1119 1126 1120 1127 fTypeEditorView = GetTypeEditorAt(index, Frame(), editor); 1121 1128 if (fTypeEditorView == NULL) { 1122 AddChild(new BStringView(Bounds(), "Type editor",1123 "Type editor not supported", B_FOLLOW_NONE));1129 AddChild(new BStringView(Bounds(), TR("Type editor"), 1130 TR("Type editor not supported"), B_FOLLOW_NONE)); 1124 1131 } else 1125 1132 AddChild(fTypeEditorView); 1126 1133 … … 1311 1318 void 1312 1319 ProbeView::AddSaveMenuItems(BMenu* menu, int32 index) 1313 1320 { 1314 menu->AddItem(fSaveMenuItem = new BMenuItem( "Save",1321 menu->AddItem(fSaveMenuItem = new BMenuItem(TR("Save"), 1315 1322 new BMessage(B_SAVE_REQUESTED), 'S'), index); 1316 1323 fSaveMenuItem->SetTarget(this); 1317 1324 fSaveMenuItem->SetEnabled(false); … … 1323 1330 ProbeView::AddPrintMenuItems(BMenu* menu, int32 index) 1324 1331 { 1325 1332 BMenuItem *item; 1326 menu->AddItem(item = new BMenuItem( "Page setup" B_UTF8_ELLIPSIS,1333 menu->AddItem(item = new BMenuItem(TR("Page setup" B_UTF8_ELLIPSIS), 1327 1334 new BMessage(kMsgPageSetup)), index++); 1328 1335 item->SetTarget(this); 1329 menu->AddItem(item = new BMenuItem( "Print" B_UTF8_ELLIPSIS,1336 menu->AddItem(item = new BMenuItem(TR("Print" B_UTF8_ELLIPSIS), 1330 1337 new BMessage(kMsgPrint), 'P'), index++); 1331 1338 item->SetTarget(this); 1332 1339 } … … 1340 1347 if (bar == NULL) 1341 1348 return; 1342 1349 1343 BMenuItem* item = bar->FindItem( "View");1350 BMenuItem* item = bar->FindItem(TR("View")); 1344 1351 BMenu* menu = NULL; 1345 1352 if (item != NULL) 1346 1353 menu = item->Submenu(); … … 1352 1359 1353 1360 menu->AddSeparatorItem(); 1354 1361 1355 BMenu* subMenu = new BMenu( "View As");1362 BMenu* subMenu = new BMenu(TR("View As")); 1356 1363 subMenu->SetRadioMode(true); 1357 1364 1358 1365 BMessage* message = new BMessage(kMsgViewAs); 1359 subMenu->AddItem(item = new BMenuItem( "Raw", message));1366 subMenu->AddItem(item = new BMenuItem(TR("Raw"), message)); 1360 1367 item->SetMarked(true); 1361 1368 1362 1369 const char* name; … … 1397 1404 ResizeBy(0, -bar->Bounds().Height()); 1398 1405 1399 1406 BMenu *menu = new BMenu(fEditor.IsAttribute() 1400 ? "Attribute" : fEditor.IsDevice() ? "Device" : "File");1407 ? TR("Attribute") : fEditor.IsDevice() ? TR("Device") : TR("File")); 1401 1408 AddSaveMenuItems(menu, 0); 1402 1409 menu->AddSeparatorItem(); 1403 1410 AddPrintMenuItems(menu, menu->CountItems()); 1404 1411 menu->AddSeparatorItem(); 1405 1412 1406 menu->AddItem(new BMenuItem( "Close", new BMessage(B_CLOSE_REQUESTED),1413 menu->AddItem(new BMenuItem(TR("Close"), new BMessage(B_CLOSE_REQUESTED), 1407 1414 'W')); 1408 1415 bar->AddItem(menu); 1409 1416 } 1410 1417 1411 1418 // "Edit" menu 1412 1419 1413 BMenu *menu = new BMenu( "Edit");1420 BMenu *menu = new BMenu(TR("Edit")); 1414 1421 BMenuItem *item; 1415 menu->AddItem(fUndoMenuItem = new BMenuItem( "Undo", new BMessage(B_UNDO),1422 menu->AddItem(fUndoMenuItem = new BMenuItem(TR("Undo"), new BMessage(B_UNDO), 1416 1423 'Z')); 1417 1424 fUndoMenuItem->SetEnabled(fEditor.CanUndo()); 1418 1425 fUndoMenuItem->SetTarget(fDataView); 1419 menu->AddItem(fRedoMenuItem = new BMenuItem( "Redo", new BMessage(B_REDO),1426 menu->AddItem(fRedoMenuItem = new BMenuItem(TR("Redo"), new BMessage(B_REDO), 1420 1427 'Z', B_SHIFT_KEY)); 1421 1428 fRedoMenuItem->SetEnabled(fEditor.CanRedo()); 1422 1429 fRedoMenuItem->SetTarget(fDataView); 1423 1430 menu->AddSeparatorItem(); 1424 menu->AddItem(item = new BMenuItem( "Copy", new BMessage(B_COPY), 'C'));1431 menu->AddItem(item = new BMenuItem(TR("Copy"), new BMessage(B_COPY), 'C')); 1425 1432 item->SetTarget(NULL, Window()); 1426 menu->AddItem(fPasteMenuItem = new BMenuItem( "Paste", new BMessage(B_PASTE),1433 menu->AddItem(fPasteMenuItem = new BMenuItem(TR("Paste"), new BMessage(B_PASTE), 1427 1434 'V')); 1428 1435 fPasteMenuItem->SetTarget(NULL, Window()); 1429 1436 _CheckClipboard(); 1430 menu->AddItem(item = new BMenuItem( "Select all", new BMessage(B_SELECT_ALL),1437 menu->AddItem(item = new BMenuItem(TR("Select all"), new BMessage(B_SELECT_ALL), 1431 1438 'A')); 1432 1439 item->SetTarget(NULL, Window()); 1433 1440 menu->AddSeparatorItem(); 1434 menu->AddItem(item = new BMenuItem( "Find" B_UTF8_ELLIPSIS,1441 menu->AddItem(item = new BMenuItem(TR("Find" B_UTF8_ELLIPSIS), 1435 1442 new BMessage(kMsgOpenFindWindow), 'F')); 1436 1443 item->SetTarget(this); 1437 menu->AddItem(fFindAgainMenuItem = new BMenuItem( "Find again",1444 menu->AddItem(fFindAgainMenuItem = new BMenuItem(TR("Find again"), 1438 1445 new BMessage(kMsgFind), 'G')); 1439 1446 fFindAgainMenuItem->SetEnabled(false); 1440 1447 fFindAgainMenuItem->SetTarget(this); … … 1442 1449 1443 1450 // "Block" menu 1444 1451 1445 menu = new BMenu( "Block");1452 menu = new BMenu(TR("Block")); 1446 1453 BMessage *message = new BMessage(kMsgPositionUpdate); 1447 1454 message->AddInt32("delta", 1); 1448 menu->AddItem(item = new BMenuItem( "Next", message, B_RIGHT_ARROW));1455 menu->AddItem(item = new BMenuItem(TR("Next"), message, B_RIGHT_ARROW)); 1449 1456 item->SetTarget(fHeaderView); 1450 1457 message = new BMessage(kMsgPositionUpdate); 1451 1458 message->AddInt32("delta", -1); 1452 menu->AddItem(item = new BMenuItem( "Previous", message, B_LEFT_ARROW));1459 menu->AddItem(item = new BMenuItem(TR("Previous"), message, B_LEFT_ARROW)); 1453 1460 item->SetTarget(fHeaderView); 1454 menu->AddItem(item = new BMenuItem( "Back", new BMessage(kMsgLastPosition),1461 menu->AddItem(item = new BMenuItem(TR("Back"), new BMessage(kMsgLastPosition), 1455 1462 'J')); 1456 1463 item->SetTarget(fHeaderView); 1457 1464 1458 BMenu *subMenu = new BMenu( "Selection");1465 BMenu *subMenu = new BMenu(TR("Selection")); 1459 1466 message = new BMessage(kMsgPositionUpdate); 1460 1467 message->AddInt64("block", 0); 1461 1468 subMenu->AddItem(fNativeMenuItem = new BMenuItem("", message, 'K')); … … 1467 1474 _UpdateSelectionMenuItems(0, 0); 1468 1475 menu->AddSeparatorItem(); 1469 1476 1470 fBookmarkMenu = new BMenu( "Bookmarks");1471 fBookmarkMenu->AddItem(item = new BMenuItem( "Add",1477 fBookmarkMenu = new BMenu(TR("Bookmarks")); 1478 fBookmarkMenu->AddItem(item = new BMenuItem(TR("Add"), 1472 1479 new BMessage(kMsgAddBookmark), 'B')); 1473 1480 item->SetTarget(this); 1474 1481 menu->AddItem(new BMenuItem(fBookmarkMenu)); … … 1487 1494 1488 1495 if (!fEditor.IsAttribute() && volume.InitCheck() == B_OK 1489 1496 && (volume.KnowsMime() || volume.KnowsAttr())) { 1490 bar->AddItem(menu = new BMenu( "Attributes"));1497 bar->AddItem(menu = new BMenu(TR("Attributes"))); 1491 1498 _UpdateAttributesMenu(menu); 1492 1499 } 1493 1500 1494 1501 // "View" menu 1495 1502 1496 menu = new BMenu( "View");1503 menu = new BMenu(TR("View")); 1497 1504 1498 1505 // Number Base (hex/decimal) 1499 1506 1500 subMenu = new BMenu( "Base");1507 subMenu = new BMenu(TR("Base")); 1501 1508 message = new BMessage(kMsgBaseType); 1502 1509 message->AddInt32("base_type", kDecimalBase); 1503 subMenu->AddItem(item = new BMenuItem( "Decimal", message, 'D'));1510 subMenu->AddItem(item = new BMenuItem(TR("Decimal"), message, 'D')); 1504 1511 item->SetTarget(this); 1505 1512 if (fHeaderView->Base() == kDecimalBase) 1506 1513 item->SetMarked(true); 1507 1514 1508 1515 message = new BMessage(kMsgBaseType); 1509 1516 message->AddInt32("base_type", kHexBase); 1510 subMenu->AddItem(item = new BMenuItem( "Hex", message, 'H'));1517 subMenu->AddItem(item = new BMenuItem(TR("Hex"), message, 'H')); 1511 1518 item->SetTarget(this); 1512 1519 if (fHeaderView->Base() == kHexBase) 1513 1520 item->SetMarked(true); … … 1517 1524 1518 1525 // Block Size 1519 1526 1520 subMenu = new BMenu( "BlockSize");1527 subMenu = new BMenu(TR("BlockSize")); 1521 1528 subMenu->SetRadioMode(true); 1522 1529 const uint32 blockSizes[] = {512, 1024, 2048}; 1523 1530 for (uint32 i = 0; i < sizeof(blockSizes) / sizeof(blockSizes[0]); i++) { 1524 1531 char buffer[32]; 1525 1532 snprintf(buffer, sizeof(buffer), "%ld%s", blockSizes[i], 1526 1533 fEditor.IsDevice() && fEditor.BlockSize() == blockSizes[i] 1527 ? " (native)": "");1534 ? TR(" (native)") : ""); 1528 1535 subMenu->AddItem(item = new BMenuItem(buffer, 1529 1536 message = new BMessage(kMsgBlockSize))); 1530 1537 message->AddInt32("block_size", blockSizes[i]); … … 1534 1541 if (subMenu->FindMarked() == NULL) { 1535 1542 // if the device has some weird block size, we'll add it here, too 1536 1543 char buffer[32]; 1537 snprintf(buffer, sizeof(buffer), "%ld (native)", fEditor.BlockSize());1544 snprintf(buffer, sizeof(buffer), TR("%ld (native)"), fEditor.BlockSize()); 1538 1545 subMenu->AddItem(item = new BMenuItem(buffer, 1539 1546 message = new BMessage(kMsgBlockSize))); 1540 1547 message->AddInt32("block_size", fEditor.BlockSize()); … … 1546 1553 1547 1554 // Font Size 1548 1555 1549 subMenu = new BMenu( "Font size");1556 subMenu = new BMenu(TR("Font size")); 1550 1557 subMenu->SetRadioMode(true); 1551 1558 const int32 fontSizes[] = {9, 10, 11, 12, 13, 14, 18, 24, 36, 48}; 1552 1559 int32 fontSize = int32(fDataView->FontSize() + 0.5); … … 1562 1569 item->SetMarked(true); 1563 1570 } 1564 1571 subMenu->AddSeparatorItem(); 1565 subMenu->AddItem(item = new BMenuItem( "Fit",1572 subMenu->AddItem(item = new BMenuItem(TR("Fit"), 1566 1573 message = new BMessage(kMsgFontSize))); 1567 1574 message->AddFloat("font_size", 0.0f); 1568 1575 if (fontSize == 0) … … 1625 1632 1626 1633 char buffer[128]; 1627 1634 if (fDataView->Base() == kHexBase) 1628 snprintf(buffer, sizeof(buffer), "Native: 0x%0*Lx", size * 2, position);1635 snprintf(buffer, sizeof(buffer), TR("Native: 0x%0*Lx"), size * 2, position); 1629 1636 else 1630 snprintf(buffer, sizeof(buffer), "Native: %Ld (0x%0*Lx)", position, size * 2, position);1637 snprintf(buffer, sizeof(buffer), TR("Native: %Ld (0x%0*Lx)"), position, size * 2, position); 1631 1638 1632 1639 fNativeMenuItem->SetLabel(buffer); 1633 1640 fNativeMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize()); … … 1635 1642 1636 1643 position = B_SWAP_INT64(position) >> (8 * (8 - size)); 1637 1644 if (fDataView->Base() == kHexBase) 1638 snprintf(buffer, sizeof(buffer), "Swapped: 0x%0*Lx", size * 2, position);1645 snprintf(buffer, sizeof(buffer), TR("Swapped: 0x%0*Lx"), size * 2, position); 1639 1646 else 1640 snprintf(buffer, sizeof(buffer), "Swapped: %Ld (0x%0*Lx)", position, size * 2, position);1647 snprintf(buffer, sizeof(buffer), TR("Swapped: %Ld (0x%0*Lx)"), position, size * 2, position); 1641 1648 1642 1649 fSwappedMenuItem->SetLabel(buffer); 1643 1650 fSwappedMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize()); … … 1661 1668 1662 1669 char buffer[128]; 1663 1670 if (fDataView->Base() == kHexBase) 1664 snprintf(buffer, sizeof(buffer), "Block 0x%Lx", block);1671 snprintf(buffer, sizeof(buffer), TR("Block 0x%Lx"), block); 1665 1672 else 1666 snprintf(buffer, sizeof(buffer), "Block %Ld (0x%Lx)", block, block);1673 snprintf(buffer, sizeof(buffer), TR("Block %Ld (0x%Lx)"), block, block); 1667 1674 1668 1675 item->SetLabel(buffer); 1669 1676 } … … 1701 1708 1702 1709 char buffer[128]; 1703 1710 if (fDataView->Base() == kHexBase) 1704 snprintf(buffer, sizeof(buffer), "Block 0x%Lx", block);1711 snprintf(buffer, sizeof(buffer), TR("Block 0x%Lx"), block); 1705 1712 else 1706 snprintf(buffer, sizeof(buffer), "Block %Ld (0x%Lx)", block, block);1713 snprintf(buffer, sizeof(buffer), TR("Block %Ld (0x%Lx)"), block, block); 1707 1714 1708 1715 BMessage *message; 1709 1716 item = new BMenuItem(buffer, message = new BMessage(kMsgPositionUpdate)); … … 1748 1755 1749 1756 _RemoveTypeEditor(); 1750 1757 1751 fTypeView = new TypeView(Frame(), "type shell", index, fEditor,1758 fTypeView = new TypeView(Frame(), TR("type shell"), index, fEditor, 1752 1759 B_FOLLOW_ALL); 1753 1760 1754 1761 if (Parent() != NULL) … … 1835 1842 1836 1843 char buffer[1024]; 1837 1844 snprintf(buffer, sizeof(buffer), 1838 "Writing to the file failed:\n"1845 TR("Writing to the file failed:\n" 1839 1846 "%s\n\n" 1840 "All changes will be lost when you quit." ,1847 "All changes will be lost when you quit."), 1841 1848 strerror(status)); 1842 1849 1843 (new BAlert( "DiskProbe request",1844 buffer, "OK", NULL, NULL,1850 (new BAlert(TR("DiskProbe request"), 1851 buffer, TR("OK"), NULL, NULL, 1845 1852 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL); 1846 1853 1847 1854 return status; … … 1856 1863 if (!fEditor.IsModified()) 1857 1864 return true; 1858 1865 1859 int32 chosen = (new BAlert( "DiskProbe request",1860 "Save changes before closing?", "Don't save", "Cancel", "Save",1861 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();1866 int32 chosen = (new BAlert(TR("DiskProbe request"), 1867 TR("Save changes before closing?"), TR("Don't save"), TR("Cancel"), 1868 TR("Save"), B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); 1862 1869 1863 1870 if (chosen == 0) 1864 1871 return true; -
src/apps/diskprobe/FileWindow.cpp
10 10 #include "ProbeView.h" 11 11 12 12 #include <Application.h> 13 #include <Catalog.h> 14 #include <Locale.h> 13 15 #include <MenuBar.h> 14 16 #include <MenuItem.h> 15 17 #include <Path.h> … … 17 19 #include <Volume.h> 18 20 #include <be_apps/Tracker/RecentItems.h> 19 21 22 #undef TR_CONTEXT 23 #define TR_CONTEXT "FileWindow" 20 24 21 25 FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings) 22 26 : ProbeWindow(rect, ref) … … 43 47 44 48 // add the menu 45 49 46 BMenuBar *menuBar = new BMenuBar(BRect(0, 0, Bounds().Width(), 8), "menu bar"); 50 BMenuBar *menuBar = new BMenuBar(BRect(0, 0, Bounds().Width(), 8), 51 "menu bar"); 47 52 AddChild(menuBar); 48 53 49 BMenu *menu = new BMenu( "File");50 menu->AddItem(new BMenuItem( "New" B_UTF8_ELLIPSIS,54 BMenu *menu = new BMenu(TR("File")); 55 menu->AddItem(new BMenuItem(TR("New" B_UTF8_ELLIPSIS), 51 56 new BMessage(kMsgOpenOpenWindow), 'N', B_COMMAND_KEY)); 52 57 53 BMenu *devicesMenu = new BMenu( "Open device");58 BMenu *devicesMenu = new BMenu(TR("Open device")); 54 59 OpenWindow::CollectDevices(devicesMenu); 55 60 devicesMenu->SetTargetForItems(be_app); 56 61 menu->AddItem(new BMenuItem(devicesMenu)); 57 62 58 BMenu *recentsMenu = BRecentFilesList::NewFileListMenu("Open file" B_UTF8_ELLIPSIS, 63 BMenu *recentsMenu = BRecentFilesList::NewFileListMenu( 64 TR("Open file" B_UTF8_ELLIPSIS), 59 65 NULL, NULL, be_app, 10, false, NULL, kSignature); 60 66 BMenuItem *item; 61 menu->AddItem(item = new BMenuItem(recentsMenu, new BMessage(kMsgOpenFilePanel))); 67 menu->AddItem(item = new BMenuItem(recentsMenu, 68 new BMessage(kMsgOpenFilePanel))); 62 69 item->SetShortcut('O', B_COMMAND_KEY); 63 70 menu->AddSeparatorItem(); 64 71 65 72 // the ProbeView save menu items will be inserted here 66 item = new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY); 73 item = new BMenuItem(TR("Close"), new BMessage(B_CLOSE_REQUESTED), 74 'W', B_COMMAND_KEY); 67 75 menu->AddItem(item); 68 76 menu->AddSeparatorItem(); 69 77 … … 74 82 new BMessage(B_ABOUT_REQUESTED))); 75 83 menu->AddSeparatorItem(); 76 84 77 menu->AddItem(new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q', B_COMMAND_KEY)); 85 menu->AddItem(new BMenuItem(TR("Quit"), new BMessage(B_QUIT_REQUESTED), 86 'Q', B_COMMAND_KEY)); 78 87 menu->SetTargetForItems(be_app); 79 88 item->SetTarget(this); 80 89 menuBar->AddItem(menu); -
src/apps/diskprobe/FindWindow.cpp
10 10 #include "DataView.h" 11 11 #include "DiskProbe.h" 12 12 13 #include <AutoLocker.h>14 15 13 #include <Application.h> 16 14 #include <Autolock.h> 15 #include <Autolocker.h> 17 16 #include <Beep.h> 18 17 #include <Button.h> 18 #include <Catalog.h> 19 19 #include <CheckBox.h> 20 20 #include <Clipboard.h> 21 #include <Locale.h> 21 22 #include <MenuField.h> 22 23 #include <MenuItem.h> 23 24 #include <Mime.h> … … 29 30 #include <stdio.h> 30 31 #include <string.h> 31 32 33 #undef TR_CONTEXT 34 #define TR_CONTEXT "FindWindow" 32 35 33 36 static const uint32 kMsgFindMode = 'FMde'; 34 37 static const uint32 kMsgStartFind = 'SFnd'; … … 500 503 fMenu = new BPopUpMenu("mode"); 501 504 BMessage* message; 502 505 BMenuItem* item; 503 fMenu->AddItem(item = new BMenuItem( "Text",506 fMenu->AddItem(item = new BMenuItem(TR("Text"), 504 507 message = new BMessage(kMsgFindMode))); 505 508 message->AddInt8("mode", kAsciiMode); 506 509 if (mode == kAsciiMode) 507 510 item->SetMarked(true); 508 fMenu->AddItem(item = new BMenuItem( "Hexadecimal",511 fMenu->AddItem(item = new BMenuItem(TR("Hexadecimal"), 509 512 message = new BMessage(kMsgFindMode))); 510 513 message->AddInt8("mode", kHexMode); 511 514 if (mode == kHexMode) … … 513 516 514 517 BRect rect = Bounds().InsetByCopy(5, 5); 515 518 BMenuField* menuField = new BMenuField(rect, B_EMPTY_STRING, 516 "Mode:", fMenu, B_FOLLOW_LEFT | B_FOLLOW_TOP);519 TR("Mode:"), fMenu, B_FOLLOW_LEFT | B_FOLLOW_TOP); 517 520 menuField->SetDivider(menuField->StringWidth(menuField->Label()) + 8); 518 521 menuField->ResizeToPreferred(); 519 522 view->AddChild(menuField); 520 523 521 524 // add the bottom widgets 522 525 523 BButton* button = new BButton(rect, B_EMPTY_STRING, "Find",526 BButton* button = new BButton(rect, B_EMPTY_STRING, TR("Find"), 524 527 new BMessage(kMsgStartFind), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM); 525 528 button->MakeDefault(true); 526 529 button->ResizeToPreferred(); … … 528 531 rect.bottom - button->Bounds().Height()); 529 532 view->AddChild(button); 530 533 531 fCaseCheckBox = new BCheckBox(rect, B_EMPTY_STRING, "Case sensitive",534 fCaseCheckBox = new BCheckBox(rect, B_EMPTY_STRING, TR("Case sensitive"), 532 535 NULL, B_FOLLOW_LEFT | B_FOLLOW_BOTTOM); 533 536 fCaseCheckBox->ResizeToPreferred(); 534 537 fCaseCheckBox->MoveTo(5, button->Frame().top); -
src/apps/diskprobe/TypeEditors.cpp
17 17 #include <Alert.h> 18 18 #include <Autolock.h> 19 19 #include <Bitmap.h> 20 #include <Catalog.h> 21 #include <Locale.h> 20 22 #include <MenuField.h> 21 23 #include <MenuItem.h> 22 24 #include <Mime.h> … … 30 32 #include <TranslationUtils.h> 31 33 #include <TranslatorFormats.h> 32 34 35 #undef TR_CONTEXT 36 #define TR_CONTEXT "TypeEditors" 33 37 34 38 static const uint32 kMsgValueChanged = 'vlch'; 35 39 static const uint32 kMsgScaleChanged = 'scch'; … … 196 200 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 197 201 198 202 BStringView *stringView = new BStringView(BRect(5, 5, rect.right, 20), 199 B_EMPTY_STRING, "Contents:");203 B_EMPTY_STRING, TR("Contents:")); 200 204 stringView->ResizeToPreferred(); 201 205 AddChild(stringView); 202 206 … … 275 279 276 280 277 281 MimeTypeEditor::MimeTypeEditor(BRect rect, DataEditor& editor) 278 : TypeEditorView(rect, "MIME type editor", B_FOLLOW_LEFT_RIGHT, 0, editor)282 : TypeEditorView(rect, TR("MIME type editor"), B_FOLLOW_LEFT_RIGHT, 0, editor) 279 283 { 280 284 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 281 285 282 286 fTextControl = new BTextControl(rect.InsetByCopy(5, 5), B_EMPTY_STRING, 283 "MIME type:", NULL, new BMessage(kMsgValueChanged), B_FOLLOW_ALL);287 TR("MIME type:"), NULL, new BMessage(kMsgValueChanged), B_FOLLOW_ALL); 284 288 fTextControl->SetDivider(StringWidth(fTextControl->Label()) + 8); 285 289 286 290 float width, height; … … 366 370 367 371 368 372 NumberEditor::NumberEditor(BRect rect, DataEditor &editor) 369 : TypeEditorView(rect, "Number editor", B_FOLLOW_LEFT_RIGHT, 0, editor)373 : TypeEditorView(rect, TR("Number editor"), B_FOLLOW_LEFT_RIGHT, 0, editor) 370 374 { 371 375 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 372 376 … … 593 597 { 594 598 switch (fEditor.Type()) { 595 599 case B_INT8_TYPE: 596 return "8 bit signed value:";600 return TR("8 bit signed value:"); 597 601 case B_UINT8_TYPE: 598 return "8 bit unsigned value:";602 return TR("8 bit unsigned value:"); 599 603 case B_INT16_TYPE: 600 return "16 bit signed value:";604 return TR("16 bit signed value:"); 601 605 case B_UINT16_TYPE: 602 return "16 bit unsigned value:";606 return TR("16 bit unsigned value:"); 603 607 case B_INT32_TYPE: 604 return "32 bit signed value:";608 return TR("32 bit signed value:"); 605 609 case B_UINT32_TYPE: 606 return "32 bit unsigned value:";610 return TR("32 bit unsigned value:"); 607 611 case B_INT64_TYPE: 608 return "64 bit signed value:";612 return TR("64 bit signed value:"); 609 613 case B_UINT64_TYPE: 610 return "64 bit unsigned value:";614 return TR("64 bit unsigned value:"); 611 615 case B_FLOAT_TYPE: 612 return "Floating-point value:";616 return TR("Floating-point value:"); 613 617 case B_DOUBLE_TYPE: 614 return "Double precision floating-point value:";618 return TR("Double precision floating-point value:"); 615 619 case B_SSIZE_T_TYPE: 616 return "32 bit size or status:";620 return TR("32 bit size or status:"); 617 621 case B_SIZE_T_TYPE: 618 return "32 bit unsigned size:";622 return TR("32 bit unsigned size:"); 619 623 case B_OFF_T_TYPE: 620 return "64 bit signed offset:";624 return TR("64 bit signed offset:"); 621 625 case B_POINTER_TYPE: 622 return "32 bit unsigned pointer:";626 return TR("32 bit unsigned pointer:"); 623 627 default: 624 return "Number:";628 return TR("Number:"); 625 629 } 626 630 } 627 631 … … 755 759 message->AddInt8("value", 1); 756 760 757 761 BMenuField *menuField = new BMenuField(rect.InsetByCopy(5, 5), 758 B_EMPTY_STRING, "Boolean value:", menu, B_FOLLOW_LEFT_RIGHT);762 B_EMPTY_STRING, TR("Boolean value:"), menu, B_FOLLOW_LEFT_RIGHT); 759 763 menuField->SetDivider(StringWidth(menuField->Label()) + 8); 760 764 menuField->ResizeToPreferred(); 761 765 ResizeTo(menuField->Bounds().Width() + 10, … … 839 843 840 844 841 845 ImageView::ImageView(BRect rect, DataEditor &editor) 842 : TypeEditorView(rect, "Image view", B_FOLLOW_NONE, B_WILL_DRAW, editor), 846 : TypeEditorView(rect, TR("Image view"), B_FOLLOW_NONE, 847 B_WILL_DRAW, editor), 843 848 fBitmap(NULL), 844 849 fScaleSlider(NULL) 845 850 { 846 if (editor.Type() == B_MINI_ICON_TYPE || editor.Type() == B_LARGE_ICON_TYPE 851 if (editor.Type() == B_MINI_ICON_TYPE 852 || editor.Type() == B_LARGE_ICON_TYPE 847 853 #ifdef HAIKU_TARGET_PLATFORM_HAIKU 848 854 || editor.Type() == B_VECTOR_ICON_TYPE 849 855 #endif 850 856 ) 851 SetName( "Icon view");857 SetName(TR("Icon view")); 852 858 853 859 #ifdef HAIKU_TARGET_PLATFORM_HAIKU 854 860 if (editor.Type() == B_VECTOR_ICON_TYPE) { … … 864 870 } 865 871 #endif 866 872 867 fDescriptionView = new BStringView(Bounds(), "", "Could not read image", B_FOLLOW_NONE); 873 fDescriptionView = new BStringView(Bounds(), "", 874 TR("Could not read image"), B_FOLLOW_NONE); 868 875 fDescriptionView->SetAlignment(B_ALIGN_CENTER); 869 876 870 877 AddChild(fDescriptionView); … … 1020 1027 1021 1028 if (fBitmap != NULL) { 1022 1029 char buffer[256]; 1023 const char *type = "Unknown type";1030 const char *type = TR("Unknown type"); 1024 1031 switch (fEditor.Type()) { 1025 1032 case B_MINI_ICON_TYPE: 1026 1033 case B_LARGE_ICON_TYPE: 1027 1034 #ifdef HAIKU_TARGET_PLATFORM_HAIKU 1028 1035 case B_VECTOR_ICON_TYPE: 1029 1036 #endif 1030 type = "Icon";1037 type = TR("Icon"); 1031 1038 break; 1032 1039 case B_PNG_FORMAT: 1033 type = "PNG format";1040 type = TR("PNG format"); 1034 1041 break; 1035 1042 case B_MESSAGE_TYPE: 1036 type = "Flattened bitmap";1043 type = TR("Flattened bitmap"); 1037 1044 break; 1038 1045 default: 1039 1046 break; … … 1042 1049 switch (fBitmap->ColorSpace()) { 1043 1050 case B_GRAY1: 1044 1051 case B_GRAY8: 1045 colorSpace = "Grayscale";1052 colorSpace = TR("Grayscale"); 1046 1053 break; 1047 1054 case B_CMAP8: 1048 colorSpace = "8 bit palette";1055 colorSpace = TR("8 bit palette"); 1049 1056 break; 1050 1057 case B_RGB32: 1051 1058 case B_RGBA32: 1052 1059 case B_RGB32_BIG: 1053 1060 case B_RGBA32_BIG: 1054 colorSpace = "32 bit";1061 colorSpace = TR("32 bit"); 1055 1062 break; 1056 1063 case B_RGB15: 1057 1064 case B_RGBA15: 1058 1065 case B_RGB15_BIG: 1059 1066 case B_RGBA15_BIG: 1060 colorSpace = "15 bit";1067 colorSpace = TR("15 bit"); 1061 1068 break; 1062 1069 case B_RGB16: 1063 1070 case B_RGB16_BIG: 1064 colorSpace = "16 bit";1071 colorSpace = TR("16 bit"); 1065 1072 break; 1066 1073 default: 1067 colorSpace = "Unknown format";1074 colorSpace = TR("Unknown format"); 1068 1075 break; 1069 1076 } 1070 1077 snprintf(buffer, sizeof(buffer), "%s, %g x %g, %s", type, 1071 1078 fBitmap->Bounds().Width() + 1, fBitmap->Bounds().Height() + 1, colorSpace); 1072 1079 fDescriptionView->SetText(buffer); 1073 1080 } else 1074 fDescriptionView->SetText( "Could not read image");1081 fDescriptionView->SetText(TR("Could not read image")); 1075 1082 1076 1083 // Update the view size to match the image and its description 1077 1084 … … 1124 1131 1125 1132 1126 1133 MessageView::MessageView(BRect rect, DataEditor &editor) 1127 : TypeEditorView(rect, "Message View", B_FOLLOW_ALL, 0, editor)1134 : TypeEditorView(rect, TR("Message View"), B_FOLLOW_ALL, 0, editor) 1128 1135 { 1129 1136 SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR)); 1130 1137 … … 1177 1184 fTextView->SetText(""); 1178 1185 1179 1186 char text[512]; 1180 snprintf(text, sizeof(text), "what: '%.4s'\n\n", (char*)&message.what);1187 snprintf(text, sizeof(text), TR("what: '%.4s'\n\n"), (char*)&message.what); 1181 1188 fTextView->Insert(text); 1182 1189 1183 1190 type_code type; … … 1346 1353 GetNthTypeEditor(int32 index, const char** _name) 1347 1354 { 1348 1355 static const char* kEditors[] = { 1349 "Text",1350 "Number",1351 "Boolean",1352 "Message",1353 "Image"1356 TR("Text"), 1357 TR("Number"), 1358 TR("Boolean"), 1359 TR("Message"), 1360 TR("Image") 1354 1361 }; 1355 1362 1356 1363 if (index < 0 || index >= int32(sizeof(kEditors) / sizeof(kEditors[0]))) -
src/apps/diskprobe/DiskProbe.rdef
14 14 internal = 3, 15 15 16 16 short_info = "DiskProbe", 17 long_info = "DiskProbe ©2004-20 09Haiku, Inc."17 long_info = "DiskProbe ©2004-2010 Haiku, Inc." 18 18 }; 19 19 20 20 resource app_flags B_SINGLE_LAUNCH; -
src/apps/diskprobe/DiskProbe.cpp
12 12 #include "OpenWindow.h" 13 13 #include "FindWindow.h" 14 14 15 #include <Alert.h> 15 16 #include <Application.h> 16 #include <Screen.h>17 17 #include <Autolock.h> 18 #include <Alert.h> 19 #include <TextView.h> 18 #include <Catalog.h> 19 #include <Directory.h> 20 #include <Entry.h> 20 21 #include <FilePanel.h> 21 22 #include <FindDirectory.h> 22 #include <Directory.h> 23 #include <Entry.h> 23 #include <Locale.h> 24 24 #include <Path.h> 25 #include <Screen.h> 26 #include <TextView.h> 25 27 26 28 #include <stdio.h> 27 29 #include <string.h> 28 30 31 #undef TR_CONTEXT 32 #define TR_CONTEXT "DiskProbe" 29 33 30 34 const char *kSignature = "application/x-vnd.Haiku-DiskProbe"; 31 35 … … 85 89 uint32 fWindowCount; 86 90 BRect fWindowFrame; 87 91 BMessenger fFindTarget; 92 BCatalog fAppCatalog; 88 93 }; 89 94 90 95 … … 115 120 if (file.Read(&settings, sizeof(settings)) == sizeof(settings)) { 116 121 #if B_HOST_IS_BENDIAN 117 122 // settings are saved in little endian 118 settings.window_frame.left = B_LENDIAN_TO_HOST_FLOAT(settings.window_frame.left); 119 settings.window_frame.top = B_LENDIAN_TO_HOST_FLOAT(settings.window_frame.top); 120 settings.window_frame.right = B_LENDIAN_TO_HOST_FLOAT(settings.window_frame.right); 121 settings.window_frame.bottom = B_LENDIAN_TO_HOST_FLOAT(settings.window_frame.bottom); 123 settings.window_frame.left = B_LENDIAN_TO_HOST_FLOAT( 124 settings.window_frame.left); 125 settings.window_frame.top = B_LENDIAN_TO_HOST_FLOAT( 126 settings.window_frame.top); 127 settings.window_frame.right = B_LENDIAN_TO_HOST_FLOAT( 128 settings.window_frame.right); 129 settings.window_frame.bottom = B_LENDIAN_TO_HOST_FLOAT( 130 settings.window_frame.bottom); 122 131 #endif 123 132 // check if the window frame is on screen at all 124 133 BScreen screen; … … 127 136 && settings.window_frame.Height() < screen.Frame().Height()) 128 137 fMessage.ReplaceRect("window_frame", settings.window_frame); 129 138 130 if (settings.base_type == kHexBase || settings.base_type == kDecimalBase) 131 fMessage.ReplaceInt32("base_type", B_LENDIAN_TO_HOST_INT32(settings.base_type)); 139 if (settings.base_type == kHexBase 140 || settings.base_type == kDecimalBase) 141 fMessage.ReplaceInt32("base_type", 142 B_LENDIAN_TO_HOST_INT32(settings.base_type)); 132 143 if (settings.font_size >= 0 && settings.font_size <= 72) 133 fMessage.ReplaceFloat("font_size", float(B_LENDIAN_TO_HOST_INT32(settings.font_size))); 144 fMessage.ReplaceFloat("font_size", 145 float(B_LENDIAN_TO_HOST_INT32(settings.font_size))); 134 146 135 fMessage.ReplaceBool("case_sensitive", settings.flags & kCaseSensitive); 136 fMessage.ReplaceInt8("find_mode", settings.flags & kHexFindMode ? kHexMode : kAsciiMode); 147 fMessage.ReplaceBool("case_sensitive", 148 settings.flags & kCaseSensitive); 149 fMessage.ReplaceInt8("find_mode", 150 settings.flags & kHexFindMode ? kHexMode : kAsciiMode); 137 151 } 138 152 } 139 153 … … 153 167 settings.window_frame = fMessage.FindRect("window_frame"); 154 168 #if B_HOST_IS_BENDIAN 155 169 // settings are saved in little endian 156 settings.window_frame.left = B_HOST_TO_LENDIAN_FLOAT(settings.window_frame.left); 157 settings.window_frame.top = B_HOST_TO_LENDIAN_FLOAT(settings.window_frame.top); 158 settings.window_frame.right = B_HOST_TO_LENDIAN_FLOAT(settings.window_frame.right); 159 settings.window_frame.bottom = B_HOST_TO_LENDIAN_FLOAT(settings.window_frame.bottom); 170 settings.window_frame.left = B_HOST_TO_LENDIAN_FLOAT( 171 settings.window_frame.left); 172 settings.window_frame.top = B_HOST_TO_LENDIAN_FLOAT( 173 settings.window_frame.top); 174 settings.window_frame.right = B_HOST_TO_LENDIAN_FLOAT( 175 settings.window_frame.right); 176 settings.window_frame.bottom = B_HOST_TO_LENDIAN_FLOAT( 177 settings.window_frame.bottom); 160 178 #endif 161 179 162 settings.base_type = B_HOST_TO_LENDIAN_INT32(fMessage.FindInt32("base_type")); 163 settings.font_size = B_HOST_TO_LENDIAN_INT32(int32(fMessage.FindFloat("font_size") + 0.5f)); 164 settings.flags = B_HOST_TO_LENDIAN_INT32((fMessage.FindBool("case_sensitive") ? kCaseSensitive : 0) 180 settings.base_type = B_HOST_TO_LENDIAN_INT32( 181 fMessage.FindInt32("base_type")); 182 settings.font_size = B_HOST_TO_LENDIAN_INT32( 183 int32(fMessage.FindFloat("font_size") + 0.5f)); 184 settings.flags = B_HOST_TO_LENDIAN_INT32( 185 (fMessage.FindBool("case_sensitive") ? kCaseSensitive : 0) 165 186 | (fMessage.FindInt8("find_mode") == kHexMode ? kHexFindMode : 0)); 166 187 167 188 file.Write(&settings, sizeof(settings)); … … 215 236 : BApplication(kSignature), 216 237 fOpenWindow(NULL), 217 238 fFindWindow(NULL), 218 fWindowCount(0) 239 fWindowCount(0), 240 fAppCatalog(NULL) 219 241 { 242 be_locale->GetAppCatalog(&fAppCatalog); 220 243 fFilePanel = new BFilePanel(); 221 244 fWindowFrame = fSettings.Message().FindRect("window_frame"); 222 245 } … … 341 364 if (status != B_OK) { 342 365 char buffer[1024]; 343 366 snprintf(buffer, sizeof(buffer), 344 "Could not open \"%s\":\n"345 "%s" ,367 TR("Could not open \"%s\":\n" 368 "%s"), 346 369 ref.name, strerror(status)); 347 370 348 (new BAlert( "DiskProbe request",349 buffer, "OK", NULL, NULL,371 (new BAlert(TR("DiskProbe request"), 372 buffer, TR("OK"), NULL, NULL, 350 373 B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); 351 374 } 352 375 } … … 377 400 378 401 if ((status = entry.SetTo(path.Path(), false)) != B_OK 379 402 || (status = entry.GetRef(&ref)) != B_OK) { 380 fprintf(stderr, "Could not open file \"%s\": %s\n", path.Path(), strerror(status)); 403 fprintf(stderr, TR("Could not open file \"%s\": %s\n"), 404 path.Path(), strerror(status)); 381 405 continue; 382 406 } 383 407 … … 462 486 void 463 487 DiskProbe::AboutRequested() 464 488 { 465 BAlert *alert = new BAlert("about", "DiskProbe\n"489 BAlert *alert = new BAlert("about", TR("DiskProbe\n" 466 490 "\twritten by Axel Dörfler\n" 467 491 "\tCopyright 2004-2007, Haiku.\n\n" 468 "Original Be version by Robert Polic\n" , "OK");492 "Original Be version by Robert Polic\n"), TR("OK")); 469 493 BTextView *view = alert->TextView(); 470 494 BFont font; 471 495 -
src/apps/diskprobe/OpenWindow.cpp
8 8 9 9 #include <Application.h> 10 10 #include <Button.h> 11 #include <Catalog.h> 11 12 #include <Directory.h> 12 13 #include <Entry.h> 13 14 #include <GroupLayout.h> 14 15 #include <GridLayoutBuilder.h> 16 #include <Locale.h> 15 17 #include <MenuField.h> 16 18 #include <MenuItem.h> 17 19 #include <Path.h> … … 20 22 21 23 #include "DiskProbe.h" 22 24 25 #undef TR_CONTEXT 26 #define TR_CONTEXT "OpenWindow" 23 27 24 28 static const uint32 kMsgProbeFile = 'prDv'; 25 29 static const uint32 kMsgProbeDevice = 'prFl'; 26 30 27 31 28 32 OpenWindow::OpenWindow() 29 : BWindow(BRect(0, 0, 35, 10), "DiskProbe", B_TITLED_WINDOW,33 : BWindow(BRect(0, 0, 35, 10), TR("DiskProbe"), B_TITLED_WINDOW, 30 34 B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS 31 35 | B_AUTO_UPDATE_SIZE_LIMITS) 32 36 { … … 35 39 if (BMenuItem *item = fDevicesMenu->ItemAt(0)) 36 40 item->SetMarked(true); 37 41 38 BMenuField *field = new BMenuField("Examine device:", fDevicesMenu, NULL); 42 BMenuField *field = new BMenuField(TR("Examine device:"), fDevicesMenu, 43 NULL); 39 44 40 BButton *probeDeviceButton = new BButton("device", "Probe device",45 BButton *probeDeviceButton = new BButton("device", TR("Probe device"), 41 46 new BMessage(kMsgProbeDevice)); 42 47 probeDeviceButton->MakeDefault(true); 43 48 44 BButton *probeFileButton = new BButton("file", "Probe file" B_UTF8_ELLIPSIS, 49 BButton *probeFileButton = new BButton("file", 50 TR("Probe file" B_UTF8_ELLIPSIS), 45 51 new BMessage(kMsgProbeFile)); 46 52 47 BButton *cancelButton = new BButton("cancel", "Cancel",53 BButton *cancelButton = new BButton("cancel", TR("Cancel"), 48 54 new BMessage(B_QUIT_REQUESTED)); 49 55 50 56 -
src/apps/diskprobe/AttributeWindow.cpp
11 11 #include <stdio.h> 12 12 #include <stdlib.h> 13 13 14 #include <Alert.h> 15 #include <Catalog.h> 16 #include <Directory.h> 17 #include <Locale.h> 14 18 #include <MenuBar.h> 15 19 #include <MenuItem.h> 20 #include <StringView.h> 16 21 #include <TabView.h> 17 #include <StringView.h>18 #include <Alert.h>19 #include <Directory.h>20 22 #include <Volume.h> 21 23 22 24 … … 25 27 26 28 class EditorTabView : public BTabView { 27 29 public: 28 EditorTabView(BRect frame, const char *name, button_width width = B_WIDTH_AS_USUAL, 29 uint32 resizingMode = B_FOLLOW_ALL, uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS); 30 EditorTabView(BRect frame, const char *name, 31 button_width width = B_WIDTH_AS_USUAL, 32 uint32 resizingMode = B_FOLLOW_ALL, 33 uint32 flags = B_WILL_DRAW | B_FRAME_EVENTS); 30 34 31 35 virtual void FrameResized(float width, float height); 32 36 virtual void Select(int32 tab); … … 53 57 { 54 58 ContainerView()->MoveBy(-ContainerView()->Frame().left, 55 59 TabHeight() + 1 - ContainerView()->Frame().top); 56 fNoEditorView = new BStringView(ContainerView()->Bounds(), "Type editor",57 "No type editor available", B_FOLLOW_NONE);60 fNoEditorView = new BStringView(ContainerView()->Bounds(), 61 TR("Type editor"), TR("No type editor available"), B_FOLLOW_NONE); 58 62 fNoEditorView->ResizeToPreferred(); 59 63 fNoEditorView->SetAlignment(B_ALIGN_CENTER); 60 64 fTypeEditorView = fNoEditorView; … … 128 132 129 133 fRawTab = CountTabs(); 130 134 131 view = new BView(BRect(0, 0, 5, 5), "Raw editor", B_FOLLOW_NONE, 0);135 view = new BView(BRect(0, 0, 5, 5), TR("Raw editor"), B_FOLLOW_NONE, 0); 132 136 view->SetViewColor(ViewColor()); 133 137 AddTab(view); 134 138 } … … 205 209 BMenuBar *menuBar = new BMenuBar(BRect(0, 0, 0, 0), NULL); 206 210 AddChild(menuBar); 207 211 208 BMenu *menu = new BMenu( "Attribute");212 BMenu *menu = new BMenu(TR("Attribute")); 209 213 210 214 // the ProbeView save menu items will be inserted here 211 menu->AddItem(new BMenuItem("Remove from file", new BMessage(kMsgRemoveAttribute))); 215 menu->AddItem(new BMenuItem(TR("Remove from file"), 216 new BMessage(kMsgRemoveAttribute))); 212 217 menu->AddSeparatorItem(); 213 218 214 219 // the ProbeView print menu items will be inserted here 215 220 menu->AddSeparatorItem(); 216 221 217 menu->AddItem(new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED), 'W', B_COMMAND_KEY)); 222 menu->AddItem(new BMenuItem(TR("Close"), new BMessage(B_CLOSE_REQUESTED), 223 'W', B_COMMAND_KEY)); 218 224 menu->SetTargetForItems(this); 219 225 menuBar->AddItem(menu); 220 226 … … 268 274 { 269 275 char buffer[1024]; 270 276 snprintf(buffer, sizeof(buffer), 271 "Do you really want to remove the attribute \"%s\" from the file \"%s\"?\n\n"272 " You cannot undo this action.",277 TR("Do you really want to remove the attribute \"%s\" from " 278 "the file \"%s\"?\n\nYou cannot undo this action."), 273 279 fAttribute, Ref().name); 274 280 275 int32 chosen = (new BAlert( "DiskProbe request",276 buffer, "Cancel", "Remove", NULL,281 int32 chosen = (new BAlert(TR("DiskProbe request"), 282 buffer, TR("Cancel"), TR("Remove"), NULL, 277 283 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); 278 284 if (chosen == 1) { 279 285 BNode node(&Ref());