* Applied slightly modifed patch from ticket #6089 by Karvjorm. Thank you.
- Added translation comment to paper sizes. - Localized scripting comments. - Improved localization of job info. - Localized parts of about dialog text. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36963 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -27,6 +27,7 @@
|
||||
// Haiku
|
||||
#include <Catalog.h>
|
||||
#include <Layout.h>
|
||||
#include <Locale.h>
|
||||
#include <GroupLayout.h>
|
||||
#include <GroupLayoutBuilder.h>
|
||||
|
||||
@@ -68,18 +69,30 @@ static struct PageFormat
|
||||
float height;
|
||||
} pageFormat[] =
|
||||
{
|
||||
{B_TRANSLATE_MARK("Letter"), letter_width, letter_height },
|
||||
{B_TRANSLATE_MARK("Legal"), legal_width, legal_height },
|
||||
{B_TRANSLATE_MARK("Ledger"), ledger_width, ledger_height },
|
||||
{B_TRANSLATE_MARK("Tabloid"), tabloid_width, tabloid_height },
|
||||
{B_TRANSLATE_MARK("A0"), a0_width, a0_height },
|
||||
{B_TRANSLATE_MARK("A1"), a1_width, a1_height },
|
||||
{B_TRANSLATE_MARK("A2"), a2_width, a2_height },
|
||||
{B_TRANSLATE_MARK("A3"), a3_width, a3_height },
|
||||
{B_TRANSLATE_MARK("A4"), a4_width, a4_height },
|
||||
{B_TRANSLATE_MARK("A5"), a5_width, a5_height },
|
||||
{B_TRANSLATE_MARK("A6"), a6_width, a6_height },
|
||||
{B_TRANSLATE_MARK("B5"), b5_width, b5_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("Letter", "ANSI A (letter), a North American "
|
||||
"paper size"), letter_width, letter_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("Legal", "A North American paper size (216 x 356"
|
||||
" mm, or 8.5 x 14 in)"), legal_width, legal_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("Ledger", "ANSI B (ledger), a North American "
|
||||
"paper size"), ledger_width, ledger_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("Tabloid", "ANSI B (tabloid), a North American "
|
||||
"paper size"), tabloid_width, tabloid_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("A0", "ISO 216 paper size"),
|
||||
a0_width, a0_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("A1", "ISO 216 paper size"),
|
||||
a1_width, a1_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("A2", "ISO 216 paper size"),
|
||||
a2_width, a2_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("A3", "ISO 216 paper size"),
|
||||
a3_width, a3_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("A4", "ISO 216 paper size"),
|
||||
a4_width, a4_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("A5", "ISO 216 paper size"),
|
||||
a5_width, a5_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("A6", "ISO 216 paper size"),
|
||||
a6_width, a6_height },
|
||||
{B_TRANSLATE_MARK_COMMENT("B5", "ISO 216 paper size"),
|
||||
b5_width, b5_height },
|
||||
};
|
||||
|
||||
|
||||
@@ -124,7 +137,7 @@ ConfigWindow::ConfigWindow(config_setup_kind kind, Printer* defaultPrinter,
|
||||
{
|
||||
MimeTypeForSender(settings, fSenderMimeType);
|
||||
PrinterForMimeType();
|
||||
|
||||
|
||||
if (kind == kJobSetup)
|
||||
SetTitle(B_TRANSLATE("Print setup"));
|
||||
|
||||
@@ -284,20 +297,17 @@ void ConfigWindow::MessageReceived(BMessage* m)
|
||||
}
|
||||
|
||||
|
||||
static const char*
|
||||
kAbout =
|
||||
"Printer server\n"
|
||||
"© 2001-2010 Haiku, Inc.\n"
|
||||
"\n"
|
||||
"\tIthamar R. Adema\n"
|
||||
"\tMichael Pfeiffer\n"
|
||||
;
|
||||
|
||||
|
||||
void
|
||||
ConfigWindow::AboutRequested()
|
||||
{
|
||||
BAlert *about = new BAlert("About printer server", kAbout,
|
||||
BString text = B_TRANSLATE("Printer server");
|
||||
text << "\n"
|
||||
"© 2001-2010 Haiku, Inc.\n"
|
||||
"\n"
|
||||
"\tIthamar R. Adema\n"
|
||||
"\tMichael Pfeiffer\n";
|
||||
|
||||
BAlert *about = new BAlert("About printer server", text.String(),
|
||||
B_TRANSLATE("OK"));
|
||||
about->Go();
|
||||
}
|
||||
@@ -490,26 +500,45 @@ void ConfigWindow::UpdateUI()
|
||||
}
|
||||
fPageFormatText->SetText(pageFormat.String());
|
||||
|
||||
// display information about job
|
||||
// display information about job
|
||||
if (fKind == kJobSetup) {
|
||||
BString job;
|
||||
int32 first, last;
|
||||
int32 first, last, copies;
|
||||
if (fJobSettings.FindInt32(PSRV_FIELD_FIRST_PAGE, &first) == B_OK &&
|
||||
fJobSettings.FindInt32(PSRV_FIELD_LAST_PAGE, &last) == B_OK) {
|
||||
if (first >= 1 && first <= last && last != INT_MAX) {
|
||||
job << B_TRANSLATE("Page") << " " << first << " " <<
|
||||
B_TRANSLATE("to") << " " << last;
|
||||
} else {
|
||||
job << B_TRANSLATE("All pages");
|
||||
}
|
||||
int32 copies;
|
||||
|
||||
bool printRange = first >= 1 && first <= last && last != INT_MAX;
|
||||
char number[12];
|
||||
if (fJobSettings.FindInt32(PSRV_FIELD_COPIES, &copies)
|
||||
== B_OK && copies > 1) {
|
||||
job << ", " << copies << " " << B_TRANSLATE("copies");
|
||||
if (printRange) {
|
||||
job = B_TRANSLATE("Page %1 to %2, %3 copies");
|
||||
sprintf(number, "%d", (int)first);
|
||||
job.ReplaceFirst("%1", number);
|
||||
sprintf(number, "%d", (int)last);
|
||||
job.ReplaceFirst("%2", number);
|
||||
sprintf(number, "%d", (int)copies);
|
||||
job.ReplaceFirst("%3", number);
|
||||
} else {
|
||||
job = B_TRANSLATE("All pages, %1 copies");
|
||||
sprintf(number, "%d", (int)copies);
|
||||
job.ReplaceFirst("%1", number);
|
||||
}
|
||||
} else {
|
||||
if (printRange) {
|
||||
job = B_TRANSLATE("Page %1 to %2");
|
||||
sprintf(number, "%d", (int)first);
|
||||
job.ReplaceFirst("%1", number);
|
||||
sprintf(number, "%d", (int)last);
|
||||
job.ReplaceFirst("%2", number);
|
||||
} else {
|
||||
job = B_TRANSLATE("All pages");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
job << B_TRANSLATE("Undefined");
|
||||
}
|
||||
|
||||
fJobSetupText->SetText(job.String());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
SubDir HAIKU_TOP src servers print ;
|
||||
|
||||
SubDirHdrs HAIKU_TOP headers os locale ;
|
||||
|
||||
UsePrivateHeaders shared print ;
|
||||
SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
|
||||
|
||||
@@ -24,7 +26,7 @@ LinkAgainst print_server :
|
||||
be
|
||||
root
|
||||
translation
|
||||
liblocale.so
|
||||
locale
|
||||
libprint.a
|
||||
libprintutils.a
|
||||
$(TARGET_LIBSUPC++)
|
||||
|
||||
@@ -11,28 +11,33 @@
|
||||
#include "Printer.h"
|
||||
|
||||
// BeOS API
|
||||
#include <Catalog.h>
|
||||
#include <Locale.h>
|
||||
#include <PropertyInfo.h>
|
||||
|
||||
// ANSI C
|
||||
#include <stdio.h>
|
||||
|
||||
#define B_TRANSLATE_CONTEXT "PrintServerApp Scripting"
|
||||
|
||||
|
||||
static property_info prop_list[] = {
|
||||
{ "ActivePrinter", { B_GET_PROPERTY, B_SET_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Retrieve or select the active printer" },
|
||||
B_TRANSLATE_MARK("Retrieve or select the active printer") },
|
||||
{ "Printer", { B_GET_PROPERTY }, { B_INDEX_SPECIFIER, B_NAME_SPECIFIER, B_REVERSE_INDEX_SPECIFIER },
|
||||
"Retrieve a specific printer" },
|
||||
B_TRANSLATE_MARK("Retrieve a specific printer") },
|
||||
{ "Printer", { B_CREATE_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Create a new printer" },
|
||||
B_TRANSLATE_MARK("Create a new printer") },
|
||||
{ "Printer", { B_DELETE_PROPERTY }, { B_INDEX_SPECIFIER, B_NAME_SPECIFIER, B_REVERSE_INDEX_SPECIFIER },
|
||||
"Delete a specific printer" },
|
||||
B_TRANSLATE_MARK("Delete a specific printer") },
|
||||
{ "Printers", { B_COUNT_PROPERTIES }, { B_DIRECT_SPECIFIER },
|
||||
"Return the number of available printers" },
|
||||
B_TRANSLATE_MARK("Return the number of available printers") },
|
||||
{ "Transport", { B_GET_PROPERTY }, { B_INDEX_SPECIFIER, B_NAME_SPECIFIER, B_REVERSE_INDEX_SPECIFIER },
|
||||
"Retrieve a specific transport" },
|
||||
B_TRANSLATE_MARK("Retrieve a specific transport") },
|
||||
{ "Transports", { B_COUNT_PROPERTIES }, { B_DIRECT_SPECIFIER },
|
||||
"Return the number of available transports" },
|
||||
B_TRANSLATE_MARK("Return the number of available transports") },
|
||||
{ "UseConfigWindow", { B_GET_PROPERTY, B_SET_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Show configuration window" },
|
||||
B_TRANSLATE_MARK("Show configuration window") },
|
||||
{ 0 } // terminate list
|
||||
};
|
||||
|
||||
@@ -234,6 +239,14 @@ PrintServerApp::GetSupportedSuites(BMessage* msg)
|
||||
{
|
||||
msg->AddString("suites", "suite/vnd.OpenBeOS-printserver");
|
||||
|
||||
static bool localized = false;
|
||||
if (!localized) {
|
||||
localized = true;
|
||||
for (int i = 0; prop_list[i].name != NULL; i ++)
|
||||
prop_list[i].usage = be_catalog->GetString(prop_list[i].usage,
|
||||
B_TRANSLATE_CONTEXT);
|
||||
}
|
||||
|
||||
BPropertyInfo prop_info(prop_list);
|
||||
msg->AddFlat("messages", &prop_info);
|
||||
|
||||
|
||||
@@ -11,25 +11,32 @@
|
||||
#include "pr_server.h"
|
||||
|
||||
// BeOS API
|
||||
#include <PropertyInfo.h>
|
||||
#include <Messenger.h>
|
||||
#include <Message.h>
|
||||
#include <AppDefs.h>
|
||||
#include <Catalog.h>
|
||||
#include <Locale.h>
|
||||
#include <Message.h>
|
||||
#include <Messenger.h>
|
||||
#include <PropertyInfo.h>
|
||||
|
||||
|
||||
#define B_TRANSLATE_CONTEXT "Printer Scripting"
|
||||
|
||||
|
||||
static property_info prop_list[] = {
|
||||
{ "Name", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Get name of printer" },
|
||||
B_TRANSLATE_MARK("Get name of printer") },
|
||||
{ "TransportAddon", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Get name of the transport add-on used for this printer" },
|
||||
B_TRANSLATE_MARK("Get name of the transport add-on used for this printer") },
|
||||
{ "TransportConfig", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Get the transport configuration for this printer" },
|
||||
B_TRANSLATE_MARK("Get the transport configuration for this printer") },
|
||||
{ "PrinterAddon", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Get name of the printer add-on used for this printer" },
|
||||
B_TRANSLATE_MARK("Get name of the printer add-on used for this printer") },
|
||||
{ "Comments", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
|
||||
"Get comments about this printer" },
|
||||
B_TRANSLATE_MARK("Get comments about this printer") },
|
||||
{ 0 } // terminate list
|
||||
};
|
||||
|
||||
|
||||
void Printer::HandleScriptingCommand(BMessage* msg)
|
||||
{
|
||||
status_t rc = B_ERROR;
|
||||
@@ -52,7 +59,7 @@ void Printer::HandleScriptingCommand(BMessage* msg)
|
||||
rc = SpoolDir()->ReadAttrString(PSRV_PRINTER_ATTR_DRV_NAME, &result);
|
||||
else if (propName == "Comments")
|
||||
rc = SpoolDir()->ReadAttrString(PSRV_PRINTER_ATTR_COMMENTS, &result);
|
||||
else { // If unknown scripting request, let superclas handle it
|
||||
else { // If unknown scripting request, let super class handle it
|
||||
Inherited::MessageReceived(msg);
|
||||
break;
|
||||
}
|
||||
@@ -94,7 +101,15 @@ BHandler* Printer::ResolveSpecifier(BMessage* msg, int32 index, BMessage* spec,
|
||||
status_t Printer::GetSupportedSuites(BMessage* msg)
|
||||
{
|
||||
msg->AddString("suites", "application/x-vnd.OpenBeOS-printer");
|
||||
|
||||
|
||||
static bool localized = false;
|
||||
if (!localized) {
|
||||
localized = true;
|
||||
for (int i = 0; prop_list[i].name != NULL; i ++)
|
||||
prop_list[i].usage = be_catalog->GetString(prop_list[i].usage,
|
||||
B_TRANSLATE_CONTEXT);
|
||||
}
|
||||
|
||||
BPropertyInfo prop_info(prop_list);
|
||||
msg->AddFlat("messages", &prop_info);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user