Ticket #7169: diskusage-refactoring.patch

File diskusage-refactoring.patch, 20.1 KB (added by Karvjorm, 13 years ago)

A DiskUsage localization refactoring patch

  • src/apps/diskusage/VolumeView.cpp

     
    88 */
    99
    1010
     11#include <Catalog.h>
    1112#include <Box.h>
    1213#include <Button.h>
    1314#include <StringView.h>
     
    2324
    2425#include "VolumeView.h"
    2526
     27#undef B_TRANSLATE_CONTEXT
     28#define B_TRANSLATE_CONTEXT "Volume View"
     29
    2630const float kMinWinSize = 275.0;
    2731
    2832VolumeView::VolumeView(const char* name, BVolume* volume)
     
    5862VolumeView::SetPath(BPath path)
    5963{
    6064    fPieView->SetPath(path);
    61     fStatusView->SetBtnLabel(kStrRescan);
     65    fStatusView->SetBtnLabel(B_TRANSLATE("Rescan"));
    6266}
    6367
    6468
     
    6973    switch(msg->what) {
    7074        case kBtnRescan:
    7175            fPieView->MessageReceived(msg);
    72             fStatusView->SetBtnLabel(kStrRescan);
     76            fStatusView->SetBtnLabel(B_TRANSLATE("Rescan"));
    7377            break;
    7478
    7579        default:
  • src/apps/diskusage/PieView.cpp

     
    1616
    1717#include <AppFileInfo.h>
    1818#include <Bitmap.h>
     19#include <Catalog.h>
    1920#include <Entry.h>
    2021#include <File.h>
    2122#include <MenuItem.h>
     
    3435#include "MainWindow.h"
    3536#include "Scanner.h"
    3637
     38#undef B_TRANSLATE_CONTEXT
     39#define B_TRANSLATE_CONTEXT "Pie View"
    3740
    3841static const int32 kIdxGetInfo = 0;
    3942static const int32 kIdxOpen = 1;
     
    9699AppMenuItem::GetContentSize(float* _width, float* _height)
    97100{
    98101    if (_width)
    99         *_width = fIcon->Bounds().Width() + be_plain_font->StringWidth(Label());
     102        *_width = fIcon->Bounds().Width() +
     103            be_plain_font->StringWidth(Label());
    100104
    101105    if (_height) {
    102106        struct font_height fh;
     
    134138    fOutdated(false)
    135139{
    136140    fMouseOverMenu = new BPopUpMenu(kEmptyStr, false, false);
    137     fMouseOverMenu->AddItem(new BMenuItem(kMenuGetInfo, NULL), kIdxGetInfo);
    138     fMouseOverMenu->AddItem(new BMenuItem(kMenuOpen, NULL), kIdxOpen);
     141    fMouseOverMenu->AddItem(new BMenuItem(B_TRANSLATE("Get Info"), NULL),
     142        kIdxGetInfo);
     143    fMouseOverMenu->AddItem(new BMenuItem(B_TRANSLATE("Open"), NULL),
     144        kIdxOpen);
    139145
    140146    fFileUnavailableMenu = new BPopUpMenu(kEmptyStr, false, false);
    141     BMenuItem* item = new BMenuItem(kStrUnavail, NULL);
     147    BMenuItem* item = new BMenuItem(B_TRANSLATE("file unavailable"), NULL);
    142148    item->SetEnabled(false);
    143149    fFileUnavailableMenu->AddItem(item);
    144150
     
    424430        parent = parent->parent;
    425431        colorIdx++;
    426432    }
    427     _DrawDirectory(pieRect, currentDir, 0.0, 0.0, colorIdx % kBasePieColorCount,
    428         0);
     433    _DrawDirectory(pieRect, currentDir, 0.0, 0.0,
     434        colorIdx % kBasePieColorCount, 0);
    429435   
    430436    if (fOutdated) {
    431437       
    432438        BRect b = Bounds();     
    433439
    434         float strWidth = StringWidth(kOutdatedStr);
     440        float strWidth = StringWidth(B_TRANSLATE("Outdated view"));
    435441        float bx = (b.Width() - strWidth - kSmallHMargin);
    436442
    437443        struct font_height fh;
     
    439445
    440446        float by = (b.Height() - ceil(fh.descent) - kSmallVMargin);
    441447        SetHighColor(0x00, 0x00, 0x00);
    442         DrawString(kOutdatedStr, BPoint(bx, by));
     448        DrawString(B_TRANSLATE("Outdated view"), BPoint(bx, by));
    443449    }
    444450}
    445451
     
    711717
    712718    delete type;
    713719
    714     BMenu* openWith = new BMenu(kMenuOpenWith);
     720    BMenu* openWith = new BMenu(B_TRANSLATE("Open With"));
    715721
    716722    if (appList.size() == 0) {
    717         BMenuItem* item = new BMenuItem(kMenuNoApps, NULL);
     723        BMenuItem* item = new BMenuItem(B_TRANSLATE("no supporting apps"),
     724            NULL);
    718725        item->SetEnabled(false);
    719726        openWith->AddItem(item);
    720727    } else {
     
    749756        // Add a "Rescan" option for folders.
    750757        BMenuItem* rescan = NULL;
    751758        if (info->children.size() > 0) {
    752             rescan = new BMenuItem(kStrRescan, NULL);
     759            rescan = new BMenuItem(B_TRANSLATE("Rescan"), NULL);
    753760            fMouseOverMenu->AddItem(rescan, kIdxRescan);
    754761        }
    755762
  • src/apps/diskusage/MainWindow.cpp

     
    1010#include "MainWindow.h"
    1111
    1212#include <Application.h>
     13#include <Catalog.h>
    1314#include <Node.h>
    1415#include <Roster.h>
    1516#include <Screen.h>
     
    1920#include "Common.h"
    2021#include "ControlsView.h"
    2122
     23#undef B_TRANSLATE_CONTEXT
     24#define B_TRANSLATE_CONTEXT "MainWindow"
    2225
    2326MainWindow::MainWindow(BRect pieRect)
    2427    :
    25     BWindow(pieRect, "DiskUsage", B_TITLED_WINDOW,
     28    BWindow(pieRect, B_TRANSLATE("DiskUsage"), B_TITLED_WINDOW,
    2629        B_ASYNCHRONOUS_CONTROLS | B_QUIT_ON_WINDOW_CLOSE
    2730        | B_AUTO_UPDATE_SIZE_LIMITS)
    2831{
  • src/apps/diskusage/DiskUsage.rdef

     
    33resource app_version {
    44        major  = 1,
    55        middle = 0,
    6         minor  = 0,
     6        minor  = 2,
    77
    88        variety = B_APPV_FINAL,
    99        internal = 0,
    1010
    11         short_info = "1.0.1",
    12         long_info = "1.0.1 ©1999 Mike Steed, ©2008-2009 Haiku"
     11        short_info = "1.0.2",
     12        long_info = "1.0.2 ©1999 Mike Steed, ©2008-2011 Haiku"
    1313};
    1414
    1515resource app_flags B_MULTIPLE_LAUNCH;
     
    4747    $"18001501178600040A01010B1815FF01178400040A08010C000A09010D000A0A"
    4848    $"010E00"
    4949};
    50 
    51 resource(101, "RGB_WIN") rgb_color { 0xDE, 0xDB, 0xDE, 0xFF };
    52 resource(102, "RGB_PIE_OL") rgb_color { 0x80, 0x80, 0x80, 0xFF };
    53 resource(103, "RGB_PIE_BG") rgb_color { 0xFF, 0xFF, 0xFF, 0xFF };
    54 resource(104, "RGB_PIE_MT") rgb_color { 0xA0, 0xA0, 0xA0, 0xFF };
    55 resource(105, "RGB_PIE_1") rgb_color { 0x00, 0x60, 0x60, 0xFF };
    56 resource(106, "RGB_PIE_2") rgb_color { 0x00, 0x00, 0x68, 0xFF };
    57 resource(107, "RGB_PIE_3") rgb_color { 0x60, 0x00, 0x60, 0xFF };
    58 resource(108, "RGB_PIE_4") rgb_color { 0x68, 0x00, 0x00, 0xFF };
    59 
    60 resource(101, "N_PIE_COLORS") (uint8)4;
    61 
    62 resource(103, "STR_N_FILES") "%d files";
    63 resource(102, "STR_1_FILE") "%d file";
    64 resource(101, "STR_VM_LABEL") "Volume:";
    65 resource(120, "STR_SCAN") "Scan";
    66 resource(104, "STR_RESCAN") "Rescan";
    67 resource(105, "STR_SCN_X") "Scanning ";
    68 resource(106, "STR_UNAVAIL") "file unavailable";
    69 resource(107, "STR_VM_DFLT") "(Select)";
    70 resource(108, "STR_VPROMPT") "Select a volume to scan";
    71 resource(109, "STR_M_INFO") "Get Info";
    72 resource(110, "STR_M_OPEN") "Open";
    73 resource(111, "STR_M_OPENW") "Open With";
    74 resource(112, "STR_M_NAPPS") "no supporting apps";
    75 resource(113, "STR_SIZE") "Size";
    76 resource(114, "STR_INFILES") " in %d files";
    77 resource(115, "STR_MADE") "Created";
    78 resource(116, "STR_MOD") "Modified";
    79 resource(117, "STR_TIMEFMT") "%a, %d %b %Y, %r";
    80 resource(118, "STR_KIND") "Kind";
    81 resource(119, "STR_PATH") "Path";
    82 resource(121, "STR_OUTDATED") "Outdated view";
  • src/apps/diskusage/StatusView.cpp

     
    1414#include <math.h>
    1515#include <stdio.h>
    1616
     17#include <Catalog.h>
    1718#include <Box.h>
    1819#include <Button.h>
    1920#include <Node.h>
     
    2526#include "Common.h"
    2627#include "Scanner.h"
    2728
     29#undef B_TRANSLATE_CONTEXT
     30#define B_TRANSLATE_CONTEXT "Status View"
    2831
    2932StatusView::StatusView()
    3033    :
     
    3538    SetLowColor(kPieBGColor);
    3639
    3740    fSizeView = new BStringView(NULL, kEmptyStr);
    38     fSizeView->SetExplicitMinSize(BSize(StringWidth("9999.99 GB"),
     41    fSizeView->SetExplicitMinSize(BSize(StringWidth(B_TRANSLATE("9999.99 GB")),
    3942        B_SIZE_UNSET));
    40     fSizeView->SetExplicitMaxSize(BSize(StringWidth("9999.99 GB"),
     43    fSizeView->SetExplicitMaxSize(BSize(StringWidth(B_TRANSLATE("9999.99 GB")),
    4144        B_SIZE_UNSET));
    4245
    4346    char testLabel[256];
    44     sprintf(testLabel, kManyFiles, 999999);
     47    sprintf(testLabel, B_TRANSLATE("%d files"), 999999);
    4548
    4649    fCountView = new BStringView(NULL, kEmptyStr);
    4750    fCountView->SetExplicitMinSize(BSize(StringWidth(testLabel), B_SIZE_UNSET));
     
    5053    fPathView = new BStringView(NULL, kEmptyStr);
    5154    fPathView->SetExplicitMaxSize(BSize(B_SIZE_UNLIMITED, B_SIZE_UNSET));
    5255
    53     fRefreshBtn = new BButton(NULL, kStrScan, new BMessage(kBtnRescan));
     56    fRefreshBtn = new BButton(NULL, B_TRANSLATE("Scan"), new BMessage(kBtnRescan));
    5457
    5558    fRefreshBtn->SetExplicitMaxSize(BSize(B_SIZE_UNSET, B_SIZE_UNLIMITED));
    5659
     
    119122    if (!info->pseudo) {
    120123        BNode node(&info->ref);
    121124        if (node.InitCheck() != B_OK) {
    122             fPathView->SetText(kStrUnavail);
     125            fPathView->SetText(B_TRANSLATE("file unavailable"));
    123126            fSizeView->SetText(kEmptyStr);
    124127            fCountView->SetText(kEmptyStr);
    125128            return;
     
    139142
    140143    if (info->count > 0) {
    141144        char label[256];
    142         sprintf(label, (info->count == 1) ? kOneFile : kManyFiles, info->count);
     145        sprintf(label, (info->count == 1) ? B_TRANSLATE("%d file") :
     146            B_TRANSLATE("%d files"), info->count);
    143147        fCountView->SetText(label);
    144148    } else {
    145149        fCountView->SetText(kEmptyStr);
  • src/apps/diskusage/InfoWindow.cpp

     
    1616#include <utility>
    1717#include <vector>
    1818
     19#include <Catalog.h>
    1920#include <StringView.h>
    2021#include <Bitmap.h>
    2122#include <NodeInfo.h>
     
    2728using std::vector;
    2829using std::pair;
    2930
     31#undef B_TRANSLATE_CONTEXT
     32#define B_TRANSLATE_CONTEXT "Info Window"
    3033
    3134LeftView::LeftView(BRect frame, BBitmap* icon)
    3235    :
     
    6770
    6871    char name[B_PATH_NAME_LENGTH];
    6972    strcpy(name, f->ref.name);
    70     strcat(name, " info");
     73    strcat(name, B_TRANSLATE(" info"));
    7174    SetTitle(name);
    7275
    7376    InfoList info;
     
    7881    if (f->count > 0) {
    7982        // This is a directory.
    8083        char str[64];
    81         sprintf(str, kInfoInFiles, f->count);
     84        sprintf(str, B_TRANSLATE(" in %d files"), f->count);
    8285        strcat(name, str);
    8386    }
    84     info.push_back(Item(kInfoSize, name));
     87    info.push_back(Item(B_TRANSLATE_MARK("Size"), name));
    8588
    8689    // Created & modified dates
    8790    BEntry entry(&f->ref);
    8891    time_t t;
    8992    entry.GetCreationTime(&t);
    90     strftime(name, 64, kInfoTimeFmt, localtime(&t));
    91     info.push_back(Item(kInfoCreated, name));
     93    strftime(name, 64, B_TRANSLATE("%a, %d %b %Y, %r"), localtime(&t));
     94    info.push_back(Item(B_TRANSLATE("Created"), name));
    9295    entry.GetModificationTime(&t);
    93     strftime(name, 64, kInfoTimeFmt, localtime(&t));
    94     info.push_back(Item(kInfoModified, name));
     96    strftime(name, 64, B_TRANSLATE("%a, %d %b %Y, %r"), localtime(&t));
     97    info.push_back(Item(B_TRANSLATE("Modified"), name));
    9598
    9699    // Kind
    97100    BMimeType* type = f->Type();
    98101    type->GetShortDescription(name);
    99     info.push_back(Item(kInfoKind, name));
     102    info.push_back(Item(B_TRANSLATE("Kind"), name));
    100103    delete type;
    101104
    102105    // Path
    103106    string path;
    104107    f->GetPath(path);
    105     info.push_back(Item(kInfoPath, path));
     108    info.push_back(Item(B_TRANSLATE("Path"), path));
    106109
    107110    // Icon
    108111    BBitmap *icon = new BBitmap(BRect(0.0, 0.0, 31.0, 31.0), B_RGBA32);
     
    122125    float rightWidth = 0.0;
    123126    InfoList::iterator i = info.begin();
    124127    while (i != info.end()) {
    125         float w = smallFont.StringWidth((*i).first.c_str()) + 2.0 * kSmallHMargin;
     128        float w = smallFont.StringWidth((*i).first.c_str()) +
     129            2.0 * kSmallHMargin;
    126130        leftWidth = max_c(leftWidth, w);
    127131        w = smallFont.StringWidth((*i).second.c_str()) + 2.0 * kSmallHMargin;
    128132        rightWidth = max_c(rightWidth, w);
    129133        i++;
    130134    }
    131135
    132     float winHeight = 32.0 + 4.0 * kSmallVMargin + 5.0 * (fontHeight + kSmallVMargin);
     136    float winHeight = 32.0 + 4.0 * kSmallVMargin + 5.0 * (fontHeight
     137        + kSmallVMargin);
    133138    float winWidth = leftWidth + rightWidth;
    134139    ResizeTo(winWidth, winHeight);
    135140
    136     LeftView *leftView = new LeftView(BRect(0.0, 0.0, leftWidth, winHeight), icon);
     141    LeftView *leftView = new LeftView(BRect(0.0, 0.0, leftWidth, winHeight),
     142        icon);
    137143    BView *rightView = new BView(
    138144        BRect(leftWidth + 1.0, 0.0, winWidth, winHeight), NULL,
    139145        B_FOLLOW_NONE, B_WILL_DRAW);
     
    142148    AddChild(rightView);
    143149
    144150    BStringView *sv = new BStringView(
    145         BRect(kSmallHMargin, kSmallVMargin, rightView->Bounds().Width(), kSmallVMargin + 30.0),
    146         NULL, f->ref.name, B_FOLLOW_ALL);
     151        BRect(kSmallHMargin, kSmallVMargin, rightView->Bounds().Width(),
     152        kSmallVMargin + 30.0), NULL, f->ref.name, B_FOLLOW_ALL);
    147153
    148154    BFont largeFont(be_plain_font);
    149155    largeFont.SetSize(ceilf(largeFont.Size() * 1.1));
     
    154160    i = info.begin();
    155161    while (i != info.end()) {
    156162        sv = new BStringView(
    157             BRect(kSmallHMargin, y, leftView->Bounds().Width(), y + fontHeight),
    158             NULL, (*i).first.c_str());
     163            BRect(kSmallHMargin, y, leftView->Bounds().Width(),
     164            y + fontHeight), NULL, (*i).first.c_str());
    159165        sv->SetFont(&smallFont);
    160166        sv->SetAlignment(B_ALIGN_RIGHT);
    161167        sv->SetHighColor(kBasePieColor[1]); // arbitrary
    162168        leftView->AddChild(sv);
    163169
    164170        sv = new BStringView(
    165             BRect(kSmallHMargin, y, rightView->Bounds().Width(), y + fontHeight),
    166             NULL, (*i).second.c_str());
     171            BRect(kSmallHMargin, y, rightView->Bounds().Width(),
     172            y + fontHeight), NULL, (*i).second.c_str());
    167173        sv->SetFont(&smallFont);
    168174        rightView->AddChild(sv);
    169175
  • src/apps/diskusage/Jamfile

     
    1515    Snapshot.cpp
    1616    StatusView.cpp
    1717    VolumeView.cpp
    18     : be $(TARGET_LIBSTDC++)
     18    : be $(HAIKU_LOCALE_LIBS) $(TARGET_LIBSTDC++)
    1919    : DiskUsage.rdef
    2020;
    2121
     22DoCatalogs DiskUsage :
     23    x-vnd.Haiku-DiskUsage
     24    :
     25    MainWindow.cpp
     26    Common.cpp
     27    InfoWindow.cpp
     28    PieView.cpp
     29    Scanner.cpp
     30    StatusView.cpp
     31    VolumeView.cpp
     32;
     33
  • src/apps/diskusage/Common.cpp

     
    1717#include <stdlib.h>
    1818
    1919#include <Application.h>
     20#include <Catalog.h>
    2021#include <FindDirectory.h>
    2122#include <Roster.h>
    2223#include <Path.h>
    2324
    2425
     26#undef B_TRANSLATE_CONTEXT
     27#define B_TRANSLATE_CONTEXT "Common"
     28
    2529const char* kAppSignature       = "application/x-vnd.Haiku-DiskUsage";
    2630const char* kHelpFileName       = "userguide/en/applications/diskusage.html";
    2731const char* kPieRectAttrName    = "mainrect";
     
    7074
    7175    BResources* r = new BResources(&file);
    7276
    73 #define LoadString(n)   (char*)r->LoadResource(B_STRING_TYPE, n, &ignore)
    74 #define LoadColor(n)    *(rgb_color*)r->LoadResource(B_RGB_COLOR_TYPE, n, &ignore)
    75 #define LoadUint8(n)    *(uint8*)r->LoadResource(B_UINT8_TYPE, n, &ignore)
    76 
    77     size_t ignore;
    78     kVolMenuLabel = LoadString("STR_VM_LABEL");
    79     kOneFile = LoadString("STR_1_FILE");
    80     kManyFiles = LoadString("STR_N_FILES");
    81     kStrScan = LoadString("STR_SCAN");
    82     kStrRescan = LoadString("STR_RESCAN");
    83     kStrScanningX = LoadString("STR_SCN_X");
    84     kStrUnavail = LoadString("STR_UNAVAIL");
    85     kVolMenuDefault = LoadString("STR_VM_DFLT");
    86     kVolPrompt = LoadString("STR_VPROMPT");
    87     kMenuGetInfo = LoadString("STR_M_INFO");
    88     kMenuOpen = LoadString("STR_M_OPEN");
    89     kMenuOpenWith = LoadString("STR_M_OPENW");
    90     kMenuNoApps = LoadString("STR_M_NAPPS");
    91     kInfoSize = LoadString("STR_SIZE");
    92     kInfoInFiles = LoadString("STR_INFILES");
    93     kInfoCreated = LoadString("STR_MADE");
    94     kInfoModified = LoadString("STR_MOD");
    95     kInfoTimeFmt = LoadString("STR_TIMEFMT");
    96     kInfoKind = LoadString("STR_KIND");
    97     kInfoPath = LoadString("STR_PATH");
    98     kOutdatedStr = LoadString("STR_OUTDATED");
    99 
    10077    kWindowColor = ui_color(B_PANEL_BACKGROUND_COLOR);
    101     kOutlineColor = LoadColor("RGB_PIE_OL");
    102     kPieBGColor = LoadColor("RGB_PIE_BG");
    103     kEmptySpcColor = LoadColor("RGB_PIE_MT");
     78    kOutlineColor = RGB_PIE_OL;
     79    kPieBGColor = RGB_PIE_BG;
     80    kEmptySpcColor = RGB_PIE_MT;
    10481
    105     kBasePieColorCount = LoadUint8("N_PIE_COLORS");
     82    kBasePieColorCount = N_PIE_COLORS;
    10683    kBasePieColor = new rgb_color[kBasePieColorCount];
    10784    for (int i = 0; i < kBasePieColorCount; i++) {
    108         char colorName[16] = "RGB_PIE_n";
    109         colorName[8] = '1' + i;
    110         kBasePieColor[i] = LoadColor(colorName);
     85        switch (i) {
     86            case 0:
     87                kBasePieColor[i] = RGB_PIE_1;
     88                break;
     89            case 1:
     90                kBasePieColor[i] = RGB_PIE_2;
     91                break;
     92            case 2:
     93                kBasePieColor[i] = RGB_PIE_3;
     94                break;
     95            case 3:
     96                kBasePieColor[i] = RGB_PIE_4;
     97                break;
     98            default:
     99                break;
     100        }
    111101    }
    112102
    113103    // Get a reference to the help file.
     
    133123        float       divisor;
    134124        const char* format;
    135125    } scale[] = {
    136         { 0x100000,             1024.0,                 "%.2f KiB" },
    137         { 0x40000000,           1048576.0,              "%.2f MiB" },
    138         { 0x10000000000ull,     1073741824.0,           "%.2f GiB" },
    139         { 0x4000000000000ull,   1.09951162778e+12,      "%.2f TiB" }
     126        { 0x100000,             1024.0,
     127            B_TRANSLATE("%.2f KiB") },
     128        { 0x40000000,           1048576.0,
     129            B_TRANSLATE("%.2f MiB") },
     130        { 0x10000000000ull,     1073741824.0,
     131            B_TRANSLATE("%.2f GiB") },
     132        { 0x4000000000000ull,   1.09951162778e+12,
     133            B_TRANSLATE("%.2f TiB") }
    140134    };
    141135
    142136    if (byteCount < 1024) {
    143         sprintf(name, "%lld bytes", byteCount);
     137        sprintf(name, B_TRANSLATE("%lld bytes"), byteCount);
    144138    } else {
    145139        int i = 0;
    146140        while (byteCount >= scale[i].limit)
  • src/apps/diskusage/Scanner.cpp

     
    1313#include <stdlib.h>
    1414#include <string.h>
    1515
     16#include <Catalog.h>
    1617#include <Directory.h>
    1718#include <PathMonitor.h>
    1819
    1920#include "Common.h"
    2021
     22#undef B_TRANSLATE_CONTEXT
     23#define B_TRANSLATE_CONTEXT "Scanner"
     24
    2125using std::vector;
    2226
    2327
     
    6367        case kScanRefresh:
    6468        {
    6569            FileInfo* startInfo;
    66             if (message->FindPointer(kNameFilePtr, (void **)&startInfo) == B_OK)
     70            if (message->FindPointer(kNameFilePtr, (void **)&startInfo)
     71                == B_OK)
    6772                _RunScan(startInfo);
    6873            break;
    6974        }
     
    200205void
    201206Scanner::_RunScan(FileInfo* startInfo)
    202207{
     208    BString sScan(B_TRANSLATE("Scanning"));
     209    sScan << " ";
     210    const char* kStrScanningX = sScan.String();
     211
    203212    if (startInfo == NULL || startInfo == fSnapshot->rootDir) {
    204213        delete fSnapshot;
    205214        fSnapshot = new VolumeSnapshot(fVolume);
     
    215224
    216225        FileInfo* freeSpace = new FileInfo;
    217226        freeSpace->pseudo = true;
    218         string s = "Free on " + fSnapshot->name;
     227        string s = B_TRANSLATE("Free on ") + fSnapshot->name;
    219228        freeSpace->ref.set_name(s.c_str());
    220229        freeSpace->size = fSnapshot->freeBytes;
    221230        fSnapshot->freeSpace = freeSpace;
     
    227236        fSnapshot->freeBytes = fVolume->FreeBytes();
    228237        fTask = kStrScanningX + string(startInfo->ref.name);
    229238        fVolumeBytesInUse = fSnapshot->capacity - fSnapshot->freeBytes;
    230         fVolumeBytesScanned = fVolumeBytesInUse - startInfo->size; // best guess
     239        fVolumeBytesScanned = fVolumeBytesInUse - startInfo->size; //best guess
    231240        fProgress = 100.0 * fVolumeBytesScanned / fVolumeBytesInUse;
    232241        fLastReport = -100.0;
    233242
  • src/apps/diskusage/Common.h

     
    99#ifndef COMMON_H
    1010#define COMMON_H
    1111
    12 
    1312#include <Entry.h>
    1413#include <GraphicsDefs.h>
    1514#include <Resources.h>
    1615#include <Roster.h>
    1716
    1817
     18const rgb_color RGB_WIN = { 0xDE, 0xDB, 0xDE, 0xFF };
     19const rgb_color RGB_PIE_OL = { 0x80, 0x80, 0x80, 0xFF };
     20const rgb_color RGB_PIE_BG = { 0xFF, 0xFF, 0xFF, 0xFF };
     21const rgb_color RGB_PIE_MT = { 0xA0, 0xA0, 0xA0, 0xFF };
     22const rgb_color RGB_PIE_1 = { 0x00, 0x60, 0x60, 0xFF };
     23const rgb_color RGB_PIE_2 = { 0x00, 0x00, 0x68, 0xFF };
     24const rgb_color RGB_PIE_3 = { 0x60, 0x00, 0x60, 0xFF };
     25const rgb_color RGB_PIE_4 = { 0x68, 0x00, 0x00, 0xFF };
     26
     27#define N_PIE_COLORS ((uint8)4)
     28
    1929#ifdef ASSIGN_RESOURCES
    2030#   define EXTERN
    2131#   define EQ(x)
     
    2636
    2737#define EXTERN_CONST extern const
    2838
    29 
    3039// Resources
    31 EXTERN char* kStrScan;
    32 EXTERN char* kStrRescan;
    33 EXTERN char* kOutdatedStr;
    34 EXTERN char* kStrScanningX;
    35 EXTERN char* kStrUnavail;
    36 EXTERN char* kVolMenuLabel;
    37 EXTERN char* kVolMenuDefault;
    38 EXTERN char* kVolPrompt;
    39 EXTERN char* kOneFile;
    40 EXTERN char* kManyFiles;
    41 EXTERN char* kMenuGetInfo;
    42 EXTERN char* kMenuOpen;
    43 EXTERN char* kMenuOpenWith;
    44 EXTERN char* kMenuNoApps;
    45 EXTERN char* kInfoSize;
    46 EXTERN char* kInfoInFiles;
    47 EXTERN char* kInfoCreated;
    48 EXTERN char* kInfoModified;
    49 EXTERN char* kInfoTimeFmt;
    50 EXTERN char* kInfoKind;
    51 EXTERN char* kInfoPath;
    52 
    5340EXTERN rgb_color kWindowColor;
    5441EXTERN rgb_color kOutlineColor;
    5542EXTERN rgb_color kPieBGColor;
     
    10491void size_to_string(off_t byteCount, char* name);
    10592
    10693
     94
    10795#endif // COMMON_H