diff --git a/src/preferences/printers/JobListView.cpp b/src/preferences/printers/JobListView.cpp index 1114799831..36908e6db5 100644 --- a/src/preferences/printers/JobListView.cpp +++ b/src/preferences/printers/JobListView.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include "pr_server.h" @@ -32,7 +33,7 @@ JobListView::JobListView(BRect frame) - : + : Inherited(frame, "jobs_list", B_SINGLE_SELECTION_LIST, B_FOLLOW_ALL, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE | B_FULL_UPDATE_ON_RESIZE) { @@ -201,15 +202,18 @@ JobItem::Update() fPages = ""; int32 pages; + static BStringFormat format(B_TRANSLATE("{0, plural, " + "=-1{??? pages}" + "=1{# page}" + "other{# pages}}")); + if (node.ReadAttr(PSRV_SPOOL_ATTR_PAGECOUNT, B_INT32_TYPE, 0, &pages, sizeof(pages)) == sizeof(pages)) { - fPages << pages; - if (pages > 1) - fPages << " " << B_TRANSLATE("pages") << "."; - else - fPages << " " << B_TRANSLATE("page") << "."; + format.Format(fPages, pages); } else { - fPages << "??? " << B_TRANSLATE("pages") << "."; + // unknown page count, probably the printer is paginating without + // software help. + format.Format(fPages, -1); } fSize = ""; diff --git a/src/preferences/printers/PrintersWindow.cpp b/src/preferences/printers/PrintersWindow.cpp index 8f5c26b9d4..d5afdbad75 100644 --- a/src/preferences/printers/PrintersWindow.cpp +++ b/src/preferences/printers/PrintersWindow.cpp @@ -123,8 +123,10 @@ PrintersWindow::MessageReceived(BMessage* msg) { fSelectedPrinter = fPrinterListView->SelectedItem(); if (fSelectedPrinter) { - fJobsBox->SetLabel((BString(B_TRANSLATE("Print jobs for ")) - << fSelectedPrinter->Name()).String()); + BString text = B_TRANSLATE("Print jobs for %printer_name%"); + text.ReplaceFirst("%printer_name%", fSelectedPrinter->Name()); + + fJobsBox->SetLabel(text); fMakeDefault->SetEnabled(true); fRemove->SetEnabled(true); fJobListView->SetSpoolFolder(fSelectedPrinter->Folder()); diff --git a/src/preferences/printers/TestPageView.cpp b/src/preferences/printers/TestPageView.cpp index 8375640285..8369d9cb3d 100644 --- a/src/preferences/printers/TestPageView.cpp +++ b/src/preferences/printers/TestPageView.cpp @@ -281,8 +281,9 @@ TestPageView::AttachedToWindow() gradiants.View()->SetViewColor(B_TRANSPARENT_COLOR); for (int i = 0; i < kNumColorGradients; ++i) { - BStringView* label = new BStringView(kColorGradients[i].name, - kColorGradients[i].name); + BStringView* label = new BStringView( + kColorGradients[i].name, + B_TRANSLATE(kColorGradients[i].name)); // label->SetAlignment(B_ALIGN_RIGHT); gradiants.Add(label, 0, i); gradiants.Add(new ColorGradientView(kColorGradients[i].color), 1, i);