Printers preflet: changed localizations
* Fixed colour localization on test page * Changed JobListView to use plural placeholders * Changed PrintersWindow to use placeholders Change-Id: I39477351364a0182cf629476de767af18f9c0d61 Reviewed-on: https://review.haiku-os.org/524 Reviewed-by: Adrien Destugues <pulkomandy@pulkomandy.tk>
This commit is contained in:
parent
a98e02fcda
commit
a1c2394a81
@ -15,6 +15,7 @@
|
||||
#include <Locale.h>
|
||||
#include <MimeType.h>
|
||||
#include <Roster.h>
|
||||
#include <StringFormat.h>
|
||||
#include <Window.h>
|
||||
|
||||
#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 = "";
|
||||
|
@ -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());
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user