Ticket #5916: diskprobeLocalization.patch

File diskprobeLocalization.patch, 38.8 KB (added by Karvjorm, 11 years ago)

A localization patch for DiskProbe application

  • src/apps/diskprobe/ProbeView.cpp

     
    66
    77#include "ProbeView.h"
    88
     9#include <fs_attr.h>
    910#include <stdio.h>
    1011#include <stdlib.h>
    1112#include <string.h>
    1213
     14#include <Alert.h>
    1315#include <Application.h>
    14 #include <Window.h>
    15 #include <Clipboard.h>
    1616#include <Autolock.h>
    17 #include <MessageQueue.h>
    18 #include <TextControl.h>
    19 #include <StringView.h>
    20 #include <Slider.h>
     17#include <Beep.h>
    2118#include <Bitmap.h>
     19#include <Box.h>
    2220#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>
    2427#include <MenuBar.h>
    2528#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>
    3130#include <NodeInfo.h>
    3231#include <Node.h>
    3332#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>
    3540#include <Volume.h>
    36 #include <fs_attr.h>
    37 #include <PrintJob.h>
    38 #include <Beep.h>
     41#include <Window.h>
    3942
    40 #include <ExpressionParser.h>
    41 
    4243#include "DataView.h"
    4344#include "DiskProbe.h"
    4445#include "TypeEditors.h"
     
    5051    // (even in Dano/Zeta)
    5152#endif
    5253
     54#undef TR_CONTEXT
     55#define TR_CONTEXT "ProbeView"
     56
    5357static const uint32 kMsgSliderUpdate = 'slup';
    5458static const uint32 kMsgPositionUpdate = 'poup';
    5559static const uint32 kMsgLastPosition = 'lpos';
     
    495499
    496500    BStringView *stringView = new BStringView(BRect(50, 6, rect.right, 20),
    497501        B_EMPTY_STRING, editor.IsAttribute()
    498         ? "Attribute: " : editor.IsDevice() ? "Device: " : "File: ");
     502        ? TR("Attribute: ")
     503        : editor.IsDevice()
     504        ? TR("Device: ")
     505        : TR("File: "));
    499506    stringView->SetFont(&boldFont);
    500507    stringView->ResizeToPreferred();
    501508    AddChild(stringView);
     
    519526    if (editor.IsAttribute()) {
    520527        top += 3;
    521528        stringView = new BStringView(BRect(50, top, frame.right, top + 15),
    522             B_EMPTY_STRING, "Attribute type: ");
     529            B_EMPTY_STRING, TR("Attribute type: "));
    523530        stringView->SetFont(&boldFont);
    524531        stringView->ResizeToPreferred();
    525532        AddChild(stringView);
     
    546553        fTypeControl = NULL;
    547554
    548555    stringView = new BStringView(BRect(50, top, frame.right, top + 15),
    549         B_EMPTY_STRING, "Block: ");
     556        B_EMPTY_STRING, TR("Block: "));
    550557    stringView->SetFont(&boldFont);
    551558    stringView->ResizeToPreferred();
    552559    AddChild(stringView);
     
    567574    rect.left = rect.right + 4;
    568575    rect.right = rect.left + 75;
    569576    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"));
    571578    fSizeView->SetFont(&plainFont);
    572579    AddChild(fSizeView);
    573580    UpdateFileSizeView();
    574581
    575582    rect.left = rect.right + 4;
    576583    rect.right = frame.right;
    577     stringView = new BStringView(rect, B_EMPTY_STRING, "Offset: ");
     584    stringView = new BStringView(rect, B_EMPTY_STRING, TR("Offset: "));
    578585    stringView->SetFont(&boldFont);
    579586    stringView->ResizeToPreferred();
    580587    AddChild(stringView);
     
    590597    rect.left = rect.right + 4;
    591598    rect.right = frame.right;
    592599    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: "));
    595602    stringView->SetFont(&boldFont);
    596603    stringView->ResizeToPreferred();
    597604    AddChild(stringView);
     
    729736HeaderView::UpdateFileSizeView()
    730737{
    731738    char buffer[64];
    732     strcpy(buffer, "of ");
     739    strcpy(buffer, TR("of "));
    733740    FormatValue(buffer + 3, sizeof(buffer) - 3,
    734741        (fFileSize + fBlockSize - 1) / fBlockSize);
    735742    fSizeView->SetText(buffer);
     
    10911098        if (system_time() > startTime + 8000000LL) {
    10921099            // If the user had to wait more than 8 seconds for the result,
    10931100            // 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,
    10961103                B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
    10971104        } else
    10981105            beep();
     
    11191126
    11201127    fTypeEditorView = GetTypeEditorAt(index, Frame(), editor);
    11211128    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));
    11241131    } else
    11251132        AddChild(fTypeEditorView);
    11261133
     
    13111318void
    13121319ProbeView::AddSaveMenuItems(BMenu* menu, int32 index)
    13131320{
    1314     menu->AddItem(fSaveMenuItem = new BMenuItem("Save",
     1321    menu->AddItem(fSaveMenuItem = new BMenuItem(TR("Save"),
    13151322        new BMessage(B_SAVE_REQUESTED), 'S'), index);
    13161323    fSaveMenuItem->SetTarget(this);
    13171324    fSaveMenuItem->SetEnabled(false);
     
    13231330ProbeView::AddPrintMenuItems(BMenu* menu, int32 index)
    13241331{
    13251332    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),
    13271334        new BMessage(kMsgPageSetup)), index++);
    13281335    item->SetTarget(this);
    1329     menu->AddItem(item = new BMenuItem("Print" B_UTF8_ELLIPSIS,
     1336    menu->AddItem(item = new BMenuItem(TR("Print" B_UTF8_ELLIPSIS),
    13301337        new BMessage(kMsgPrint), 'P'), index++);
    13311338    item->SetTarget(this);
    13321339}
     
    13401347    if (bar == NULL)
    13411348        return;
    13421349
    1343     BMenuItem* item = bar->FindItem("View");
     1350    BMenuItem* item = bar->FindItem(TR("View"));
    13441351    BMenu* menu = NULL;
    13451352    if (item != NULL)
    13461353        menu = item->Submenu();
     
    13521359
    13531360    menu->AddSeparatorItem();
    13541361
    1355     BMenu* subMenu = new BMenu("View As");
     1362    BMenu* subMenu = new BMenu(TR("View As"));
    13561363    subMenu->SetRadioMode(true);
    13571364
    13581365    BMessage* message = new BMessage(kMsgViewAs);
    1359     subMenu->AddItem(item = new BMenuItem("Raw", message));
     1366    subMenu->AddItem(item = new BMenuItem(TR("Raw"), message));
    13601367    item->SetMarked(true);
    13611368
    13621369    const char* name;
     
    13971404        ResizeBy(0, -bar->Bounds().Height());
    13981405
    13991406        BMenu *menu = new BMenu(fEditor.IsAttribute()
    1400             ? "Attribute" : fEditor.IsDevice() ? "Device" : "File");
     1407            ? TR("Attribute") : fEditor.IsDevice() ? TR("Device") : TR("File"));
    14011408        AddSaveMenuItems(menu, 0);
    14021409        menu->AddSeparatorItem();
    14031410        AddPrintMenuItems(menu, menu->CountItems());
    14041411        menu->AddSeparatorItem();
    14051412
    1406         menu->AddItem(new BMenuItem("Close", new BMessage(B_CLOSE_REQUESTED),
     1413        menu->AddItem(new BMenuItem(TR("Close"), new BMessage(B_CLOSE_REQUESTED),
    14071414            'W'));
    14081415        bar->AddItem(menu);
    14091416    }
    14101417
    14111418    // "Edit" menu
    14121419
    1413     BMenu *menu = new BMenu("Edit");
     1420    BMenu *menu = new BMenu(TR("Edit"));
    14141421    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),
    14161423        'Z'));
    14171424    fUndoMenuItem->SetEnabled(fEditor.CanUndo());
    14181425    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),
    14201427        'Z', B_SHIFT_KEY));
    14211428    fRedoMenuItem->SetEnabled(fEditor.CanRedo());
    14221429    fRedoMenuItem->SetTarget(fDataView);
    14231430    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'));
    14251432    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),
    14271434        'V'));
    14281435    fPasteMenuItem->SetTarget(NULL, Window());
    14291436    _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),
    14311438        'A'));
    14321439    item->SetTarget(NULL, Window());
    14331440    menu->AddSeparatorItem();
    1434     menu->AddItem(item = new BMenuItem("Find" B_UTF8_ELLIPSIS,
     1441    menu->AddItem(item = new BMenuItem(TR("Find" B_UTF8_ELLIPSIS),
    14351442        new BMessage(kMsgOpenFindWindow), 'F'));
    14361443    item->SetTarget(this);
    1437     menu->AddItem(fFindAgainMenuItem = new BMenuItem("Find again",
     1444    menu->AddItem(fFindAgainMenuItem = new BMenuItem(TR("Find again"),
    14381445        new BMessage(kMsgFind), 'G'));
    14391446    fFindAgainMenuItem->SetEnabled(false);
    14401447    fFindAgainMenuItem->SetTarget(this);
     
    14421449
    14431450    // "Block" menu
    14441451
    1445     menu = new BMenu("Block");
     1452    menu = new BMenu(TR("Block"));
    14461453    BMessage *message = new BMessage(kMsgPositionUpdate);
    14471454    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));
    14491456    item->SetTarget(fHeaderView);
    14501457    message = new BMessage(kMsgPositionUpdate);
    14511458    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));
    14531460    item->SetTarget(fHeaderView);
    1454     menu->AddItem(item = new BMenuItem("Back", new BMessage(kMsgLastPosition),
     1461    menu->AddItem(item = new BMenuItem(TR("Back"), new BMessage(kMsgLastPosition),
    14551462        'J'));
    14561463    item->SetTarget(fHeaderView);
    14571464
    1458     BMenu *subMenu = new BMenu("Selection");
     1465    BMenu *subMenu = new BMenu(TR("Selection"));
    14591466    message = new BMessage(kMsgPositionUpdate);
    14601467    message->AddInt64("block", 0);
    14611468    subMenu->AddItem(fNativeMenuItem = new BMenuItem("", message, 'K'));
     
    14671474    _UpdateSelectionMenuItems(0, 0);
    14681475    menu->AddSeparatorItem();
    14691476
    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"),
    14721479        new BMessage(kMsgAddBookmark), 'B'));
    14731480    item->SetTarget(this);
    14741481    menu->AddItem(new BMenuItem(fBookmarkMenu));
     
    14871494
    14881495    if (!fEditor.IsAttribute() && volume.InitCheck() == B_OK
    14891496        && (volume.KnowsMime() || volume.KnowsAttr())) {
    1490         bar->AddItem(menu = new BMenu("Attributes"));
     1497        bar->AddItem(menu = new BMenu(TR("Attributes")));
    14911498        _UpdateAttributesMenu(menu);
    14921499    }
    14931500
    14941501    // "View" menu
    14951502
    1496     menu = new BMenu("View");
     1503    menu = new BMenu(TR("View"));
    14971504
    14981505    // Number Base (hex/decimal)
    14991506
    1500     subMenu = new BMenu("Base");
     1507    subMenu = new BMenu(TR("Base"));
    15011508    message = new BMessage(kMsgBaseType);
    15021509    message->AddInt32("base_type", kDecimalBase);
    1503     subMenu->AddItem(item = new BMenuItem("Decimal", message, 'D'));
     1510    subMenu->AddItem(item = new BMenuItem(TR("Decimal"), message, 'D'));
    15041511    item->SetTarget(this);
    15051512    if (fHeaderView->Base() == kDecimalBase)
    15061513        item->SetMarked(true);
    15071514
    15081515    message = new BMessage(kMsgBaseType);
    15091516    message->AddInt32("base_type", kHexBase);
    1510     subMenu->AddItem(item = new BMenuItem("Hex", message, 'H'));
     1517    subMenu->AddItem(item = new BMenuItem(TR("Hex"), message, 'H'));
    15111518    item->SetTarget(this);
    15121519    if (fHeaderView->Base() == kHexBase)
    15131520        item->SetMarked(true);
     
    15171524
    15181525    // Block Size
    15191526
    1520     subMenu = new BMenu("BlockSize");
     1527    subMenu = new BMenu(TR("BlockSize"));
    15211528    subMenu->SetRadioMode(true);
    15221529    const uint32 blockSizes[] = {512, 1024, 2048};
    15231530    for (uint32 i = 0; i < sizeof(blockSizes) / sizeof(blockSizes[0]); i++) {
    15241531        char buffer[32];
    15251532        snprintf(buffer, sizeof(buffer), "%ld%s", blockSizes[i],
    15261533            fEditor.IsDevice() && fEditor.BlockSize() == blockSizes[i]
    1527             ? " (native)" : "");
     1534            ? TR(" (native)") : "");
    15281535        subMenu->AddItem(item = new BMenuItem(buffer,
    15291536            message = new BMessage(kMsgBlockSize)));
    15301537        message->AddInt32("block_size", blockSizes[i]);
     
    15341541    if (subMenu->FindMarked() == NULL) {
    15351542        // if the device has some weird block size, we'll add it here, too
    15361543        char buffer[32];
    1537         snprintf(buffer, sizeof(buffer), "%ld (native)", fEditor.BlockSize());
     1544        snprintf(buffer, sizeof(buffer), TR("%ld (native)"), fEditor.BlockSize());
    15381545        subMenu->AddItem(item = new BMenuItem(buffer,
    15391546            message = new BMessage(kMsgBlockSize)));
    15401547        message->AddInt32("block_size", fEditor.BlockSize());
     
    15461553
    15471554    // Font Size
    15481555
    1549     subMenu = new BMenu("Font size");
     1556    subMenu = new BMenu(TR("Font size"));
    15501557    subMenu->SetRadioMode(true);
    15511558    const int32 fontSizes[] = {9, 10, 11, 12, 13, 14, 18, 24, 36, 48};
    15521559    int32 fontSize = int32(fDataView->FontSize() + 0.5);
     
    15621569            item->SetMarked(true);
    15631570    }
    15641571    subMenu->AddSeparatorItem();
    1565     subMenu->AddItem(item = new BMenuItem("Fit",
     1572    subMenu->AddItem(item = new BMenuItem(TR("Fit"),
    15661573        message = new BMessage(kMsgFontSize)));
    15671574    message->AddFloat("font_size", 0.0f);
    15681575    if (fontSize == 0)
     
    16251632
    16261633    char buffer[128];
    16271634    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);
    16291636    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);
    16311638
    16321639    fNativeMenuItem->SetLabel(buffer);
    16331640    fNativeMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize());
     
    16351642
    16361643    position = B_SWAP_INT64(position) >> (8 * (8 - size));
    16371644    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);
    16391646    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);
    16411648
    16421649    fSwappedMenuItem->SetLabel(buffer);
    16431650    fSwappedMenuItem->SetEnabled(position >= 0 && (position * fEditor.BlockSize()) < fEditor.FileSize());
     
    16611668
    16621669        char buffer[128];
    16631670        if (fDataView->Base() == kHexBase)
    1664             snprintf(buffer, sizeof(buffer), "Block 0x%Lx", block);
     1671            snprintf(buffer, sizeof(buffer), TR("Block 0x%Lx"), block);
    16651672        else
    1666             snprintf(buffer, sizeof(buffer), "Block %Ld (0x%Lx)", block, block);
     1673            snprintf(buffer, sizeof(buffer), TR("Block %Ld (0x%Lx)"), block, block);
    16671674
    16681675        item->SetLabel(buffer);
    16691676    }
     
    17011708
    17021709    char buffer[128];
    17031710    if (fDataView->Base() == kHexBase)
    1704         snprintf(buffer, sizeof(buffer), "Block 0x%Lx", block);
     1711        snprintf(buffer, sizeof(buffer), TR("Block 0x%Lx"), block);
    17051712    else
    1706         snprintf(buffer, sizeof(buffer), "Block %Ld (0x%Lx)", block, block);
     1713        snprintf(buffer, sizeof(buffer), TR("Block %Ld (0x%Lx)"), block, block);
    17071714
    17081715    BMessage *message;
    17091716    item = new BMenuItem(buffer, message = new BMessage(kMsgPositionUpdate));
     
    17481755
    17491756        _RemoveTypeEditor();
    17501757
    1751         fTypeView = new TypeView(Frame(), "type shell", index, fEditor,
     1758        fTypeView = new TypeView(Frame(), TR("type shell"), index, fEditor,
    17521759            B_FOLLOW_ALL);
    17531760
    17541761        if (Parent() != NULL)
     
    18351842
    18361843    char buffer[1024];
    18371844    snprintf(buffer, sizeof(buffer),
    1838         "Writing to the file failed:\n"
     1845        TR("Writing to the file failed:\n"
    18391846        "%s\n\n"
    1840         "All changes will be lost when you quit.",
     1847        "All changes will be lost when you quit."),
    18411848        strerror(status));
    18421849
    1843     (new BAlert("DiskProbe request",
    1844         buffer, "OK", NULL, NULL,
     1850    (new BAlert(TR("DiskProbe request"),
     1851        buffer, TR("OK"), NULL, NULL,
    18451852        B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(NULL);
    18461853
    18471854    return status;
     
    18561863    if (!fEditor.IsModified())
    18571864        return true;
    18581865
    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();
    18621869
    18631870    if (chosen == 0)
    18641871        return true;
  • src/apps/diskprobe/FileWindow.cpp

     
    1010#include "ProbeView.h"
    1111
    1212#include <Application.h>
     13#include <Catalog.h>
     14#include <Locale.h>
    1315#include <MenuBar.h>
    1416#include <MenuItem.h>
    1517#include <Path.h>
     
    1719#include <Volume.h>
    1820#include <be_apps/Tracker/RecentItems.h>
    1921
     22#undef TR_CONTEXT
     23#define TR_CONTEXT "FileWindow"
    2024
    2125FileWindow::FileWindow(BRect rect, entry_ref *ref, const BMessage *settings)
    2226    : ProbeWindow(rect, ref)
     
    4347
    4448    // add the menu
    4549
    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");
    4752    AddChild(menuBar);
    4853
    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),
    5156        new BMessage(kMsgOpenOpenWindow), 'N', B_COMMAND_KEY));
    5257
    53     BMenu *devicesMenu = new BMenu("Open device");
     58    BMenu *devicesMenu = new BMenu(TR("Open device"));
    5459    OpenWindow::CollectDevices(devicesMenu);
    5560    devicesMenu->SetTargetForItems(be_app);
    5661    menu->AddItem(new BMenuItem(devicesMenu));
    5762
    58     BMenu *recentsMenu = BRecentFilesList::NewFileListMenu("Open file" B_UTF8_ELLIPSIS,
     63    BMenu *recentsMenu = BRecentFilesList::NewFileListMenu(
     64        TR("Open file" B_UTF8_ELLIPSIS),
    5965        NULL, NULL, be_app, 10, false, NULL, kSignature);
    6066    BMenuItem *item;
    61     menu->AddItem(item = new BMenuItem(recentsMenu, new BMessage(kMsgOpenFilePanel)));
     67    menu->AddItem(item = new BMenuItem(recentsMenu,
     68        new BMessage(kMsgOpenFilePanel)));
    6269    item->SetShortcut('O', B_COMMAND_KEY);
    6370    menu->AddSeparatorItem();
    6471
    6572    // 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);
    6775    menu->AddItem(item);
    6876    menu->AddSeparatorItem();
    6977
     
    7482        new BMessage(B_ABOUT_REQUESTED)));
    7583    menu->AddSeparatorItem();
    7684
    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));
    7887    menu->SetTargetForItems(be_app);
    7988    item->SetTarget(this);
    8089    menuBar->AddItem(menu);
  • src/apps/diskprobe/FindWindow.cpp

     
    1010#include "DataView.h"
    1111#include "DiskProbe.h"
    1212
    13 #include <AutoLocker.h>
    14 
    1513#include <Application.h>
    1614#include <Autolock.h>
     15#include <Autolocker.h>
    1716#include <Beep.h>
    1817#include <Button.h>
     18#include <Catalog.h>
    1919#include <CheckBox.h>
    2020#include <Clipboard.h>
     21#include <Locale.h>
    2122#include <MenuField.h>
    2223#include <MenuItem.h>
    2324#include <Mime.h>
     
    2930#include <stdio.h>
    3031#include <string.h>
    3132
     33#undef TR_CONTEXT
     34#define TR_CONTEXT "FindWindow"
    3235
    3336static const uint32 kMsgFindMode = 'FMde';
    3437static const uint32 kMsgStartFind = 'SFnd';
     
    500503    fMenu = new BPopUpMenu("mode");
    501504    BMessage* message;
    502505    BMenuItem* item;
    503     fMenu->AddItem(item = new BMenuItem("Text",
     506    fMenu->AddItem(item = new BMenuItem(TR("Text"),
    504507        message = new BMessage(kMsgFindMode)));
    505508    message->AddInt8("mode", kAsciiMode);
    506509    if (mode == kAsciiMode)
    507510        item->SetMarked(true);
    508     fMenu->AddItem(item = new BMenuItem("Hexadecimal",
     511    fMenu->AddItem(item = new BMenuItem(TR("Hexadecimal"),
    509512        message = new BMessage(kMsgFindMode)));
    510513    message->AddInt8("mode", kHexMode);
    511514    if (mode == kHexMode)
     
    513516
    514517    BRect rect = Bounds().InsetByCopy(5, 5);
    515518    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);
    517520    menuField->SetDivider(menuField->StringWidth(menuField->Label()) + 8);
    518521    menuField->ResizeToPreferred();
    519522    view->AddChild(menuField);
    520523
    521524    // add the bottom widgets
    522525
    523     BButton* button = new BButton(rect, B_EMPTY_STRING, "Find",
     526    BButton* button = new BButton(rect, B_EMPTY_STRING, TR("Find"),
    524527        new BMessage(kMsgStartFind), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
    525528    button->MakeDefault(true);
    526529    button->ResizeToPreferred();
     
    528531        rect.bottom - button->Bounds().Height());
    529532    view->AddChild(button);
    530533
    531     fCaseCheckBox = new BCheckBox(rect, B_EMPTY_STRING, "Case sensitive",
     534    fCaseCheckBox = new BCheckBox(rect, B_EMPTY_STRING, TR("Case sensitive"),
    532535        NULL, B_FOLLOW_LEFT | B_FOLLOW_BOTTOM);
    533536    fCaseCheckBox->ResizeToPreferred();
    534537    fCaseCheckBox->MoveTo(5, button->Frame().top);
  • src/apps/diskprobe/TypeEditors.cpp

     
    1717#include <Alert.h>
    1818#include <Autolock.h>
    1919#include <Bitmap.h>
     20#include <Catalog.h>
     21#include <Locale.h>
    2022#include <MenuField.h>
    2123#include <MenuItem.h>
    2224#include <Mime.h>
     
    3032#include <TranslationUtils.h>
    3133#include <TranslatorFormats.h>
    3234
     35#undef TR_CONTEXT
     36#define TR_CONTEXT "TypeEditors"
    3337
    3438static const uint32 kMsgValueChanged = 'vlch';
    3539static const uint32 kMsgScaleChanged = 'scch';
     
    196200    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    197201
    198202    BStringView *stringView = new BStringView(BRect(5, 5, rect.right, 20),
    199         B_EMPTY_STRING, "Contents:");
     203        B_EMPTY_STRING, TR("Contents:"));
    200204    stringView->ResizeToPreferred();
    201205    AddChild(stringView);
    202206
     
    275279
    276280
    277281MimeTypeEditor::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)
    279283{
    280284    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    281285
    282286    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);
    284288    fTextControl->SetDivider(StringWidth(fTextControl->Label()) + 8);
    285289
    286290    float width, height;
     
    366370
    367371
    368372NumberEditor::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)
    370374{
    371375    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    372376
     
    593597{
    594598    switch (fEditor.Type()) {
    595599        case B_INT8_TYPE:
    596             return "8 bit signed value:";
     600            return TR("8 bit signed value:");
    597601        case B_UINT8_TYPE:
    598             return "8 bit unsigned value:";
     602            return TR("8 bit unsigned value:");
    599603        case B_INT16_TYPE:
    600             return "16 bit signed value:";
     604            return TR("16 bit signed value:");
    601605        case B_UINT16_TYPE:
    602             return "16 bit unsigned value:";
     606            return TR("16 bit unsigned value:");
    603607        case B_INT32_TYPE:
    604             return "32 bit signed value:";
     608            return TR("32 bit signed value:");
    605609        case B_UINT32_TYPE:
    606             return "32 bit unsigned value:";
     610            return TR("32 bit unsigned value:");
    607611        case B_INT64_TYPE:
    608             return "64 bit signed value:";
     612            return TR("64 bit signed value:");
    609613        case B_UINT64_TYPE:
    610             return "64 bit unsigned value:";
     614            return TR("64 bit unsigned value:");
    611615        case B_FLOAT_TYPE:
    612             return "Floating-point value:";
     616            return TR("Floating-point value:");
    613617        case B_DOUBLE_TYPE:
    614             return "Double precision floating-point value:";
     618            return TR("Double precision floating-point value:");
    615619        case B_SSIZE_T_TYPE:
    616             return "32 bit size or status:";
     620            return TR("32 bit size or status:");
    617621        case B_SIZE_T_TYPE:
    618             return "32 bit unsigned size:";
     622            return TR("32 bit unsigned size:");
    619623        case B_OFF_T_TYPE:
    620             return "64 bit signed offset:";
     624            return TR("64 bit signed offset:");
    621625        case B_POINTER_TYPE:
    622             return "32 bit unsigned pointer:";
     626            return TR("32 bit unsigned pointer:");
    623627        default:
    624             return "Number:";
     628            return TR("Number:");
    625629    }
    626630}
    627631
     
    755759    message->AddInt8("value", 1);
    756760
    757761    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);
    759763    menuField->SetDivider(StringWidth(menuField->Label()) + 8);
    760764    menuField->ResizeToPreferred();
    761765    ResizeTo(menuField->Bounds().Width() + 10,
     
    839843
    840844
    841845ImageView::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),
    843848    fBitmap(NULL),
    844849    fScaleSlider(NULL)
    845850{
    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
    847853#ifdef HAIKU_TARGET_PLATFORM_HAIKU
    848854        || editor.Type() == B_VECTOR_ICON_TYPE
    849855#endif
    850856        )
    851         SetName("Icon view");
     857        SetName(TR("Icon view"));
    852858
    853859#ifdef HAIKU_TARGET_PLATFORM_HAIKU
    854860    if (editor.Type() == B_VECTOR_ICON_TYPE) {
     
    864870    }
    865871#endif
    866872
    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);
    868875    fDescriptionView->SetAlignment(B_ALIGN_CENTER);
    869876
    870877    AddChild(fDescriptionView);
     
    10201027
    10211028    if (fBitmap != NULL) {
    10221029        char buffer[256];
    1023         const char *type = "Unknown type";
     1030        const char *type = TR("Unknown type");
    10241031        switch (fEditor.Type()) {
    10251032            case B_MINI_ICON_TYPE:
    10261033            case B_LARGE_ICON_TYPE:
    10271034#ifdef HAIKU_TARGET_PLATFORM_HAIKU
    10281035            case B_VECTOR_ICON_TYPE:
    10291036#endif
    1030                 type = "Icon";
     1037                type = TR("Icon");
    10311038                break;
    10321039            case B_PNG_FORMAT:
    1033                 type = "PNG format";
     1040                type = TR("PNG format");
    10341041                break;
    10351042            case B_MESSAGE_TYPE:
    1036                 type = "Flattened bitmap";
     1043                type = TR("Flattened bitmap");
    10371044                break;
    10381045            default:
    10391046                break;
     
    10421049        switch (fBitmap->ColorSpace()) {
    10431050            case B_GRAY1:
    10441051            case B_GRAY8:
    1045                 colorSpace = "Grayscale";
     1052                colorSpace = TR("Grayscale");
    10461053                break;
    10471054            case B_CMAP8:
    1048                 colorSpace = "8 bit palette";
     1055                colorSpace = TR("8 bit palette");
    10491056                break;
    10501057            case B_RGB32:
    10511058            case B_RGBA32:
    10521059            case B_RGB32_BIG:
    10531060            case B_RGBA32_BIG:
    1054                 colorSpace = "32 bit";
     1061                colorSpace = TR("32 bit");
    10551062                break;
    10561063            case B_RGB15:
    10571064            case B_RGBA15:
    10581065            case B_RGB15_BIG:
    10591066            case B_RGBA15_BIG:
    1060                 colorSpace = "15 bit";
     1067                colorSpace = TR("15 bit");
    10611068                break;
    10621069            case B_RGB16:
    10631070            case B_RGB16_BIG:
    1064                 colorSpace = "16 bit";
     1071                colorSpace = TR("16 bit");
    10651072                break;
    10661073            default:
    1067                 colorSpace = "Unknown format";
     1074                colorSpace = TR("Unknown format");
    10681075                break;
    10691076        }
    10701077        snprintf(buffer, sizeof(buffer), "%s, %g x %g, %s", type,
    10711078            fBitmap->Bounds().Width() + 1, fBitmap->Bounds().Height() + 1, colorSpace);
    10721079        fDescriptionView->SetText(buffer);
    10731080    } else
    1074         fDescriptionView->SetText("Could not read image");
     1081        fDescriptionView->SetText(TR("Could not read image"));
    10751082
    10761083    // Update the view size to match the image and its description
    10771084
     
    11241131
    11251132
    11261133MessageView::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)
    11281135{
    11291136    SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
    11301137
     
    11771184    fTextView->SetText("");
    11781185
    11791186    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);
    11811188    fTextView->Insert(text);
    11821189
    11831190    type_code type;
     
    13461353GetNthTypeEditor(int32 index, const char** _name)
    13471354{
    13481355    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")
    13541361    };
    13551362
    13561363    if (index < 0 || index >= int32(sizeof(kEditors) / sizeof(kEditors[0])))
  • src/apps/diskprobe/DiskProbe.rdef

     
    1414    internal = 3,
    1515
    1616    short_info = "DiskProbe",
    17     long_info = "DiskProbe ©2004-2009 Haiku, Inc."
     17    long_info = "DiskProbe ©2004-2010 Haiku, Inc."
    1818};
    1919
    2020resource app_flags B_SINGLE_LAUNCH;
  • src/apps/diskprobe/DiskProbe.cpp

     
    1212#include "OpenWindow.h"
    1313#include "FindWindow.h"
    1414
     15#include <Alert.h>
    1516#include <Application.h>
    16 #include <Screen.h>
    1717#include <Autolock.h>
    18 #include <Alert.h>
    19 #include <TextView.h>
     18#include <Catalog.h>
     19#include <Directory.h>
     20#include <Entry.h>
    2021#include <FilePanel.h>
    2122#include <FindDirectory.h>
    22 #include <Directory.h>
    23 #include <Entry.h>
     23#include <Locale.h>
    2424#include <Path.h>
     25#include <Screen.h>
     26#include <TextView.h>
    2527
    2628#include <stdio.h>
    2729#include <string.h>
    2830
     31#undef TR_CONTEXT
     32#define TR_CONTEXT "DiskProbe"
    2933
    3034const char *kSignature = "application/x-vnd.Haiku-DiskProbe";
    3135
     
    8589        uint32      fWindowCount;
    8690        BRect       fWindowFrame;
    8791        BMessenger  fFindTarget;
     92        BCatalog    fAppCatalog;
    8893};
    8994
    9095
     
    115120    if (file.Read(&settings, sizeof(settings)) == sizeof(settings)) {
    116121#if B_HOST_IS_BENDIAN
    117122        // 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);
    122131#endif
    123132        // check if the window frame is on screen at all
    124133        BScreen screen;
     
    127136            && settings.window_frame.Height() < screen.Frame().Height())
    128137            fMessage.ReplaceRect("window_frame", settings.window_frame);
    129138
    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));
    132143        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)));
    134146
    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);
    137151    }
    138152}
    139153
     
    153167    settings.window_frame = fMessage.FindRect("window_frame");
    154168#if B_HOST_IS_BENDIAN
    155169    // 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);
    160178#endif
    161179
    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)
    165186        | (fMessage.FindInt8("find_mode") == kHexMode ? kHexFindMode : 0));
    166187
    167188    file.Write(&settings, sizeof(settings));
     
    215236    : BApplication(kSignature),
    216237    fOpenWindow(NULL),
    217238    fFindWindow(NULL),
    218     fWindowCount(0)
     239    fWindowCount(0),
     240    fAppCatalog(NULL)
    219241{
     242    be_locale->GetAppCatalog(&fAppCatalog);
    220243    fFilePanel = new BFilePanel();
    221244    fWindowFrame = fSettings.Message().FindRect("window_frame");
    222245}
     
    341364        if (status != B_OK) {
    342365            char buffer[1024];
    343366            snprintf(buffer, sizeof(buffer),
    344                 "Could not open \"%s\":\n"
    345                 "%s",
     367                TR("Could not open \"%s\":\n"
     368                "%s"),
    346369                ref.name, strerror(status));
    347370
    348             (new BAlert("DiskProbe request",
    349                 buffer, "OK", NULL, NULL,
     371            (new BAlert(TR("DiskProbe request"),
     372                buffer, TR("OK"), NULL, NULL,
    350373                B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
    351374        }
    352375    }
     
    377400
    378401        if ((status = entry.SetTo(path.Path(), false)) != B_OK
    379402            || (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));
    381405            continue;
    382406        }
    383407
     
    462486void
    463487DiskProbe::AboutRequested()
    464488{
    465     BAlert *alert = new BAlert("about", "DiskProbe\n"
     489    BAlert *alert = new BAlert("about", TR("DiskProbe\n"
    466490        "\twritten by Axel Dörfler\n"
    467491        "\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"));
    469493    BTextView *view = alert->TextView();
    470494    BFont font;
    471495
  • src/apps/diskprobe/OpenWindow.cpp

     
    88
    99#include <Application.h>
    1010#include <Button.h>
     11#include <Catalog.h>
    1112#include <Directory.h>
    1213#include <Entry.h>
    1314#include <GroupLayout.h>
    1415#include <GridLayoutBuilder.h>
     16#include <Locale.h>
    1517#include <MenuField.h>
    1618#include <MenuItem.h>
    1719#include <Path.h>
     
    2022
    2123#include "DiskProbe.h"
    2224
     25#undef TR_CONTEXT
     26#define TR_CONTEXT "OpenWindow"
    2327
    2428static const uint32 kMsgProbeFile = 'prDv';
    2529static const uint32 kMsgProbeDevice = 'prFl';
    2630
    2731
    2832OpenWindow::OpenWindow()
    29     : BWindow(BRect(0, 0, 35, 10), "DiskProbe", B_TITLED_WINDOW,
     33    : BWindow(BRect(0, 0, 35, 10), TR("DiskProbe"), B_TITLED_WINDOW,
    3034        B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_ASYNCHRONOUS_CONTROLS
    3135             | B_AUTO_UPDATE_SIZE_LIMITS)
    3236{
     
    3539    if (BMenuItem *item = fDevicesMenu->ItemAt(0))
    3640        item->SetMarked(true);
    3741
    38     BMenuField *field = new BMenuField("Examine device:", fDevicesMenu, NULL);
     42    BMenuField *field = new BMenuField(TR("Examine device:"), fDevicesMenu,
     43        NULL);
    3944
    40     BButton *probeDeviceButton = new BButton("device", "Probe device",
     45    BButton *probeDeviceButton = new BButton("device", TR("Probe device"),
    4146        new BMessage(kMsgProbeDevice));
    4247    probeDeviceButton->MakeDefault(true);
    4348
    44     BButton *probeFileButton = new BButton("file", "Probe file" B_UTF8_ELLIPSIS,
     49    BButton *probeFileButton = new BButton("file",
     50        TR("Probe file" B_UTF8_ELLIPSIS),
    4551        new BMessage(kMsgProbeFile));
    4652
    47     BButton *cancelButton = new BButton("cancel", "Cancel",
     53    BButton *cancelButton = new BButton("cancel", TR("Cancel"),
    4854        new BMessage(B_QUIT_REQUESTED));
    4955
    5056
  • src/apps/diskprobe/AttributeWindow.cpp

     
    1111#include <stdio.h>
    1212#include <stdlib.h>
    1313
     14#include <Alert.h>
     15#include <Catalog.h>
     16#include <Directory.h>
     17#include <Locale.h>
    1418#include <MenuBar.h>
    1519#include <MenuItem.h>
     20#include <StringView.h>
    1621#include <TabView.h>
    17 #include <StringView.h>
    18 #include <Alert.h>
    19 #include <Directory.h>
    2022#include <Volume.h>
    2123
    2224
     
    2527
    2628class EditorTabView : public BTabView {
    2729    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);
    3034
    3135        virtual void FrameResized(float width, float height);
    3236        virtual void Select(int32 tab);
     
    5357{
    5458    ContainerView()->MoveBy(-ContainerView()->Frame().left,
    5559        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);
    5862    fNoEditorView->ResizeToPreferred();
    5963    fNoEditorView->SetAlignment(B_ALIGN_CENTER);
    6064    fTypeEditorView = fNoEditorView;
     
    128132
    129133    fRawTab = CountTabs();
    130134
    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);
    132136    view->SetViewColor(ViewColor());
    133137    AddTab(view);
    134138}
     
    205209    BMenuBar *menuBar = new BMenuBar(BRect(0, 0, 0, 0), NULL);
    206210    AddChild(menuBar);
    207211
    208     BMenu *menu = new BMenu("Attribute");
     212    BMenu *menu = new BMenu(TR("Attribute"));
    209213
    210214    // 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)));
    212217    menu->AddSeparatorItem();
    213218
    214219    // the ProbeView print menu items will be inserted here
    215220    menu->AddSeparatorItem();
    216221
    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));
    218224    menu->SetTargetForItems(this);
    219225    menuBar->AddItem(menu);
    220226
     
    268274        {
    269275            char buffer[1024];
    270276            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."),
    273279                fAttribute, Ref().name);
    274280
    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,
    277283                B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
    278284            if (chosen == 1) {
    279285                BNode node(&Ref());