Ticket #6374: tracker.patch

File tracker.patch, 10.0 KB (added by mt, 14 years ago)
  • InfoWindow.cpp

     
    431431        case kEditItem:
    432432        {
    433433            BEntry entry(fModel->EntryRef());
    434             if (ConfirmChangeIfWellKnownDirectory(&entry, "rename"))
     434            if (ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("rename")))
    435435                fAttributeView->BeginEditingTitle();
    436436            break;
    437437        }
     
    12201220    } else if (fTitleRect.Contains(point)) {
    12211221        // You can't change the name of the trash
    12221222        if (!fModel->IsTrash()
    1223             && ConfirmChangeIfWellKnownDirectory(&entry, "rename", true)
     1223            && ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("rename"), true)
    12241224            && fTitleEditView == 0)
    12251225            BeginEditingTitle();
    12261226    } else if (fTitleEditView) {
  • OpenWithWindow.cpp

     
    148148        // if opening just one file, use it in the title
    149149        entry_ref ref;
    150150        fEntriesToOpen->FindRef("refs", &ref);
    151         BString buffer;
    152         buffer << "Open " << ref.name << " with:";
     151        BString buffer(B_TRANSLATE("Open %name with:"));
     152        buffer.ReplaceFirst("%name", ref.name);
     153
    153154        SetTitle(buffer.String());
    154155    } else
    155156        // use generic title
     
    14371438            break;
    14381439
    14391440        if (preferredAppForFile && ref == *preferredAppForFile) {
    1440             *description = "Preferred for file";
     1441            description->SetTo(B_TRANSLATE("Preferred for file"));
    14411442            return;
    14421443        }
    14431444
     
    14521453                continue;
    14531454
    14541455            case kSuperhandler:
    1455                 *description = "Handles any file";
     1456                description->SetTo(B_TRANSLATE("Handles any file"));
    14561457                return;
    14571458
    14581459            case kSupportsSupertype:
     
    14671468
    14681469                //PRINT(("getting supertype for %s, result %s, got %s\n",
    14691470                //  model.MimeType(), strerror(result), mimeType.Type()));
    1470                 *description = "Handles any ";
     1471                description->SetTo(B_TRANSLATE("Handles any %type"));
    14711472                // *description += mimeType.Type();
    1472                 *description += type;
     1473                description->ReplaceFirst("%type", type);
    14731474                return;
    14741475            }
    14751476
     
    14791480
    14801481                if (preferredApp && *applicationModel->EntryRef() == *preferredApp)
    14811482                    // application matches cached preferred app, we are done
    1482                     *description = "Preferred for ";
     1483                    description->SetTo(B_TRANSLATE("Preferred for %type"));
    14831484                else
    1484                     *description = "Handles ";
     1485                    description->SetTo(B_TRANSLATE("Handles %type"));
    14851486
    14861487                char shortDescription[256];
    14871488                if (mimeType.GetShortDescription(shortDescription) == B_OK)
    1488                     *description += shortDescription;
     1489                    description->ReplaceFirst("%type", shortDescription);
    14891490                else
    1490                     *description += mimeType.Type();
     1491                    description->ReplaceFirst("%type", mimeType.Type());
    14911492                return;
    14921493            }
    14931494        }
    14941495    }
    14951496
    1496     *description = "Does not handle file";
     1497    description->SetTo(B_TRANSLATE("Does not handle file"));
    14971498}
    14981499
    14991500
  • TextWidget.cpp

     
    3636#include <stdlib.h>
    3737
    3838#include <Alert.h>
     39#include <Catalog.h>
    3940#include <Debug.h>
    4041#include <Directory.h>
    4142#include <MessageFilter.h>
     
    5455#include "WidgetAttributeText.h"
    5556
    5657
     58#undef B_TRANSLATE_CONTEXT
     59#define B_TRANSLATE_CONTEXT "libtracker"
     60
    5761const float kWidthMargin = 20;
    5862
    5963
     
    326330        return;
    327331
    328332    BEntry entry(pose->TargetModel()->EntryRef());
    329     if (entry.InitCheck() == B_OK 
    330         && !ConfirmChangeIfWellKnownDirectory(&entry, "rename"))
     333    if (entry.InitCheck() == B_OK
     334        && !ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("rename")))
    331335        return;
    332336
    333337    // get bounds with full text length
  • StatusWindow.cpp

     
    661661    if (IsPaused())
    662662        DrawString(B_TRANSLATE("Paused: click to resume or stop"), tp);
    663663    else if (fDestDir.Length()) {
    664         BString buffer;
    665         buffer << "To: " << fDestDir;
     664        BString buffer(B_TRANSLATE("To: %dir"));
     665        buffer.ReplaceFirst("%dir", fDestDir);
    666666        SetHighColor(0, 0, 0);
    667667        DrawString(buffer.String(), tp);
    668668
     
    681681            // Draw speed info
    682682            if (fBytesPerSecond != 0.0) {
    683683                char sizeBuffer[128];
    684                 buffer = "(";
    685                 buffer << string_for_size((double)fSizeProcessed, sizeBuffer,
    686                     sizeof(sizeBuffer));
    687                 buffer << " of ";
    688                 buffer << string_for_size((double)fTotalSize, sizeBuffer,
    689                     sizeof(sizeBuffer));
    690                 buffer << ", ";
    691                 buffer << string_for_size(fBytesPerSecond, sizeBuffer,
    692                     sizeof(sizeBuffer));
    693                 buffer << "/s)";
     684                buffer.SetTo(B_TRANSLATE("(%SizeProcessed of %TotalSize, %BytesPerSecond/s)"));
     685                buffer.ReplaceFirst("%SizeProcessed",
     686                    string_for_size((double)fSizeProcessed, sizeBuffer, sizeof(sizeBuffer)));
     687                buffer.ReplaceFirst("%TotalSize",
     688                    string_for_size((double)fTotalSize, sizeBuffer, sizeof(sizeBuffer)));
     689                buffer.ReplaceFirst("%BytesPerSecond",
     690                    string_for_size(fBytesPerSecond, sizeBuffer, sizeof(sizeBuffer)));
    694691                tp.x = fStatusBar->Frame().right - StringWidth(buffer.String());
    695692                if (tp.x > rightDivider)
    696693                    DrawString(buffer.String(), tp);
    697694                else {
    698695                    // complete string too wide, try with shorter version
    699                     buffer << string_for_size(fBytesPerSecond, sizeBuffer,
    700                         sizeof(sizeBuffer));
    701                     buffer << "/s";
     696                    buffer << B_TRANSLATE("%BytesPerSecond/s");
     697                    buffer.ReplaceFirst("%BytesPerSecond",
     698                        string_for_size(fBytesPerSecond, sizeBuffer, sizeof(sizeBuffer)));
    702699                    tp.x = fStatusBar->Frame().right
    703700                        - StringWidth(buffer.String());
    704701                    if (tp.x > rightDivider)
  • Jamfile

     
    117117    PoseView.cpp
    118118    QueryContainerWindow.cpp
    119119    QueryPoseView.cpp
     120    RegExp.cpp
    120121    SelectionWindow.cpp
    121122    SettingsViews.cpp
    122123    SlowContextPopup.cpp
    123124    StatusWindow.cpp
    124125    TemplatesMenu.cpp
     126    TextWidget.cpp
    125127    Tracker.cpp
    126128    TrackerInitialState.cpp
    127129    TrackerSettingsWindow.cpp
  • PoseView.cpp

     
    59575957        regExpression.SetTo(expression);
    59585958
    59595959        if (regExpression.InitCheck() != B_OK) {
    5960             BString message;
    5961             message << B_TRANSLATE("Error in regular expression:\n\n'");
    5962             message << regExpression.ErrorString() << "'";
     5960            BString message(B_TRANSLATE("Error in regular expression:\n\n'%errstring'"));
     5961            message.ReplaceFirst("%errstring", regExpression.ErrorString());
    59635962            (new BAlert("", message.String(), B_TRANSLATE("OK"), NULL, NULL,
    59645963                B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
    59655964            return 0;
  • FilePermissionsView.cpp

     
    6262
    6363    strView = new BStringView(BRect(kColumnLabelMiddle - kColumnLabelWidth / 2,
    6464        kColumnLabelTop, kColumnLabelMiddle + kColumnLabelWidth / 2, kColumnLabelBottom),
    65         "", "Owner");
     65        "", B_TRANSLATE("Owner"));
    6666    AddChild(strView);
    6767    strView->SetAlignment(B_ALIGN_CENTER);
    6868    strView->SetFontSize(kAttribFontHeight);
     
    221221                    user << nodeOwner;
    222222                fOwnerTextControl->SetText(user.String());
    223223            } else
    224                 fOwnerTextControl->SetText("Unknown");
     224                fOwnerTextControl->SetText(B_TRANSLATE("Unknown"));
    225225
    226226            if (node.GetGroup(&nodeGroup) == B_OK) {
    227227                BString group;
     
    234234                    group << nodeGroup;
    235235                fGroupTextControl->SetText(group.String());
    236236            } else
    237                 fGroupTextControl->SetText("Unknown");
     237                fGroupTextControl->SetText(B_TRANSLATE("Unknown"));
    238238
    239239            // Unless we're root, only allow the owner to transfer the ownership,
    240240            // i.e. disable text controls if uid:s doesn't match:
  • RegExp.cpp

     
    6565#include <stdio.h>
    6666#include <string.h>
    6767
     68#include <Catalog.h>
    6869#include <Errors.h>
    6970
    7071#include "RegExp.h"
    7172
     73#undef B_TRANSLATE_CONTEXT
     74#define B_TRANSLATE_CONTEXT "libtracker"
     75
    7276// The first byte of the regexp internal "program" is actually this magic
    7377// number; the start node begins in the second byte.
    7478
     
    148152//      and to minimize recursive plunges.
    149153//
    150154// kRegExpOpen,kRegExpClose ...are numbered at compile time.
    151 //
    152155//
    153156//
     157//
    154158// A node is one char of opcode followed by two chars of "next" pointer.
    155159// "Next" pointers are stored as two 8-bit pieces, high order first.  The
    156160// value is a positive offset from the opcode of the node containing it.
     
    172176    kWorst = 0  // Worst case.
    173177};
    174178
    175 const char *kRegExpErrorStringArray[] = {
    176     "Unmatched parenthesis.",
    177     "Expression too long.",
    178     "Too many parenthesis.",
    179     "Junk on end.",
    180     "*+? operand may be empty.",
    181     "Nested *?+.",
    182     "Invalid bracket range.",
    183     "Unmatched brackets.",
    184     "Internal error.",
    185     "?+* follows nothing.",
    186     "Trailing \\.",
    187     "Corrupted expression.",
    188     "Memory corruption.",
    189     "Corrupted pointers.",
    190     "Corrupted opcode."
     179static const char *kRegExpErrorStringArray[] = {
     180    B_TRANSLATE_MARK("Unmatched parenthesis."),
     181    B_TRANSLATE_MARK("Expression too long."),
     182    B_TRANSLATE_MARK("Too many parenthesis."),
     183    B_TRANSLATE_MARK("Junk on end."),
     184    B_TRANSLATE_MARK("*+? operand may be empty."),
     185    B_TRANSLATE_MARK("Nested *?+."),
     186    B_TRANSLATE_MARK("Invalid bracket range."),
     187    B_TRANSLATE_MARK("Unmatched brackets."),
     188    B_TRANSLATE_MARK("Internal error."),
     189    B_TRANSLATE_MARK("?+* follows nothing."),
     190    B_TRANSLATE_MARK("Trailing \\."),
     191    B_TRANSLATE_MARK("Corrupted expression."),
     192    B_TRANSLATE_MARK("Memory corruption."),
     193    B_TRANSLATE_MARK("Corrupted pointers."),
     194    B_TRANSLATE_MARK("Corrupted opcode.")
    191195};
    192196
    193197#ifdef DEBUG
     
    376380{
    377381    if (fError >= REGEXP_UNMATCHED_PARENTHESIS
    378382        && fError <= REGEXP_CORRUPTED_OPCODE)
    379         return kRegExpErrorStringArray[fError - B_ERRORS_END];
     383        return B_TRANSLATE_NOCOLLECT(kRegExpErrorStringArray[fError - B_ERRORS_END]);
    380384
    381385    return strerror(fError);
    382386}