Localized Printers preferences application.

Added German translation. Feel free to improve it.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@35631 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Michael Pfeiffer 2010-02-27 13:24:26 +00:00
parent 84df7867f8
commit 8c468cb466
9 changed files with 105 additions and 34 deletions

View File

@ -0,0 +1,28 @@
1 german application/x-vnd.Be-PRNT 403433619
Add printer AddPrinterDialog Drucker anlegen
Printer name: AddPrinterDialog Druckername:
<pick one> AddPrinterDialog <auswählen>
Printer type: AddPrinterDialog Druckertyp:
Connected to: AddPrinterDialog Verbunden mit:
Add AddPrinterDialog Hinzufügen
Cancel AddPrinterDialog Abbrechen
page JobListView Seite
pages JobListView Seiten
%.2f KB JobListView %.2f KB
Waiting JobListView Warten
Processing JobListView In Bearbeitung
Failed JobListView Fehlgeschlagen
Completed JobListView Abgeschlossen
Unknown status JobListView Unbekannter Zustand
Default Printer PrinterListView Standard Drucker
No pending jobs. PrinterListView Keine ausstehenden Aufträge.
1 pending job. PrinterListView Ein ausstehender Auftrag.
pending jobs. PrinterListView ausstehende Aufträge.
Printers PrintersWindow Drucker
Print jobs for PrintersWindow Druckaufträge für
Print jobs: No printer selected PrintersWindow Druckaufträge: Kein Drucker ausgewählt
Add … PrintersWindow Hinzufügen …
Remove PrintersWindow Entfernen
Make default PrintersWindow Als Standard
Cancel job PrintersWindow Auftrag abbrechen
Restart job PrintersWindow Auftrag neustarten

View File

@ -16,6 +16,7 @@
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <TextControl.h>
#include <MenuField.h>
#include <MenuItem.h>
@ -33,9 +34,14 @@
#include <stdio.h>
#undef TR_CONTEXT
#define TR_CONTEXT "AddPrinterDialog"
AddPrinterDialog::AddPrinterDialog(BWindow *parent)
:
Inherited(BRect(78.0, 71.0, 400, 300), "Add printer",
Inherited(BRect(78.0, 71.0, 400, 300), TR("Add printer"),
B_TITLED_WINDOW_LOOK, B_MODAL_APP_WINDOW_FEEL,
B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS),
fPrintersPrefletMessenger(parent)
@ -171,32 +177,32 @@ void
AddPrinterDialog::BuildGUI(int stage)
{
// add a "printer name" input field
fName = new BTextControl("printer_name", "Printer name:", B_EMPTY_STRING,
fName = new BTextControl("printer_name", TR("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("<pick one>");
fPrinter = new BPopUpMenu(TR("<pick one>"));
BMenuField *printerMenuField = new BMenuField("drivers_list",
"Printer type:", fPrinter);
TR("Printer type:"), fPrinter);
printerMenuField->SetAlignment(B_ALIGN_RIGHT);
FillMenu(fPrinter, "Print", kPrinterSelectedMsg);
// add a "connected to" (aka transports list) menu field
fTransport = new BPopUpMenu("<pick one>");
fTransport = new BPopUpMenu(TR("<pick one>"));
BMenuField *transportMenuField = new BMenuField("transports_list",
"Connected to:", fTransport);
TR("Connected to:"), fTransport);
transportMenuField->SetAlignment(B_ALIGN_RIGHT);
FillTransportMenu(fTransport);
// add a "OK" button
fOk = new BButton(NULL, "Add", new BMessage((uint32)B_OK),
fOk = new BButton(NULL, TR("Add"), new BMessage((uint32)B_OK),
B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
// add a "Cancel button
BButton *cancel = new BButton(NULL, "Cancel", new BMessage(B_CANCEL));
BButton *cancel = new BButton(NULL, TR("Cancel"), new BMessage(B_CANCEL));
SetLayout(new BGridLayout());

View File

@ -15,6 +15,21 @@ Preference Printers :
translation
libprintutils.a
$(TARGET_LIBSUPC++)
liblocale.so
:
Printers.rdef
;
DoCatalogs Printers :
x-vnd.Be-PRNT
:
AddPrinterDialog.cpp
JobListView.cpp
PrinterListView.cpp
PrintersWindow.cpp
:
en.catalog
:
de.catkeys
;

View File

@ -38,11 +38,16 @@
#include <Alert.h>
#include <Bitmap.h>
#include <Catalog.h>
#include <Messenger.h>
#include <Mime.h>
#include <Roster.h>
#undef TR_CONTEXT
#define TR_CONTEXT "JobListView"
// #pragma mark -- JobListView
@ -218,41 +223,41 @@ JobItem::Update()
B_INT32_TYPE, 0, &pages, sizeof(pages)) == sizeof(pages)) {
fPages << pages;
if (pages > 1)
fPages << " pages.";
fPages << " " << TR("pages") << ".";
else
fPages << " page.";
fPages << " " << TR("page") << ".";
} else {
fPages = "??? pages.";
fPages << "??? " << TR("pages") << ".";
}
fSize = "";
off_t size;
if (node.GetSize(&size) == B_OK) {
char buffer[80];
sprintf(buffer, "%.2f KB", size / 1024.0);
sprintf(buffer, TR("%.2f KB"), size / 1024.0);
fSize = buffer;
}
fStatus = "";
switch (fJob->Status()) {
case kWaiting:
fStatus = "Waiting";
fStatus = TR("Waiting");
break;
case kProcessing:
fStatus = "Processing";
fStatus = TR("Processing");
break;
case kFailed:
fStatus = "Failed";
fStatus = TR("Failed");
break;
case kCompleted:
fStatus = "Completed";
fStatus = TR("Completed");
break;
default:
fStatus = "Unkown status";
fStatus = TR("Unknown status");
}
}

View File

@ -36,12 +36,17 @@
#include <Messenger.h>
#include <Bitmap.h>
#include <Catalog.h>
#include <String.h>
#include <Alert.h>
#include <Mime.h>
#include <StorageKit.h>
#undef TR_CONTEXT
#define TR_CONTEXT "PrinterListView"
// #pragma mark -- PrinterListView
@ -372,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("No pending jobs.");
float width = owner->StringWidth(TR("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);
@ -388,7 +393,7 @@ void PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
if (sSelectedIcon && sSelectedIcon->IsValid())
owner->DrawBitmap(sSelectedIcon, iconPt);
else
owner->DrawString("Default Printer", defaultPt);
owner->DrawString(TR("Default Printer"), defaultPt);
} else {
if (sIcon && sIcon->IsValid())
owner->DrawBitmap(sIcon, iconPt);
@ -401,7 +406,7 @@ void PrinterItem::DrawItem(BView *owner, BRect /*bounds*/, bool complete)
owner->DrawString(fDriverName.String(), fDriverName.Length(), driverPt);
// right of item
owner->DrawString(fPendingJobs.String(), 16, pendingPt);
owner->DrawString(fPendingJobs.String(), fPendingJobs.Length(), pendingPt);
owner->DrawString(fTransport.String(), fTransport.Length(), transportPt);
owner->DrawString(fComments.String(), fComments.Length(), commentPt);
@ -444,12 +449,12 @@ PrinterItem::UpdatePendingJobs()
if (fFolder) {
uint32 pendingJobs = fFolder->CountJobs();
if (pendingJobs == 1) {
fPendingJobs = "1 pending job.";
fPendingJobs = TR("1 pending job.");
return;
} else if (pendingJobs > 1) {
fPendingJobs << pendingJobs << " pending jobs.";
fPendingJobs << pendingJobs << TR(" pending jobs.");
return;
}
}
fPendingJobs = "No pending jobs.";
fPendingJobs = TR("No pending jobs.");
}

View File

@ -32,6 +32,8 @@
#include "Messages.h"
#include "PrintersWindow.h"
#include <Locale.h>
int main()
{
PrintersApp app;
@ -42,6 +44,7 @@ int main()
PrintersApp::PrintersApp()
: Inherited(PRINTERS_SIGNATURE)
{
be_locale->GetAppCatalog(&fCatalog);
}
void PrintersApp::ReadyToRun()

View File

@ -32,6 +32,7 @@
class PrintersApp;
#include <Application.h>
#include <Catalog.h>
#define PRINTERS_SIGNATURE "application/x-vnd.Be-PRNT"
@ -42,6 +43,9 @@ public:
PrintersApp();
void ReadyToRun();
void MessageReceived(BMessage* msg);
private:
BCatalog fCatalog;
};
#endif

View File

@ -15,7 +15,7 @@ resource app_version {
internal = 0,
short_info = "Printers",
long_info = "Printers ©2001-2009 Haiku"
long_info = "Printers ©2001-2010 Haiku"
};
resource vector_icon {

View File

@ -39,15 +39,20 @@
// BeOS API
#include <Box.h>
#include <Button.h>
#include <Catalog.h>
#include <ListView.h>
#include <ScrollView.h>
#include <Application.h>
#include <FindDirectory.h>
#undef TR_CONTEXT
#define TR_CONTEXT "PrintersWindow"
PrintersWindow::PrintersWindow(BRect frame)
:
Inherited(BRect(78.0, 71.0, 561.0, 409.0), "Printers", B_TITLED_WINDOW, 0),
Inherited(BRect(78.0, 71.0, 561.0, 409.0), TR("Printers"), B_TITLED_WINDOW, 0),
fSelectedPrinter(NULL),
fAddingPrinter(false)
{
@ -77,14 +82,14 @@ PrintersWindow::MessageReceived(BMessage* msg)
fSelectedPrinter = fPrinterListView->SelectedItem();
if (fSelectedPrinter)
{
fJobsBox->SetLabel((BString("Print jobs for ") << fSelectedPrinter->Name()).String());
fJobsBox->SetLabel((BString(TR("Print jobs for ")) << fSelectedPrinter->Name()).String());
fMakeDefault->SetEnabled(true);
fRemove->SetEnabled(true);
fJobListView->SetSpoolFolder(fSelectedPrinter->Folder());
}
else
{
fJobsBox->SetLabel("Print jobs: No printer selected");
fJobsBox->SetLabel(TR("Print jobs: No printer selected"));
fMakeDefault->SetEnabled(false);
fRemove->SetEnabled(false);
fSelectedPrinter = NULL;
@ -178,21 +183,21 @@ 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("Printers:");
printersBox->SetLabel(TR("Printers"));
backdrop->AddChild(printersBox);
// Width of largest button
float maxWidth = 0;
// Add Button
BButton* addButton = new BButton(BRect(5,5,5,5), "add", "Add " B_UTF8_ELLIPSIS, new BMessage(kMsgAddPrinter), B_FOLLOW_RIGHT);
BButton* addButton = new BButton(BRect(5,5,5,5), "add", TR("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", "Remove", new BMessage(kMsgRemovePrinter), B_FOLLOW_RIGHT);
fRemove = new BButton(BRect(5,30,5,30), "remove", TR("Remove"), new BMessage(kMsgRemovePrinter), B_FOLLOW_RIGHT);
printersBox->AddChild(fRemove);
fRemove->ResizeToPreferred();
@ -200,7 +205,7 @@ PrintersWindow::BuildGUI()
maxWidth = fRemove->Bounds().Width();
// Make Default button
fMakeDefault = new BButton(BRect(5,60,5,60), "default", "Make default", new BMessage(kMsgMakeDefaultPrinter), B_FOLLOW_RIGHT);
fMakeDefault = new BButton(BRect(5,60,5,60), "default", TR("Make default"), new BMessage(kMsgMakeDefaultPrinter), B_FOLLOW_RIGHT);
printersBox->AddChild(fMakeDefault);
fMakeDefault->ResizeToPreferred();
@ -236,11 +241,11 @@ 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("Print Jobs: No printer selected");
fJobsBox->SetLabel(TR("Print jobs: No printer selected"));
backdrop->AddChild(fJobsBox);
// Cancel Job Button
BButton* cancelButton = new BButton(BRect(5,5,5,5), "cancel", "Cancel job", new BMessage(kMsgCancelJob), B_FOLLOW_RIGHT+B_FOLLOW_TOP);
BButton* cancelButton = new BButton(BRect(5,5,5,5), "cancel", TR("Cancel job"), new BMessage(kMsgCancelJob), B_FOLLOW_RIGHT+B_FOLLOW_TOP);
fJobsBox->AddChild(cancelButton);
cancelButton->ResizeToPreferred();
fCancel = cancelButton;
@ -248,7 +253,7 @@ PrintersWindow::BuildGUI()
maxWidth = cancelButton->Bounds().Width();
// Restart Job button
BButton* restartButton = new BButton(BRect(5,30,5,30), "restart", "Restart job", new BMessage(kMsgRestartJob), B_FOLLOW_RIGHT+B_FOLLOW_TOP);
BButton* restartButton = new BButton(BRect(5,30,5,30), "restart", TR("Restart job"), new BMessage(kMsgRestartJob), B_FOLLOW_RIGHT+B_FOLLOW_TOP);
fJobsBox->AddChild(restartButton);
restartButton->ResizeToPreferred();
fRestart = restartButton;