Ticket #6374: tracker.4.patch
File tracker.4.patch, 13.8 KB (added by , 14 years ago) |
---|
-
src/kits/tracker/InfoWindow.cpp
431 431 case kEditItem: 432 432 { 433 433 BEntry entry(fModel->EntryRef()); 434 if (ConfirmChangeIfWellKnownDirectory(&entry, "rename")) 434 if (ConfirmChangeIfWellKnownDirectory(&entry, 435 B_TRANSLATE("rename"))) 435 436 fAttributeView->BeginEditingTitle(); 436 437 break; 437 438 } … … 1220 1221 } else if (fTitleRect.Contains(point)) { 1221 1222 // You can't change the name of the trash 1222 1223 if (!fModel->IsTrash() 1223 && ConfirmChangeIfWellKnownDirectory(&entry, "rename", true) 1224 && ConfirmChangeIfWellKnownDirectory(&entry, 1225 B_TRANSLATE("rename"), true) 1224 1226 && fTitleEditView == 0) 1225 1227 BeginEditingTitle(); 1226 1228 } else if (fTitleEditView) { -
src/kits/tracker/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( 669 B_TRANSLATE("Could not find application \"%appname\"")); 670 errorString.ReplaceFirst("%appname", pose->TargetModel()->Name()); 670 671 671 672 (new BAlert("", errorString.String(), B_TRANSLATE("OK"), 0, 0, 672 673 B_WIDTH_AS_USUAL, B_WARNING_ALERT))->Go(); … … 675 676 676 677 if (OpenWithRelation(pose->TargetModel()) == kNoRelation) { 677 678 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 " 681 681 "about to open. Are you sure you want to proceed? If you know that " 682 682 "the application supports the document type, you should contact the " 683 683 "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()); 685 686 686 687 BAlert* alert = new BAlert("", warning.String(), 687 688 B_TRANSLATE("Cancel"), B_TRANSLATE("Open"), 0, B_WIDTH_AS_USUAL, … … 1437 1438 break; 1438 1439 1439 1440 if (preferredAppForFile && ref == *preferredAppForFile) { 1440 *description = "Preferred for file";1441 description->SetTo(B_TRANSLATE("Preferred for file")); 1441 1442 return; 1442 1443 } 1443 1444 … … 1452 1453 continue; 1453 1454 1454 1455 case kSuperhandler: 1455 *description = "Handles any file";1456 description->SetTo(B_TRANSLATE("Handles any file")); 1456 1457 return; 1457 1458 1458 1459 case kSupportsSupertype: … … 1467 1468 1468 1469 //PRINT(("getting supertype for %s, result %s, got %s\n", 1469 1470 // model.MimeType(), strerror(result), mimeType.Type())); 1470 *description = "Handles any ";1471 description->SetTo(B_TRANSLATE("Handles any %type")); 1471 1472 // *description += mimeType.Type(); 1472 *description += type;1473 description->ReplaceFirst("%type", type); 1473 1474 return; 1474 1475 } 1475 1476 … … 1479 1480 1480 1481 if (preferredApp && *applicationModel->EntryRef() == *preferredApp) 1481 1482 // application matches cached preferred app, we are done 1482 *description = "Preferred for ";1483 description->SetTo(B_TRANSLATE("Preferred for %type")); 1483 1484 else 1484 *description = "Handles ";1485 description->SetTo(B_TRANSLATE("Handles %type")); 1485 1486 1486 1487 char shortDescription[256]; 1487 1488 if (mimeType.GetShortDescription(shortDescription) == B_OK) 1488 *description += shortDescription;1489 description->ReplaceFirst("%type", shortDescription); 1489 1490 else 1490 *description += mimeType.Type();1491 description->ReplaceFirst("%type", mimeType.Type()); 1491 1492 return; 1492 1493 } 1493 1494 } 1494 1495 } 1495 1496 1496 *description = "Does not handle file";1497 description->SetTo(B_TRANSLATE("Does not handle file")); 1497 1498 } 1498 1499 1499 1500 -
src/kits/tracker/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 -
src/kits/tracker/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 = strlen(buffer); 1991 1992 uint32 pos = sprintf(buffer, 1993 B_TRANSLATE("\n\t(%Ld bytes, "), stat->st_size); 1993 1994 strftime(buffer + pos, length - pos,"%b %d %Y, %I:%M:%S %p)", &timeData); 1994 1995 } 1995 1996 -
src/kits/tracker/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( 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))); 694 695 tp.x = fStatusBar->Frame().right - StringWidth(buffer.String()); 695 696 if (tp.x > rightDivider) 696 697 DrawString(buffer.String(), tp); 697 698 else { 698 699 // 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))); 702 704 tp.x = fStatusBar->Frame().right 703 705 - StringWidth(buffer.String()); 704 706 if (tp.x > rightDivider) -
src/kits/tracker/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 -
src/kits/tracker/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"), 4267 !targetPose, dropPt) != B_OK) 4267 4268 return false; 4268 4269 4269 4270 // here is a file for the drag initiator, it is up to it now to stuff it … … 4415 4416 4416 4417 BFile file; 4417 4418 if (CreateClippingFile(poseView, file, name, &targetDirectory, message, 4418 "Untitled clipping", !targetPose, dropPt) != B_OK) 4419 B_TRANSLATE("Untitled clipping"), 4420 !targetPose, dropPt) != B_OK) 4419 4421 return false; 4420 4422 4421 4423 // write out the file … … 4468 4470 4469 4471 BFile file; 4470 4472 if (CreateClippingFile(poseView, file, name, &targetDirectory, message, 4471 "Untitled bitmap", !targetPose, dropPt) != B_OK)4473 B_TRANSLATE("Untitled bitmap"), !targetPose, dropPt) != B_OK) 4472 4474 return false; 4473 4475 4474 4476 int32 size = embeddedBitmap.FlattenedSize(); … … 4753 4755 if (srcWindow->TargetModel()->IsQuery() 4754 4756 && !forceCopy && !destIsTrash && !createLink) { 4755 4757 srcWindow->UpdateIfNeeded(); 4756 BAlert *alert = new BAlert("", 4758 BAlert *alert = new BAlert("", 4757 4759 B_TRANSLATE("Are you sure you want to move or copy the selected " 4758 4760 "item(s) to this folder?"), B_TRANSLATE("Cancel"), 4759 4761 B_TRANSLATE("Move"), NULL, B_WIDTH_AS_USUAL, B_WARNING_ALERT); … … 5957 5959 regExpression.SetTo(expression); 5958 5960 5959 5961 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()); 5963 5965 (new BAlert("", message.String(), B_TRANSLATE("OK"), NULL, NULL, 5964 5966 B_WIDTH_AS_USUAL, B_STOP_ALERT))->Go(); 5965 5967 return 0; -
src/kits/tracker/FindPanel.cpp
2803 2803 if (item != NULL) 2804 2804 result << item->Label(); 2805 2805 else 2806 result << "Name";2806 result << B_TRANSLATE("Name"); 2807 2807 2808 2808 if (item->Submenu() != NULL) 2809 2809 item = item->Submenu()->FindMarked(); -
src/kits/tracker/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: -
src/kits/tracker/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 … … 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( 384 kRegExpErrorStringArray[fError - B_ERRORS_END]); 380 385 381 386 return strerror(fError); 382 387 }