Ticket #6374: tracker.4.patch

File tracker.4.patch, 13.8 KB (added by mt, 14 years ago)
  • src/kits/tracker/InfoWindow.cpp

     
    431431        case kEditItem:
    432432        {
    433433            BEntry entry(fModel->EntryRef());
    434             if (ConfirmChangeIfWellKnownDirectory(&entry, "rename"))
     434            if (ConfirmChangeIfWellKnownDirectory(&entry,
     435                B_TRANSLATE("rename")))
    435436                fAttributeView->BeginEditingTitle();
    436437            break;
    437438        }
     
    12201221    } else if (fTitleRect.Contains(point)) {
    12211222        // You can't change the name of the trash
    12221223        if (!fModel->IsTrash()
    1223             && ConfirmChangeIfWellKnownDirectory(&entry, "rename", true)
     1224            && ConfirmChangeIfWellKnownDirectory(&entry,
     1225                B_TRANSLATE("rename"), true)
    12241226            && fTitleEditView == 0)
    12251227            BeginEditingTitle();
    12261228    } else if (fTitleEditView) {
  • src/kits/tracker/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
     
    664665
    665666    BEntry entry(pose->TargetModel()->EntryRef());
    666667    if (entry.InitCheck() != B_OK) {
    667         BString errorString;
    668         errorString << "Could not find application \""
    669             << pose->TargetModel()->Name() << "\"";
     668        BString errorString(
     669            B_TRANSLATE("Could not find application \"%appname\""));
     670        errorString.ReplaceFirst("%appname", pose->TargetModel()->Name());
    670671
    671672        (new BAlert("", errorString.String(), B_TRANSLATE("OK"), 0, 0,
    672673            B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go();
     
    675676
    676677    if (OpenWithRelation(pose->TargetModel()) == kNoRelation) {
    677678        if (!fIterator->GenericFilesOnly()) {
    678             BString warning;
    679             warning << "The application \"" << pose->TargetModel()->Name()
    680                 << "\" does not support the type of document you are "
     679            BString warning(B_TRANSLATE(
     680                "The application \"%appname\" does not support the type of document you are "
    681681                "about to open. Are you sure you want to proceed? If you know that "
    682682                "the application supports the document type, you should contact the "
    683683                "publisher of the application and ask them to update their application "
    684                 "to list the type of your document as supported.";
     684                "to list the type of your document as supported."));
     685            warning.ReplaceFirst("%appname", pose->TargetModel()->Name());
    685686
    686687            BAlert* alert = new BAlert("", warning.String(),
    687688                B_TRANSLATE("Cancel"), B_TRANSLATE("Open"), 0, B_WIDTH_AS_USUAL,
     
    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
  • src/kits/tracker/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
  • src/kits/tracker/FSUtils.cpp

     
    19881988    tm timeData;
    19891989    localtime_r(&stat->st_mtime, &timeData);
    19901990
    1991     sprintf(buffer, "\n\t(%Ld bytes, ", stat->st_size);
    1992     uint32 pos = strlen(buffer);
     1991
     1992    uint32 pos = sprintf(buffer,
     1993        B_TRANSLATE("\n\t(%Ld bytes, "), stat->st_size);
    19931994    strftime(buffer + pos, length - pos,"%b %d %Y, %I:%M:%S %p)", &timeData);
    19941995}
    19951996
  • src/kits/tracker/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(
     685                    "(%SizeProcessed of %TotalSize, %BytesPerSecond/s)"));
     686                buffer.ReplaceFirst("%SizeProcessed",
     687                    string_for_size((double)fSizeProcessed, sizeBuffer,
     688                    sizeof(sizeBuffer)));
     689                buffer.ReplaceFirst("%TotalSize",
     690                    string_for_size((double)fTotalSize, sizeBuffer,
     691                    sizeof(sizeBuffer)));
     692                buffer.ReplaceFirst("%BytesPerSecond",
     693                    string_for_size(fBytesPerSecond, sizeBuffer,
     694                    sizeof(sizeBuffer)));
    694695                tp.x = fStatusBar->Frame().right - StringWidth(buffer.String());
    695696                if (tp.x > rightDivider)
    696697                    DrawString(buffer.String(), tp);
    697698                else {
    698699                    // complete string too wide, try with shorter version
    699                     buffer << string_for_size(fBytesPerSecond, sizeBuffer,
    700                         sizeof(sizeBuffer));
    701                     buffer << "/s";
     700                    buffer << B_TRANSLATE("%BytesPerSecond/s");
     701                    buffer.ReplaceFirst("%BytesPerSecond",
     702                        string_for_size(fBytesPerSecond, sizeBuffer,
     703                        sizeof(sizeBuffer)));
    702704                    tp.x = fStatusBar->Frame().right
    703705                        - StringWidth(buffer.String());
    704706                    if (tp.x > rightDivider)
  • src/kits/tracker/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
  • src/kits/tracker/PoseView.cpp

     
    42634263                char name[B_FILE_NAME_LENGTH];
    42644264                BFile file;
    42654265                if (CreateClippingFile(poseView, file, name, &targetDirectory, message,
    4266                     "Untitled clipping", !targetPose, dropPt) != B_OK)
     4266                    B_TRANSLATE("Untitled clipping"),
     4267                    !targetPose, dropPt) != B_OK)
    42674268                    return false;
    42684269
    42694270                // here is a file for the drag initiator, it is up to it now to stuff it
     
    44154416
    44164417            BFile file;
    44174418            if (CreateClippingFile(poseView, file, name, &targetDirectory, message,
    4418                     "Untitled clipping", !targetPose, dropPt) != B_OK)
     4419                    B_TRANSLATE("Untitled clipping"),
     4420                    !targetPose, dropPt) != B_OK)
    44194421                return false;
    44204422
    44214423            // write out the file
     
    44684470
    44694471            BFile file;
    44704472            if (CreateClippingFile(poseView, file, name, &targetDirectory, message,
    4471                 "Untitled bitmap", !targetPose, dropPt) != B_OK)
     4473                B_TRANSLATE("Untitled bitmap"), !targetPose, dropPt) != B_OK)
    44724474                return false;
    44734475
    44744476            int32 size = embeddedBitmap.FlattenedSize();
     
    47534755    if (srcWindow->TargetModel()->IsQuery()
    47544756        && !forceCopy && !destIsTrash && !createLink) {
    47554757        srcWindow->UpdateIfNeeded();
    4756         BAlert *alert = new BAlert("", 
     4758        BAlert *alert = new BAlert("",
    47574759            B_TRANSLATE("Are you sure you want to move or copy the selected "
    47584760            "item(s) to this folder?"), B_TRANSLATE("Cancel"),
    47594761            B_TRANSLATE("Move"), NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT);
     
    59575959        regExpression.SetTo(expression);
    59585960
    59595961        if (regExpression.InitCheck() != B_OK) {
    5960             BString message;
    5961             message << B_TRANSLATE("Error in regular expression:\n\n'");
    5962             message << regExpression.ErrorString() << "'";
     5962            BString message(
     5963                B_TRANSLATE("Error in regular expression:\n\n'%errstring'"));
     5964            message.ReplaceFirst("%errstring", regExpression.ErrorString());
    59635965            (new BAlert("", message.String(), B_TRANSLATE("OK"), NULL, NULL,
    59645966                B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go();
    59655967            return 0;
  • src/kits/tracker/FindPanel.cpp

     
    28032803    if (item != NULL)
    28042804        result << item->Label();
    28052805    else
    2806         result << "Name";
     2806        result << B_TRANSLATE("Name");
    28072807
    28082808    if (item->Submenu() != NULL)
    28092809        item = item->Submenu()->FindMarked();
  • src/kits/tracker/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:
  • src/kits/tracker/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
     
    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(
     384            kRegExpErrorStringArray[fError - B_ERRORS_END]);
    380385
    381386    return strerror(fError);
    382387}