Ticket #6089: print_serverLocalizationUpdate.patch

File print_serverLocalizationUpdate.patch, 8.0 KB (added by Karvjorm, 14 years ago)

An updated print_serverLocalizationUpdate patch

  • src/servers/print/Printer.Scripting.cpp

     
    1111#include "pr_server.h"
    1212
    1313    // BeOS API
    14 #include <PropertyInfo.h>
     14#include <AppDefs.h>
     15#include <Catalog.h>
     16#include <Locale.h>
    1517#include <Messenger.h>
    1618#include <Message.h>
    17 #include <AppDefs.h>
     19#include <PropertyInfo.h>
    1820
     21#define B_TRANSLATE_CONTEXT "Printer Scripting"
     22
     23
    1924static property_info prop_list[] = {
    2025    { "Name", { B_GET_PROPERTY }, { B_DIRECT_SPECIFIER },
    2126        "Get name of printer" },
     
    9499status_t Printer::GetSupportedSuites(BMessage* msg)
    95100{
    96101    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");
    97108   
    98109    BPropertyInfo prop_info(prop_list);
    99110    msg->AddFlat("messages", &prop_info);
  • src/servers/print/PrintServerApp.Scripting.cpp

     
    1111#include "Printer.h"
    1212
    1313    // BeOS API
     14#include <Catalog.h>
     15#include <Locale.h>
    1416#include <PropertyInfo.h>
    1517
    1618    // ANSI C
    1719#include <stdio.h>
    1820
     21#define B_TRANSLATE_CONTEXT "PrintServerApp Scripting"
     22
     23
    1924static property_info prop_list[] = {
    2025    { "ActivePrinter", { B_GET_PROPERTY, B_SET_PROPERTY }, { B_DIRECT_SPECIFIER },
    2126        "Retrieve or select the active printer" },
     
    234239{
    235240    msg->AddString("suites", "suite/vnd.OpenBeOS-printserver");
    236241   
     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   
    237251    BPropertyInfo prop_info(prop_list);
    238252    msg->AddFlat("messages", &prop_info);
    239253   
  • src/servers/print/Jamfile

     
    11SubDir HAIKU_TOP src servers print ;
    22
     3SubDirHdrs HAIKU_TOP headers os locale ;
     4
    35UsePrivateHeaders shared print ;
    46SubDirHdrs [ FDirName $(HAIKU_TOP) headers libs print libprint ] ;
    57
     
    2426    be
    2527    root
    2628    translation
    27     liblocale.so
     29    locale
    2830    libprint.a
    2931    libprintutils.a
    3032    $(TARGET_LIBSUPC++)
  • src/servers/print/ConfigWindow.cpp

     
    2727// Haiku
    2828#include <Catalog.h>
    2929#include <Layout.h>
     30#include <Locale.h>
    3031#include <GroupLayout.h>
    3132#include <GroupLayoutBuilder.h>
    3233
     
    6869    float height;
    6970} pageFormat[] =
    7071{
    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 },
    8396};
    8497
    8598
     
    109122}
    110123
    111124
     125static const char*
     126kAbout =
     127"Printer server\n"
     128"© 2001-2010 Haiku, Inc.\n"
     129"\n"
     130"\tIthamar R. Adema\n"
     131"\tMichael Pfeiffer\n"
     132;
     133
     134
    112135ConfigWindow::ConfigWindow(config_setup_kind kind, Printer* defaultPrinter,
    113136    BMessage* settings, AutoReply* sender)
    114137    : BWindow(ConfigWindow::GetWindowFrame(), B_TRANSLATE("Page setup"),
     
    124147{
    125148    MimeTypeForSender(settings, fSenderMimeType);
    126149    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;
    127157
    128158    if (kind == kJobSetup)
    129159        SetTitle(B_TRANSLATE("Print setup"));
     
    284314}
    285315
    286316
    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 
    297317void
    298318ConfigWindow::AboutRequested()
    299319{
     
    493513            // display information about job
    494514        if (fKind == kJobSetup) {
    495515            BString job;
    496             int32 first, last;
     516            int32 first, last, copies;
    497517            if (fJobSettings.FindInt32(PSRV_FIELD_FIRST_PAGE, &first) == B_OK &&
    498518                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;
    506519                if (fJobSettings.FindInt32(PSRV_FIELD_COPIES, &copies)
    507520                    == 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                    }
    509550                }
    510551            } else {
    511552                job << B_TRANSLATE("Undefined");