Ticket #6089: print_serverLocalizationUpdate.patch
File print_serverLocalizationUpdate.patch, 8.0 KB (added by , 14 years ago) |
---|
-
src/servers/print/Printer.Scripting.cpp
11 11 #include "pr_server.h" 12 12 13 13 // BeOS API 14 #include <PropertyInfo.h> 14 #include <AppDefs.h> 15 #include <Catalog.h> 16 #include <Locale.h> 15 17 #include <Messenger.h> 16 18 #include <Message.h> 17 #include < AppDefs.h>19 #include <PropertyInfo.h> 18 20 21 #define B_TRANSLATE_CONTEXT "Printer Scripting" 22 23 19 24 static property_info prop_list[] = { 20 25 { "Name", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER }, 21 26 "Get name of printer" }, … … 94 99 status_t Printer::GetSupportedSuites(BMessage* msg) 95 100 { 96 101 msg->AddString("suites", "application/x-vnd.OpenBeOS-printer"); 102 103 prop_list[0].usage = B_TRANSLATE("Get name of printer"); 104 prop_list[1].usage = B_TRANSLATE("Get name of the transport add-on used for this printer"); 105 prop_list[2].usage = B_TRANSLATE("Get the transport configuration for this printer"); 106 prop_list[3].usage = B_TRANSLATE("Get name of the printer add-on used for this printer"); 107 prop_list[4].usage = B_TRANSLATE("Get comments about this printer"); 97 108 98 109 BPropertyInfo prop_info(prop_list); 99 110 msg->AddFlat("messages", &prop_info); -
src/servers/print/PrintServerApp.Scripting.cpp
11 11 #include "Printer.h" 12 12 13 13 // BeOS API 14 #include <Catalog.h> 15 #include <Locale.h> 14 16 #include <PropertyInfo.h> 15 17 16 18 // ANSI C 17 19 #include <stdio.h> 18 20 21 #define B_TRANSLATE_CONTEXT "PrintServerApp Scripting" 22 23 19 24 static property_info prop_list[] = { 20 25 { "ActivePrinter", { B_GET_PROPERTY, B_SET_PROPERTY }, { B_DIRECT_SPECIFIER }, 21 26 "Retrieve or select the active printer" }, … … 234 239 { 235 240 msg->AddString("suites", "suite/vnd.OpenBeOS-printserver"); 236 241 242 prop_list[0].usage = B_TRANSLATE("Retrieve or select the active printer"); 243 prop_list[1].usage = B_TRANSLATE("Retrieve a specific printer"); 244 prop_list[2].usage = B_TRANSLATE("Create a new printer"); 245 prop_list[3].usage = B_TRANSLATE("Delete a specific printer"); 246 prop_list[4].usage = B_TRANSLATE("Return the number of available printers"); 247 prop_list[5].usage = B_TRANSLATE("Retrieve a specific transport"); 248 prop_list[6].usage = B_TRANSLATE("Return the number of available transports"); 249 prop_list[7].usage = B_TRANSLATE("Show configuration window"); 250 237 251 BPropertyInfo prop_info(prop_list); 238 252 msg->AddFlat("messages", &prop_info); 239 253 -
src/servers/print/Jamfile
1 1 SubDir HAIKU_TOP src servers print ; 2 2 3 SubDirHdrs HAIKU_TOP headers os locale ; 4 3 5 UsePrivateHeaders shared print ; 4 6 SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ; 5 7 … … 24 26 be 25 27 root 26 28 translation 27 l iblocale.so29 locale 28 30 libprint.a 29 31 libprintutils.a 30 32 $(TARGET_LIBSUPC++) -
src/servers/print/ConfigWindow.cpp
27 27 // Haiku 28 28 #include <Catalog.h> 29 29 #include <Layout.h> 30 #include <Locale.h> 30 31 #include <GroupLayout.h> 31 32 #include <GroupLayoutBuilder.h> 32 33 … … 68 69 float height; 69 70 } pageFormat[] = 70 71 { 71 {B_TRANSLATE_MARK("Letter"), letter_width, letter_height }, 72 {B_TRANSLATE_MARK("Legal"), legal_width, legal_height }, 73 {B_TRANSLATE_MARK("Ledger"), ledger_width, ledger_height }, 74 {B_TRANSLATE_MARK("Tabloid"), tabloid_width, tabloid_height }, 75 {B_TRANSLATE_MARK("A0"), a0_width, a0_height }, 76 {B_TRANSLATE_MARK("A1"), a1_width, a1_height }, 77 {B_TRANSLATE_MARK("A2"), a2_width, a2_height }, 78 {B_TRANSLATE_MARK("A3"), a3_width, a3_height }, 79 {B_TRANSLATE_MARK("A4"), a4_width, a4_height }, 80 {B_TRANSLATE_MARK("A5"), a5_width, a5_height }, 81 {B_TRANSLATE_MARK("A6"), a6_width, a6_height }, 82 {B_TRANSLATE_MARK("B5"), b5_width, b5_height }, 72 {B_TRANSLATE_MARK_COMMENT("Letter", "ANSI A (letter), a North American " 73 "paper size"), letter_width, letter_height }, 74 {B_TRANSLATE_MARK_COMMENT("Legal", "A North American paper size (216 x 356" 75 " mm, or 8.5 x 14 in)"), legal_width, legal_height }, 76 {B_TRANSLATE_MARK_COMMENT("Ledger", "ANSI B (ledger), a North American " 77 "paper size"), ledger_width, ledger_height }, 78 {B_TRANSLATE_MARK_COMMENT("Tabloid", "ANSI B (tabloid), a North American " 79 "paper size"), tabloid_width, tabloid_height }, 80 {B_TRANSLATE_MARK_COMMENT("A0", "ISO 216 paper size"), 81 a0_width, a0_height }, 82 {B_TRANSLATE_MARK_COMMENT("A1", "ISO 216 paper size"), 83 a1_width, a1_height }, 84 {B_TRANSLATE_MARK_COMMENT("A2", "ISO 216 paper size"), 85 a2_width, a2_height }, 86 {B_TRANSLATE_MARK_COMMENT("A3", "ISO 216 paper size"), 87 a3_width, a3_height }, 88 {B_TRANSLATE_MARK_COMMENT("A4", "ISO 216 paper size"), 89 a4_width, a4_height }, 90 {B_TRANSLATE_MARK_COMMENT("A5", "ISO 216 paper size"), 91 a5_width, a5_height }, 92 {B_TRANSLATE_MARK_COMMENT("A6", "ISO 216 paper size"), 93 a6_width, a6_height }, 94 {B_TRANSLATE_MARK_COMMENT("B5", "ISO 216 paper size"), 95 b5_width, b5_height }, 83 96 }; 84 97 85 98 … … 109 122 } 110 123 111 124 125 static const char* 126 kAbout = 127 "Printer server\n" 128 "© 2001-2010 Haiku, Inc.\n" 129 "\n" 130 "\tIthamar R. Adema\n" 131 "\tMichael Pfeiffer\n" 132 ; 133 134 112 135 ConfigWindow::ConfigWindow(config_setup_kind kind, Printer* defaultPrinter, 113 136 BMessage* settings, AutoReply* sender) 114 137 : BWindow(ConfigWindow::GetWindowFrame(), B_TRANSLATE("Page setup"), … … 124 147 { 125 148 MimeTypeForSender(settings, fSenderMimeType); 126 149 PrinterForMimeType(); 150 151 BString tmpAbout = B_TRANSLATE("Printer server\n"); 152 tmpAbout << "© 2001-2010 Haiku, Inc.\n" 153 "\n" 154 "\tIthamar R. Adema\n" 155 "\tMichael Pfeiffer\n"; 156 kAbout = tmpAbout; 127 157 128 158 if (kind == kJobSetup) 129 159 SetTitle(B_TRANSLATE("Print setup")); … … 284 314 } 285 315 286 316 287 static const char*288 kAbout =289 "Printer server\n"290 "© 2001-2010 Haiku, Inc.\n"291 "\n"292 "\tIthamar R. Adema\n"293 "\tMichael Pfeiffer\n"294 ;295 296 297 317 void 298 318 ConfigWindow::AboutRequested() 299 319 { … … 493 513 // display information about job 494 514 if (fKind == kJobSetup) { 495 515 BString job; 496 int32 first, last ;516 int32 first, last, copies; 497 517 if (fJobSettings.FindInt32(PSRV_FIELD_FIRST_PAGE, &first) == B_OK && 498 518 fJobSettings.FindInt32(PSRV_FIELD_LAST_PAGE, &last) == B_OK) { 499 if (first >= 1 && first <= last && last != INT_MAX) {500 job << B_TRANSLATE("Page") << " " << first << " " <<501 B_TRANSLATE("to") << " " << last;502 } else {503 job << B_TRANSLATE("All pages");504 }505 int32 copies;506 519 if (fJobSettings.FindInt32(PSRV_FIELD_COPIES, &copies) 507 520 == B_OK && copies > 1) { 508 job << ", " << copies << " " << B_TRANSLATE("copies"); 521 if (first >= 1 && first <= last && last != INT_MAX) { 522 BString str1 = B_TRANSLATE("Page %1 to %2, %3 copies"); 523 char str2[sizeof(int)+1]; 524 sprintf(str2, "%d", (int)first); 525 str1.ReplaceFirst("%1", str2); 526 sprintf(str2, "%d", (int)last); 527 str1.ReplaceFirst("%2", str2); 528 sprintf(str2, "%d", (int)copies); 529 str1.ReplaceFirst("%3", str2); 530 job << str1; 531 } else { 532 BString str1 = B_TRANSLATE("All pages, %1 copies"); 533 char str2[sizeof(int)+1]; 534 sprintf(str2, "%d", (int)copies); 535 str1.ReplaceFirst("%1", str2); 536 job << str1; 537 } 538 } else { 539 if (first >= 1 && first <= last && last != INT_MAX) { 540 BString str1 = B_TRANSLATE("Page %1 to %2"); 541 char str2[sizeof(int)+1]; 542 sprintf(str2, "%d", (int)first); 543 str1.ReplaceFirst("%1", str2); 544 sprintf(str2, "%d", (int)last); 545 str1.ReplaceFirst("%2", str2); 546 job << str1; 547 } else { 548 job << B_TRANSLATE("All pages"); 549 } 509 550 } 510 551 } else { 511 552 job << B_TRANSLATE("Undefined");