Ticket #6374: tracker.3.patch
File tracker.3.patch, 13.2 KB (added by , 14 years ago) |
---|
-
InfoWindow.cpp
431 431 case kEditItem: 432 432 { 433 433 BEntry entry(fModel->EntryRef()); 434 if (ConfirmChangeIfWellKnownDirectory(&entry, "rename"))434 if (ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("rename"))) 435 435 fAttributeView->BeginEditingTitle(); 436 436 break; 437 437 } … … 1220 1220 } else if (fTitleRect.Contains(point)) { 1221 1221 // You can't change the name of the trash 1222 1222 if (!fModel->IsTrash() 1223 && ConfirmChangeIfWellKnownDirectory(&entry, "rename", true)1223 && ConfirmChangeIfWellKnownDirectory(&entry, B_TRANSLATE("rename"), true) 1224 1224 && fTitleEditView == 0) 1225 1225 BeginEditingTitle(); 1226 1226 } else if (fTitleEditView) { -
OpenWithWindow.cpp
148 148 // if opening just one file, use it in the title 149 149 entry_ref ref; 150 150 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 153 154 SetTitle(buffer.String()); 154 155 } else 155 156 // use generic title … … 664 665 665 666 BEntry entry(pose->TargetModel()->EntryRef()); 666 667 if (entry.InitCheck() != B_OK) { 667 BString errorString; 668 errorString << "Could not find application \"" 669 << pose->TargetModel()->Name() << "\""; 668 BString errorString(B_TRANSLATE("Could not find application \"%appname\"")); 669 errorString.ReplaceFirst("%appname", pose->TargetModel()->Name()); 670 670 671 671 (new BAlert("", errorString.String(), B_TRANSLATE("OK"), 0, 0, 672 672 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); … … 675 675 676 676 if (OpenWithRelation(pose->TargetModel()) == kNoRelation) { 677 677 if (!fIterator->GenericFilesOnly()) { 678 BString warning; 679 warning << "The application \"" << pose->TargetModel()->Name() 680 << "\" does not support the type of document you are " 678 BString warning(B_TRANSLATE( 679 "The application \"%appname\" does not support the type of document you are " 681 680 "about to open. Are you sure you want to proceed? If you know that " 682 681 "the application supports the document type, you should contact the " 683 682 "publisher of the application and ask them to update their application " 684 "to list the type of your document as supported."; 683 "to list the type of your document as supported.")); 684 warning.ReplaceFirst("%appname", pose->TargetModel()->Name()); 685 685 686 686 BAlert* alert = new BAlert("", warning.String(), 687 687 B_TRANSLATE("Cancel"), B_TRANSLATE("Open"), 0, B_WIDTH_AS_USUAL, … … 1437 1437 break; 1438 1438 1439 1439 if (preferredAppForFile && ref == *preferredAppForFile) { 1440 *description = "Preferred for file";1440 description->SetTo(B_TRANSLATE("Preferred for file")); 1441 1441 return; 1442 1442 } 1443 1443 … … 1452 1452 continue; 1453 1453 1454 1454 case kSuperhandler: 1455 *description = "Handles any file";1455 description->SetTo(B_TRANSLATE("Handles any file")); 1456 1456 return; 1457 1457 1458 1458 case kSupportsSupertype: … … 1467 1467 1468 1468 //PRINT(("getting supertype for %s, result %s, got %s\n", 1469 1469 // model.MimeType(), strerror(result), mimeType.Type())); 1470 *description = "Handles any ";1470 description->SetTo(B_TRANSLATE("Handles any %type")); 1471 1471 // *description += mimeType.Type(); 1472 *description += type;1472 description->ReplaceFirst("%type", type); 1473 1473 return; 1474 1474 } 1475 1475 … … 1479 1479 1480 1480 if (preferredApp && *applicationModel->EntryRef() == *preferredApp) 1481 1481 // application matches cached preferred app, we are done 1482 *description = "Preferred for ";1482 description->SetTo(B_TRANSLATE("Preferred for %type")); 1483 1483 else 1484 *description = "Handles ";1484 description->SetTo(B_TRANSLATE("Handles %type")); 1485 1485 1486 1486 char shortDescription[256]; 1487 1487 if (mimeType.GetShortDescription(shortDescription) == B_OK) 1488 *description += shortDescription;1488 description->ReplaceFirst("%type", shortDescription); 1489 1489 else 1490 *description += mimeType.Type();1490 description->ReplaceFirst("%type", mimeType.Type()); 1491 1491 return; 1492 1492 } 1493 1493 } 1494 1494 } 1495 1495 1496 *description = "Does not handle file";1496 description->SetTo(B_TRANSLATE("Does not handle file")); 1497 1497 } 1498 1498 1499 1499 -
TextWidget.cpp
36 36 #include <stdlib.h> 37 37 38 38 #include <Alert.h> 39 #include <Catalog.h> 39 40 #include <Debug.h> 40 41 #include <Directory.h> 41 42 #include <MessageFilter.h> … … 54 55 #include "WidgetAttributeText.h" 55 56 56 57 58 #undef B_TRANSLATE_CONTEXT 59 #define B_TRANSLATE_CONTEXT "libtracker" 60 57 61 const float kWidthMargin = 20; 58 62 59 63 … … 326 330 return; 327 331 328 332 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"))) 331 335 return; 332 336 333 337 // get bounds with full text length -
FSUtils.cpp
1988 1988 tm timeData; 1989 1989 localtime_r(&stat->st_mtime, &timeData); 1990 1990 1991 sprintf(buffer, "\n\t(%Ld bytes, ", stat->st_size);1992 uint32 pos = s trlen(buffer);1991 1992 uint32 pos = sprintf(buffer, B_TRANSLATE("\n\t(%Ld bytes, "), stat->st_size); 1993 1993 strftime(buffer + pos, length - pos,"%b %d %Y, %I:%M:%S %p)", &timeData); 1994 1994 } 1995 1995 -
StatusWindow.cpp
661 661 if (IsPaused()) 662 662 DrawString(B_TRANSLATE("Paused: click to resume or stop"), tp); 663 663 else if (fDestDir.Length()) { 664 BString buffer ;665 buffer << "To: " << fDestDir;664 BString buffer(B_TRANSLATE("To: %dir")); 665 buffer.ReplaceFirst("%dir", fDestDir); 666 666 SetHighColor(0, 0, 0); 667 667 DrawString(buffer.String(), tp); 668 668 … … 681 681 // Draw speed info 682 682 if (fBytesPerSecond != 0.0) { 683 683 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))); 694 691 tp.x = fStatusBar->Frame().right - StringWidth(buffer.String()); 695 692 if (tp.x > rightDivider) 696 693 DrawString(buffer.String(), tp); 697 694 else { 698 695 // 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))); 702 699 tp.x = fStatusBar->Frame().right 703 700 - StringWidth(buffer.String()); 704 701 if (tp.x > rightDivider) -
Jamfile
117 117 PoseView.cpp 118 118 QueryContainerWindow.cpp 119 119 QueryPoseView.cpp 120 RegExp.cpp 120 121 SelectionWindow.cpp 121 122 SettingsViews.cpp 122 123 SlowContextPopup.cpp 123 124 StatusWindow.cpp 124 125 TemplatesMenu.cpp 126 TextWidget.cpp 125 127 Tracker.cpp 126 128 TrackerInitialState.cpp 127 129 TrackerSettingsWindow.cpp -
PoseView.cpp
4263 4263 char name[B_FILE_NAME_LENGTH]; 4264 4264 BFile file; 4265 4265 if (CreateClippingFile(poseView, file, name, &targetDirectory, message, 4266 "Untitled clipping", !targetPose, dropPt) != B_OK)4266 B_TRANSLATE("Untitled clipping"), !targetPose, dropPt) != B_OK) 4267 4267 return false; 4268 4268 4269 4269 // here is a file for the drag initiator, it is up to it now to stuff it … … 4415 4415 4416 4416 BFile file; 4417 4417 if (CreateClippingFile(poseView, file, name, &targetDirectory, message, 4418 "Untitled clipping", !targetPose, dropPt) != B_OK)4418 B_TRANSLATE("Untitled clipping"), !targetPose, dropPt) != B_OK) 4419 4419 return false; 4420 4420 4421 4421 // write out the file … … 4468 4468 4469 4469 BFile file; 4470 4470 if (CreateClippingFile(poseView, file, name, &targetDirectory, message, 4471 "Untitled bitmap", !targetPose, dropPt) != B_OK)4471 B_TRANSLATE("Untitled bitmap"), !targetPose, dropPt) != B_OK) 4472 4472 return false; 4473 4473 4474 4474 int32 size = embeddedBitmap.FlattenedSize(); … … 5957 5957 regExpression.SetTo(expression); 5958 5958 5959 5959 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()); 5963 5962 (new BAlert("", message.String(), B_TRANSLATE("OK"), NULL, NULL, 5964 5963 B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); 5965 5964 return 0; -
FindPanel.cpp
2802 2802 if (item != NULL) 2803 2803 result << item->Label(); 2804 2804 else 2805 result << "Name";2805 result << B_TRANSLATE("Name"); 2806 2806 2807 2807 if (item->Submenu() != NULL) 2808 2808 item = item->Submenu()->FindMarked(); -
FilePermissionsView.cpp
62 62 63 63 strView = new BStringView(BRect(kColumnLabelMiddle - kColumnLabelWidth / 2, 64 64 kColumnLabelTop, kColumnLabelMiddle + kColumnLabelWidth / 2, kColumnLabelBottom), 65 "", "Owner");65 "", B_TRANSLATE("Owner")); 66 66 AddChild(strView); 67 67 strView->SetAlignment(B_ALIGN_CENTER); 68 68 strView->SetFontSize(kAttribFontHeight); … … 221 221 user << nodeOwner; 222 222 fOwnerTextControl->SetText(user.String()); 223 223 } else 224 fOwnerTextControl->SetText( "Unknown");224 fOwnerTextControl->SetText(B_TRANSLATE("Unknown")); 225 225 226 226 if (node.GetGroup(&nodeGroup) == B_OK) { 227 227 BString group; … … 234 234 group << nodeGroup; 235 235 fGroupTextControl->SetText(group.String()); 236 236 } else 237 fGroupTextControl->SetText( "Unknown");237 fGroupTextControl->SetText(B_TRANSLATE("Unknown")); 238 238 239 239 // Unless we're root, only allow the owner to transfer the ownership, 240 240 // i.e. disable text controls if uid:s doesn't match: -
RegExp.cpp
65 65 #include <stdio.h> 66 66 #include <string.h> 67 67 68 #include <Catalog.h> 68 69 #include <Errors.h> 69 70 70 71 #include "RegExp.h" 71 72 73 #undef B_TRANSLATE_CONTEXT 74 #define B_TRANSLATE_CONTEXT "libtracker" 75 72 76 // The first byte of the regexp internal "program" is actually this magic 73 77 // number; the start node begins in the second byte. 74 78 … … 148 152 // and to minimize recursive plunges. 149 153 // 150 154 // kRegExpOpen,kRegExpClose ...are numbered at compile time. 151 //152 155 // 153 156 // 157 // 154 158 // A node is one char of opcode followed by two chars of "next" pointer. 155 159 // "Next" pointers are stored as two 8-bit pieces, high order first. The 156 160 // value is a positive offset from the opcode of the node containing it. … … 172 176 kWorst = 0 // Worst case. 173 177 }; 174 178 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."179 static 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.") 191 195 }; 192 196 193 197 #ifdef DEBUG … … 376 380 { 377 381 if (fError >= REGEXP_UNMATCHED_PARENTHESIS 378 382 && fError <= REGEXP_CORRUPTED_OPCODE) 379 return kRegExpErrorStringArray[fError - B_ERRORS_END];383 return B_TRANSLATE_NOCOLLECT(kRegExpErrorStringArray[fError - B_ERRORS_END]); 380 384 381 385 return strerror(fError); 382 386 }