Updated to use B_TRANSLATE* macros. relates to #5408.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36694 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
f7ff55f1d4
commit
cd59396f27
@ -41,7 +41,7 @@
|
||||
|
||||
AddPrinterDialog::AddPrinterDialog(BWindow *parent)
|
||||
:
|
||||
Inherited(BRect(78.0, 71.0, 400, 300), TR("Add printer"),
|
||||
Inherited(BRect(78.0, 71.0, 400, 300), B_TRANSLATE("Add printer"),
|
||||
B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
|
||||
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||
fPrintersPrefletMessenger(parent)
|
||||
@ -182,32 +182,32 @@ void
|
||||
AddPrinterDialog::BuildGUI(int stage)
|
||||
{
|
||||
// add a "printer name" input field
|
||||
fName = new BTextControl("printer_name", TR("Printer name:"), B_EMPTY_STRING,
|
||||
NULL);
|
||||
fName = new BTextControl("printer_name", B_TRANSLATE("Printer name:"),
|
||||
B_EMPTY_STRING, NULL);
|
||||
fName->SetFont(be_bold_font);
|
||||
fName->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
||||
fName->SetModificationMessage(new BMessage(kNameChangedMsg));
|
||||
|
||||
// add a "driver" popup menu field
|
||||
fPrinter = new BPopUpMenu(TR("<pick one>"));
|
||||
fPrinter = new BPopUpMenu(B_TRANSLATE("<pick one>"));
|
||||
BMenuField *printerMenuField = new BMenuField("drivers_list",
|
||||
TR("Printer type:"), fPrinter);
|
||||
B_TRANSLATE("Printer type:"), fPrinter);
|
||||
printerMenuField->SetAlignment(B_ALIGN_RIGHT);
|
||||
FillMenu(fPrinter, "Print", kPrinterSelectedMsg);
|
||||
|
||||
// add a "connected to" (aka transports list) menu field
|
||||
fTransport = new BPopUpMenu(TR("<pick one>"));
|
||||
fTransport = new BPopUpMenu(B_TRANSLATE("<pick one>"));
|
||||
BMenuField *transportMenuField = new BMenuField("transports_list",
|
||||
TR("Connected to:"), fTransport);
|
||||
B_TRANSLATE("Connected to:"), fTransport);
|
||||
transportMenuField->SetAlignment(B_ALIGN_RIGHT);
|
||||
FillTransportMenu(fTransport);
|
||||
|
||||
// add a "OK" button
|
||||
fOk = new BButton(NULL, TR("Add"), new BMessage((uint32)B_OK),
|
||||
fOk = new BButton(NULL, B_TRANSLATE("Add"), new BMessage((uint32)B_OK),
|
||||
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||
|
||||
// add a "Cancel button
|
||||
BButton *cancel = new BButton(NULL, TR("Cancel"), new BMessage(B_CANCEL));
|
||||
BButton *cancel = new BButton(NULL, B_TRANSLATE("Cancel"), new BMessage(B_CANCEL));
|
||||
|
||||
SetLayout(new BGridLayout());
|
||||
|
||||
|
@ -223,41 +223,41 @@ JobItem::Update()
|
||||
B_INT32_TYPE, 0, &pages, sizeof(pages)) == sizeof(pages)) {
|
||||
fPages << pages;
|
||||
if (pages > 1)
|
||||
fPages << " " << TR("pages") << ".";
|
||||
fPages << " " << B_TRANSLATE("pages") << ".";
|
||||
else
|
||||
fPages << " " << TR("page") << ".";
|
||||
fPages << " " << B_TRANSLATE("page") << ".";
|
||||
} else {
|
||||
fPages << "??? " << TR("pages") << ".";
|
||||
fPages << "??? " << B_TRANSLATE("pages") << ".";
|
||||
}
|
||||
|
||||
fSize = "";
|
||||
off_t size;
|
||||
if (node.GetSize(&size) == B_OK) {
|
||||
char buffer[80];
|
||||
sprintf(buffer, TR("%.2f KB"), size / 1024.0);
|
||||
sprintf(buffer, B_TRANSLATE("%.2f KB"), size / 1024.0);
|
||||
fSize = buffer;
|
||||
}
|
||||
|
||||
fStatus = "";
|
||||
switch (fJob->Status()) {
|
||||
case kWaiting:
|
||||
fStatus = TR("Waiting");
|
||||
fStatus = B_TRANSLATE("Waiting");
|
||||
break;
|
||||
|
||||
case kProcessing:
|
||||
fStatus = TR("Processing");
|
||||
fStatus = B_TRANSLATE("Processing");
|
||||
break;
|
||||
|
||||
case kFailed:
|
||||
fStatus = TR("Failed");
|
||||
fStatus = B_TRANSLATE("Failed");
|
||||
break;
|
||||
|
||||
case kCompleted:
|
||||
fStatus = TR("Completed");
|
||||
fStatus = B_TRANSLATE("Completed");
|
||||
break;
|
||||
|
||||
default:
|
||||
fStatus = TR("Unknown status");
|
||||
fStatus = B_TRANSLATE("Unknown status");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -377,7 +377,7 @@ void PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
|
||||
BPoint driverPt(iconPt + BPoint(x, fntheight * 2.0));
|
||||
BPoint defaultPt(iconPt + BPoint(x, fntheight * 3.0));
|
||||
|
||||
float width = owner->StringWidth(TR("No pending jobs."));
|
||||
float width = owner->StringWidth(B_TRANSLATE("No pending jobs."));
|
||||
BPoint pendingPt(bounds.right - width - 8.0, namePt.y);
|
||||
BPoint transportPt(bounds.right - width - 8.0, driverPt.y);
|
||||
BPoint commentPt(bounds.right - width - 8.0, defaultPt.y);
|
||||
@ -393,7 +393,7 @@ void PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
|
||||
if (sSelectedIcon && sSelectedIcon->IsValid())
|
||||
owner->DrawBitmap(sSelectedIcon, iconPt);
|
||||
else
|
||||
owner->DrawString(TR("Default Printer"), defaultPt);
|
||||
owner->DrawString(B_TRANSLATE("Default Printer"), defaultPt);
|
||||
} else {
|
||||
if (sIcon && sIcon->IsValid())
|
||||
owner->DrawBitmap(sIcon, iconPt);
|
||||
@ -459,12 +459,12 @@ PrinterItem::UpdatePendingJobs()
|
||||
if (fFolder) {
|
||||
uint32 pendingJobs = fFolder->CountJobs();
|
||||
if (pendingJobs == 1) {
|
||||
fPendingJobs = TR("1 pending job.");
|
||||
fPendingJobs = B_TRANSLATE("1 pending job.");
|
||||
return;
|
||||
} else if (pendingJobs > 1) {
|
||||
fPendingJobs << pendingJobs << TR(" pending jobs.");
|
||||
fPendingJobs << pendingJobs << B_TRANSLATE(" pending jobs.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
fPendingJobs = TR("No pending jobs.");
|
||||
fPendingJobs = B_TRANSLATE("No pending jobs.");
|
||||
}
|
||||
|
@ -52,7 +52,8 @@
|
||||
|
||||
PrintersWindow::PrintersWindow(BRect frame)
|
||||
:
|
||||
Inherited(BRect(78.0, 71.0, 561.0, 409.0), TR("Printers"), B_TITLED_WINDOW, 0),
|
||||
Inherited(BRect(78.0, 71.0, 561.0, 409.0), B_TRANSLATE("Printers"),
|
||||
B_TITLED_WINDOW, 0),
|
||||
fSelectedPrinter(NULL),
|
||||
fAddingPrinter(false)
|
||||
{
|
||||
@ -82,14 +83,16 @@ PrintersWindow::MessageReceived(BMessage* msg)
|
||||
fSelectedPrinter = fPrinterListView->SelectedItem();
|
||||
if (fSelectedPrinter)
|
||||
{
|
||||
fJobsBox->SetLabel((BString(TR("Print jobs for ")) << fSelectedPrinter->Name()).String());
|
||||
fJobsBox->SetLabel((BString(B_TRANSLATE("Print jobs for ")) <<
|
||||
fSelectedPrinter->Name()).String());
|
||||
fMakeDefault->SetEnabled(true);
|
||||
fRemove->SetEnabled(true);
|
||||
fJobListView->SetSpoolFolder(fSelectedPrinter->Folder());
|
||||
}
|
||||
else
|
||||
{
|
||||
fJobsBox->SetLabel(TR("Print jobs: No printer selected"));
|
||||
fJobsBox->SetLabel(
|
||||
B_TRANSLATE("Print jobs: No printer selected"));
|
||||
fMakeDefault->SetEnabled(false);
|
||||
fRemove->SetEnabled(false);
|
||||
fSelectedPrinter = NULL;
|
||||
@ -183,21 +186,23 @@ PrintersWindow::BuildGUI()
|
||||
BBox* printersBox = new BBox(BRect(boxInset, boxInset, r.Width()-boxInset, (r.Height()/2) - (boxInset/2)),
|
||||
"printersBox", B_FOLLOW_ALL);
|
||||
printersBox->SetFont(be_bold_font);
|
||||
printersBox->SetLabel(TR("Printers"));
|
||||
printersBox->SetLabel(B_TRANSLATE("Printers"));
|
||||
backdrop->AddChild(printersBox);
|
||||
|
||||
// Width of largest button
|
||||
float maxWidth = 0;
|
||||
|
||||
// Add Button
|
||||
BButton* addButton = new BButton(BRect(5,5,5,5), "add", TR("Add …"), new BMessage(kMsgAddPrinter), B_FOLLOW_RIGHT);
|
||||
BButton* addButton = new BButton(BRect(5,5,5,5), "add",
|
||||
B_TRANSLATE("Add …"), new BMessage(kMsgAddPrinter), B_FOLLOW_RIGHT);
|
||||
printersBox->AddChild(addButton);
|
||||
addButton->ResizeToPreferred();
|
||||
|
||||
maxWidth = addButton->Bounds().Width();
|
||||
|
||||
// Remove button
|
||||
fRemove = new BButton(BRect(5,30,5,30), "remove", TR("Remove"), new BMessage(kMsgRemovePrinter), B_FOLLOW_RIGHT);
|
||||
fRemove = new BButton(BRect(5,30,5,30), "remove",
|
||||
B_TRANSLATE("Remove"), new BMessage(kMsgRemovePrinter), B_FOLLOW_RIGHT);
|
||||
printersBox->AddChild(fRemove);
|
||||
fRemove->ResizeToPreferred();
|
||||
|
||||
@ -205,7 +210,8 @@ PrintersWindow::BuildGUI()
|
||||
maxWidth = fRemove->Bounds().Width();
|
||||
|
||||
// Make Default button
|
||||
fMakeDefault = new BButton(BRect(5,60,5,60), "default", TR("Make default"), new BMessage(kMsgMakeDefaultPrinter), B_FOLLOW_RIGHT);
|
||||
fMakeDefault = new BButton(BRect(5,60,5,60), "default",
|
||||
B_TRANSLATE("Make default"), new BMessage(kMsgMakeDefaultPrinter), B_FOLLOW_RIGHT);
|
||||
printersBox->AddChild(fMakeDefault);
|
||||
fMakeDefault->ResizeToPreferred();
|
||||
|
||||
@ -241,11 +247,13 @@ PrintersWindow::BuildGUI()
|
||||
fJobsBox = new BBox(BRect(boxInset, (r.Height()/2)+(boxInset/2), Bounds().Width()-10, Bounds().Height() - boxInset),
|
||||
"jobsBox", B_FOLLOW_LEFT_RIGHT+B_FOLLOW_BOTTOM);
|
||||
fJobsBox->SetFont(be_bold_font);
|
||||
fJobsBox->SetLabel(TR("Print jobs: No printer selected"));
|
||||
fJobsBox->SetLabel(B_TRANSLATE("Print jobs: No printer selected"));
|
||||
backdrop->AddChild(fJobsBox);
|
||||
|
||||
// Cancel Job Button
|
||||
BButton* cancelButton = new BButton(BRect(5,5,5,5), "cancel", TR("Cancel job"), new BMessage(kMsgCancelJob), B_FOLLOW_RIGHT+B_FOLLOW_TOP);
|
||||
BButton* cancelButton = new BButton(BRect(5,5,5,5), "cancel",
|
||||
B_TRANSLATE("Cancel job"), new BMessage(kMsgCancelJob),
|
||||
B_FOLLOW_RIGHT+B_FOLLOW_TOP);
|
||||
fJobsBox->AddChild(cancelButton);
|
||||
cancelButton->ResizeToPreferred();
|
||||
fCancel = cancelButton;
|
||||
@ -253,7 +261,9 @@ PrintersWindow::BuildGUI()
|
||||
maxWidth = cancelButton->Bounds().Width();
|
||||
|
||||
// Restart Job button
|
||||
BButton* restartButton = new BButton(BRect(5,30,5,30), "restart", TR("Restart job"), new BMessage(kMsgRestartJob), B_FOLLOW_RIGHT+B_FOLLOW_TOP);
|
||||
BButton* restartButton = new BButton(BRect(5,30,5,30), "restart",
|
||||
B_TRANSLATE("Restart job"), new BMessage(kMsgRestartJob),
|
||||
B_FOLLOW_RIGHT+B_FOLLOW_TOP);
|
||||
fJobsBox->AddChild(restartButton);
|
||||
restartButton->ResizeToPreferred();
|
||||
fRestart = restartButton;
|
||||
|
Loading…
Reference in New Issue
Block a user