Ticket #6374: tracker.patch
File tracker.patch, 10.0 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 … … 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 -
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 -
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
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; -
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 }