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)
|
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_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
|
||||||
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
|
||||||
fPrintersPrefletMessenger(parent)
|
fPrintersPrefletMessenger(parent)
|
||||||
|
@ -182,32 +182,32 @@ void
|
||||||
AddPrinterDialog::BuildGUI(int stage)
|
AddPrinterDialog::BuildGUI(int stage)
|
||||||
{
|
{
|
||||||
// add a "printer name" input field
|
// add a "printer name" input field
|
||||||
fName = new BTextControl("printer_name", TR("Printer name:"), B_EMPTY_STRING,
|
fName = new BTextControl("printer_name", B_TRANSLATE("Printer name:"),
|
||||||
NULL);
|
B_EMPTY_STRING, NULL);
|
||||||
fName->SetFont(be_bold_font);
|
fName->SetFont(be_bold_font);
|
||||||
fName->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
fName->SetAlignment(B_ALIGN_RIGHT, B_ALIGN_LEFT);
|
||||||
fName->SetModificationMessage(new BMessage(kNameChangedMsg));
|
fName->SetModificationMessage(new BMessage(kNameChangedMsg));
|
||||||
|
|
||||||
// add a "driver" popup menu field
|
// 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",
|
BMenuField *printerMenuField = new BMenuField("drivers_list",
|
||||||
TR("Printer type:"), fPrinter);
|
B_TRANSLATE("Printer type:"), fPrinter);
|
||||||
printerMenuField->SetAlignment(B_ALIGN_RIGHT);
|
printerMenuField->SetAlignment(B_ALIGN_RIGHT);
|
||||||
FillMenu(fPrinter, "Print", kPrinterSelectedMsg);
|
FillMenu(fPrinter, "Print", kPrinterSelectedMsg);
|
||||||
|
|
||||||
// add a "connected to" (aka transports list) menu field
|
// 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",
|
BMenuField *transportMenuField = new BMenuField("transports_list",
|
||||||
TR("Connected to:"), fTransport);
|
B_TRANSLATE("Connected to:"), fTransport);
|
||||||
transportMenuField->SetAlignment(B_ALIGN_RIGHT);
|
transportMenuField->SetAlignment(B_ALIGN_RIGHT);
|
||||||
FillTransportMenu(fTransport);
|
FillTransportMenu(fTransport);
|
||||||
|
|
||||||
// add a "OK" button
|
// 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);
|
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
||||||
|
|
||||||
// add a "Cancel button
|
// 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());
|
SetLayout(new BGridLayout());
|
||||||
|
|
||||||
|
|
|
@ -223,41 +223,41 @@ JobItem::Update()
|
||||||
B_INT32_TYPE, 0, &pages, sizeof(pages)) == sizeof(pages)) {
|
B_INT32_TYPE, 0, &pages, sizeof(pages)) == sizeof(pages)) {
|
||||||
fPages << pages;
|
fPages << pages;
|
||||||
if (pages > 1)
|
if (pages > 1)
|
||||||
fPages << " " << TR("pages") << ".";
|
fPages << " " << B_TRANSLATE("pages") << ".";
|
||||||
else
|
else
|
||||||
fPages << " " << TR("page") << ".";
|
fPages << " " << B_TRANSLATE("page") << ".";
|
||||||
} else {
|
} else {
|
||||||
fPages << "??? " << TR("pages") << ".";
|
fPages << "??? " << B_TRANSLATE("pages") << ".";
|
||||||
}
|
}
|
||||||
|
|
||||||
fSize = "";
|
fSize = "";
|
||||||
off_t size;
|
off_t size;
|
||||||
if (node.GetSize(&size) == B_OK) {
|
if (node.GetSize(&size) == B_OK) {
|
||||||
char buffer[80];
|
char buffer[80];
|
||||||
sprintf(buffer, TR("%.2f KB"), size / 1024.0);
|
sprintf(buffer, B_TRANSLATE("%.2f KB"), size / 1024.0);
|
||||||
fSize = buffer;
|
fSize = buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
fStatus = "";
|
fStatus = "";
|
||||||
switch (fJob->Status()) {
|
switch (fJob->Status()) {
|
||||||
case kWaiting:
|
case kWaiting:
|
||||||
fStatus = TR("Waiting");
|
fStatus = B_TRANSLATE("Waiting");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kProcessing:
|
case kProcessing:
|
||||||
fStatus = TR("Processing");
|
fStatus = B_TRANSLATE("Processing");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kFailed:
|
case kFailed:
|
||||||
fStatus = TR("Failed");
|
fStatus = B_TRANSLATE("Failed");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case kCompleted:
|
case kCompleted:
|
||||||
fStatus = TR("Completed");
|
fStatus = B_TRANSLATE("Completed");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
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 driverPt(iconPt + BPoint(x, fntheight * 2.0));
|
||||||
BPoint defaultPt(iconPt + BPoint(x, fntheight * 3.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 pendingPt(bounds.right - width - 8.0, namePt.y);
|
||||||
BPoint transportPt(bounds.right - width - 8.0, driverPt.y);
|
BPoint transportPt(bounds.right - width - 8.0, driverPt.y);
|
||||||
BPoint commentPt(bounds.right - width - 8.0, defaultPt.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())
|
if (sSelectedIcon && sSelectedIcon->IsValid())
|
||||||
owner->DrawBitmap(sSelectedIcon, iconPt);
|
owner->DrawBitmap(sSelectedIcon, iconPt);
|
||||||
else
|
else
|
||||||
owner->DrawString(TR("Default Printer"), defaultPt);
|
owner->DrawString(B_TRANSLATE("Default Printer"), defaultPt);
|
||||||
} else {
|
} else {
|
||||||
if (sIcon && sIcon->IsValid())
|
if (sIcon && sIcon->IsValid())
|
||||||
owner->DrawBitmap(sIcon, iconPt);
|
owner->DrawBitmap(sIcon, iconPt);
|
||||||
|
@ -459,12 +459,12 @@ PrinterItem::UpdatePendingJobs()
|
||||||
if (fFolder) {
|
if (fFolder) {
|
||||||
uint32 pendingJobs = fFolder->CountJobs();
|
uint32 pendingJobs = fFolder->CountJobs();
|
||||||
if (pendingJobs == 1) {
|
if (pendingJobs == 1) {
|
||||||
fPendingJobs = TR("1 pending job.");
|
fPendingJobs = B_TRANSLATE("1 pending job.");
|
||||||
return;
|
return;
|
||||||
} else if (pendingJobs > 1) {
|
} else if (pendingJobs > 1) {
|
||||||
fPendingJobs << pendingJobs << TR(" pending jobs.");
|
fPendingJobs << pendingJobs << B_TRANSLATE(" pending jobs.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fPendingJobs = TR("No pending jobs.");
|
fPendingJobs = B_TRANSLATE("No pending jobs.");
|
||||||
}
|
}
|
||||||
|
|
|
@ -52,7 +52,8 @@
|
||||||
|
|
||||||
PrintersWindow::PrintersWindow(BRect frame)
|
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),
|
fSelectedPrinter(NULL),
|
||||||
fAddingPrinter(false)
|
fAddingPrinter(false)
|
||||||
{
|
{
|
||||||
|
@ -82,14 +83,16 @@ PrintersWindow::MessageReceived(BMessage* msg)
|
||||||
fSelectedPrinter = fPrinterListView->SelectedItem();
|
fSelectedPrinter = fPrinterListView->SelectedItem();
|
||||||
if (fSelectedPrinter)
|
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);
|
fMakeDefault->SetEnabled(true);
|
||||||
fRemove->SetEnabled(true);
|
fRemove->SetEnabled(true);
|
||||||
fJobListView->SetSpoolFolder(fSelectedPrinter->Folder());
|
fJobListView->SetSpoolFolder(fSelectedPrinter->Folder());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fJobsBox->SetLabel(TR("Print jobs: No printer selected"));
|
fJobsBox->SetLabel(
|
||||||
|
B_TRANSLATE("Print jobs: No printer selected"));
|
||||||
fMakeDefault->SetEnabled(false);
|
fMakeDefault->SetEnabled(false);
|
||||||
fRemove->SetEnabled(false);
|
fRemove->SetEnabled(false);
|
||||||
fSelectedPrinter = NULL;
|
fSelectedPrinter = NULL;
|
||||||
|
@ -183,21 +186,23 @@ PrintersWindow::BuildGUI()
|
||||||
BBox* printersBox = new BBox(BRect(boxInset, boxInset, r.Width()-boxInset, (r.Height()/2) - (boxInset/2)),
|
BBox* printersBox = new BBox(BRect(boxInset, boxInset, r.Width()-boxInset, (r.Height()/2) - (boxInset/2)),
|
||||||
"printersBox", B_FOLLOW_ALL);
|
"printersBox", B_FOLLOW_ALL);
|
||||||
printersBox->SetFont(be_bold_font);
|
printersBox->SetFont(be_bold_font);
|
||||||
printersBox->SetLabel(TR("Printers"));
|
printersBox->SetLabel(B_TRANSLATE("Printers"));
|
||||||
backdrop->AddChild(printersBox);
|
backdrop->AddChild(printersBox);
|
||||||
|
|
||||||
// Width of largest button
|
// Width of largest button
|
||||||
float maxWidth = 0;
|
float maxWidth = 0;
|
||||||
|
|
||||||
// Add Button
|
// 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);
|
printersBox->AddChild(addButton);
|
||||||
addButton->ResizeToPreferred();
|
addButton->ResizeToPreferred();
|
||||||
|
|
||||||
maxWidth = addButton->Bounds().Width();
|
maxWidth = addButton->Bounds().Width();
|
||||||
|
|
||||||
// Remove button
|
// 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);
|
printersBox->AddChild(fRemove);
|
||||||
fRemove->ResizeToPreferred();
|
fRemove->ResizeToPreferred();
|
||||||
|
|
||||||
|
@ -205,7 +210,8 @@ PrintersWindow::BuildGUI()
|
||||||
maxWidth = fRemove->Bounds().Width();
|
maxWidth = fRemove->Bounds().Width();
|
||||||
|
|
||||||
// Make Default button
|
// 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);
|
printersBox->AddChild(fMakeDefault);
|
||||||
fMakeDefault->ResizeToPreferred();
|
fMakeDefault->ResizeToPreferred();
|
||||||
|
|
||||||
|
@ -241,11 +247,13 @@ PrintersWindow::BuildGUI()
|
||||||
fJobsBox = new BBox(BRect(boxInset, (r.Height()/2)+(boxInset/2), Bounds().Width()-10, Bounds().Height() - boxInset),
|
fJobsBox = new BBox(BRect(boxInset, (r.Height()/2)+(boxInset/2), Bounds().Width()-10, Bounds().Height() - boxInset),
|
||||||
"jobsBox", B_FOLLOW_LEFT_RIGHT+B_FOLLOW_BOTTOM);
|
"jobsBox", B_FOLLOW_LEFT_RIGHT+B_FOLLOW_BOTTOM);
|
||||||
fJobsBox->SetFont(be_bold_font);
|
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);
|
backdrop->AddChild(fJobsBox);
|
||||||
|
|
||||||
// Cancel Job Button
|
// 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);
|
fJobsBox->AddChild(cancelButton);
|
||||||
cancelButton->ResizeToPreferred();
|
cancelButton->ResizeToPreferred();
|
||||||
fCancel = cancelButton;
|
fCancel = cancelButton;
|
||||||
|
@ -253,7 +261,9 @@ PrintersWindow::BuildGUI()
|
||||||
maxWidth = cancelButton->Bounds().Width();
|
maxWidth = cancelButton->Bounds().Width();
|
||||||
|
|
||||||
// Restart Job button
|
// 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);
|
fJobsBox->AddChild(restartButton);
|
||||||
restartButton->ResizeToPreferred();
|
restartButton->ResizeToPreferred();
|
||||||
fRestart = restartButton;
|
fRestart = restartButton;
|
||||||
|
|
Loading…
Reference in New Issue