diff options
author | Kai Blin <kai@samba.org> | 2009-08-10 18:24:57 +0200 |
---|---|---|
committer | Kai Blin <kai@samba.org> | 2009-08-10 19:40:43 +0200 |
commit | 0ef723a68204d04e0ad0d315deefaf1af33c1aad (patch) | |
tree | 52f0b0b829ffd79115c477560d58a133aaf30291 /source3 | |
parent | ef04e4538c64fd8b4a6473c4780a4a977f2da0cc (diff) | |
download | samba-0ef723a68204d04e0ad0d315deefaf1af33c1aad.tar.gz samba-0ef723a68204d04e0ad0d315deefaf1af33c1aad.tar.bz2 samba-0ef723a68204d04e0ad0d315deefaf1af33c1aad.zip |
s3 net: i18n support for net rpc printer
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/locale/net/genmsg | 3 | ||||
-rw-r--r-- | source3/utils/net_rpc_printer.c | 185 |
2 files changed, 107 insertions, 81 deletions
diff --git a/source3/locale/net/genmsg b/source3/locale/net/genmsg index 0e82d47959..9f84e6ea34 100755 --- a/source3/locale/net/genmsg +++ b/source3/locale/net/genmsg @@ -30,7 +30,8 @@ FILES=`add_basedir_to_filelist ../../utils net.c net_ads.c net_ads_gpo.c \ net_afs.c net_cache.c net_conf.c net_dom.c net_eventlog.c net_file.c \ net_group.c net_groupmap.c net_help.c net_help_common.c net_idmap.c \ net_join.c net_lookup.c net_lua.c net_rap.c net_registry.c \ - net_registry_util.c net_rpc.c net_rpc_audit.c net_rpc_join.c` + net_registry_util.c net_rpc.c net_rpc_audit.c net_rpc_join.c \ + net_rpc_printer.c` LANGS="af ar bg bn bs ca cs cy da de el en_GB en_US es et fi fr gl gu he hi hr hu id it ja ka km ko lo lt mk mr nb nl pa pl pt_BR pt ro ru si sk sl sr diff --git a/source3/utils/net_rpc_printer.c b/source3/utils/net_rpc_printer.c index 3376f5666d..ea7465e33a 100644 --- a/source3/utils/net_rpc_printer.c +++ b/source3/utils/net_rpc_printer.c @@ -51,23 +51,23 @@ static void display_print_driver3(struct spoolss_DriverInfo3 *r) return; } - printf("Printer Driver Info 3:\n"); - printf("\tVersion: [%x]\n", r->version); - printf("\tDriver Name: [%s]\n", r->driver_name); - printf("\tArchitecture: [%s]\n", r->architecture); - printf("\tDriver Path: [%s]\n", r->driver_path); - printf("\tDatafile: [%s]\n", r->data_file); - printf("\tConfigfile: [%s]\n\n", r->config_file); - printf("\tHelpfile: [%s]\n\n", r->help_file); + printf(_("Printer Driver Info 3:\n")); + printf(_("\tVersion: [%x]\n"), r->version); + printf(_("\tDriver Name: [%s]\n"), r->driver_name); + printf(_("\tArchitecture: [%s]\n"), r->architecture); + printf(_("\tDriver Path: [%s]\n"), r->driver_path); + printf(_("\tDatafile: [%s]\n"), r->data_file); + printf(_("\tConfigfile: [%s]\n\n"), r->config_file); + printf(_("\tHelpfile: [%s]\n\n"), r->help_file); for (i=0; r->dependent_files[i] != NULL; i++) { - printf("\tDependentfiles: [%s]\n", r->dependent_files[i]); + printf(_("\tDependentfiles: [%s]\n"), r->dependent_files[i]); } printf("\n"); - printf("\tMonitorname: [%s]\n", r->monitor_name); - printf("\tDefaultdatatype: [%s]\n\n", r->default_datatype); + printf(_("\tMonitorname: [%s]\n"), r->monitor_name); + printf(_("\tDefaultdatatype: [%s]\n\n"), r->default_datatype); } static void display_reg_value(const char *subkey, struct regval_blob value) @@ -76,8 +76,8 @@ static void display_reg_value(const char *subkey, struct regval_blob value) switch(value.type) { case REG_DWORD: - d_printf("\t[%s:%s]: REG_DWORD: 0x%08x\n", subkey, value.valuename, - *((uint32_t *) value.data_p)); + d_printf(_("\t[%s:%s]: REG_DWORD: 0x%08x\n"), subkey, + value.valuename, *((uint32_t *) value.data_p)); break; case REG_SZ: @@ -89,11 +89,13 @@ static void display_reg_value(const char *subkey, struct regval_blob value) if (!text) { break; } - d_printf("\t[%s:%s]: REG_SZ: %s\n", subkey, value.valuename, text); + d_printf(_("\t[%s:%s]: REG_SZ: %s\n"), subkey, value.valuename, + text); break; case REG_BINARY: - d_printf("\t[%s:%s]: REG_BINARY: unknown length value not displayed\n", + d_printf(_("\t[%s:%s]: REG_BINARY: unknown length value not " + "displayed\n"), subkey, value.valuename); break; @@ -104,7 +106,7 @@ static void display_reg_value(const char *subkey, struct regval_blob value) if (!W_ERROR_IS_OK(reg_pull_multi_sz(NULL, value.data_p, value.size, &num_values, &values))) { - d_printf("reg_pull_multi_sz failed\n"); + d_printf(_("reg_pull_multi_sz failed\n")); break; } @@ -116,7 +118,8 @@ static void display_reg_value(const char *subkey, struct regval_blob value) } default: - d_printf("\t%s: unknown type %d\n", value.valuename, value.type); + d_printf(_("\t%s: unknown type %d\n"), value.valuename, + value.type); } } @@ -248,14 +251,16 @@ NTSTATUS net_copy_fileattr(struct net_context *c, /* closing files */ if (!NT_STATUS_IS_OK(cli_close(cli_share_src, fnum_src))) { - d_fprintf(stderr, "could not close %s on originating server: %s\n", + d_fprintf(stderr, + _("could not close %s on originating server: %s\n"), is_file?"file":"dir", cli_errstr(cli_share_src)); nt_status = cli_nt_error(cli_share_src); goto out; } if (!NT_STATUS_IS_OK(cli_close(cli_share_dst, fnum_dst))) { - d_fprintf(stderr, "could not close %s on destination server: %s\n", + d_fprintf(stderr, + _("could not close %s on destination server: %s\n"), is_file?"file":"dir", cli_errstr(cli_share_dst)); nt_status = cli_nt_error(cli_share_dst); goto out; @@ -348,7 +353,8 @@ NTSTATUS net_copy_file(struct net_context *c, /* allocate memory */ if (!(data = (char *)SMB_MALLOC(read_size))) { - d_fprintf(stderr, "malloc fail for size %d\n", read_size); + d_fprintf(stderr, _("malloc fail for size %d\n"), + read_size); nt_status = NT_STATUS_NO_MEMORY; goto out; } @@ -358,13 +364,13 @@ NTSTATUS net_copy_file(struct net_context *c, if (c->opt_verbose) { - d_printf("copying [\\\\%s\\%s%s] => [\\\\%s\\%s%s] " - "%s ACLs and %s DOS Attributes %s\n", + d_printf(_("copying [\\\\%s\\%s%s] => [\\\\%s\\%s%s] " + "%s ACLs and %s DOS Attributes %s\n"), cli_share_src->desthost, cli_share_src->share, src_name, cli_share_dst->desthost, cli_share_dst->share, dst_name, - copy_acls ? "with" : "without", - copy_attrs ? "with" : "without", - copy_timestamps ? "(preserving timestamps)" : "" ); + copy_acls ? _("with") : _("without"), + copy_attrs ? _("with") : _("without"), + copy_timestamps ? _("(preserving timestamps)") : "" ); } @@ -382,7 +388,7 @@ NTSTATUS net_copy_file(struct net_context *c, nread, n); if (n != ret) { - d_fprintf(stderr, "Error writing file: %s\n", + d_fprintf(stderr, _("Error writing file: %s\n"), cli_errstr(cli_share_dst)); nt_status = cli_nt_error(cli_share_dst); goto out; @@ -405,7 +411,8 @@ NTSTATUS net_copy_file(struct net_context *c, } if (!NT_STATUS_IS_OK(cli_chkpath(cli_share_dst, dst_name))) { - d_fprintf(stderr, "cannot check for directory %s: %s\n", + d_fprintf(stderr, + _("cannot check for directory %s: %s\n"), dst_name, cli_errstr(cli_share_dst)); goto out; } @@ -414,14 +421,16 @@ NTSTATUS net_copy_file(struct net_context *c, /* closing files */ if (!NT_STATUS_IS_OK(cli_close(cli_share_src, fnum_src))) { - d_fprintf(stderr, "could not close file on originating server: %s\n", + d_fprintf(stderr, + _("could not close file on originating server: %s\n"), cli_errstr(cli_share_src)); nt_status = cli_nt_error(cli_share_src); goto out; } if (is_file && !NT_STATUS_IS_OK(cli_close(cli_share_dst, fnum_dst))) { - d_fprintf(stderr, "could not close file on destination server: %s\n", + d_fprintf(stderr, + _("could not close file on destination server: %s\n"), cli_errstr(cli_share_dst)); nt_status = cli_nt_error(cli_share_dst); goto out; @@ -554,7 +563,7 @@ static NTSTATUS check_arch_dir(struct cli_state *cli_share, const char *short_ar } if (!NT_STATUS_IS_OK(cli_chkpath(cli_share, dir))) { - d_fprintf(stderr, "cannot check %s: %s\n", + d_fprintf(stderr, _("cannot check %s: %s\n"), dir, cli_errstr(cli_share)); goto out; } @@ -595,7 +604,8 @@ static NTSTATUS copy_print_driver_3(struct net_context *c, } if (c->opt_verbose) - d_printf("copying driver: [%s], for architecture: [%s], version: [%d]\n", + d_printf(_("copying driver: [%s], for architecture: [%s], " + "version: [%d]\n"), r->driver_name, short_archi, r->version); nt_status = net_copy_driverfile(c, mem_ctx, cli_share_src, cli_share_dst, @@ -663,7 +673,7 @@ static bool net_spoolss_enum_printers(struct rpc_pipe_client *pipe_hnd, num_printers, info); if (!W_ERROR_IS_OK(result)) { - printf("cannot enum printers: %s\n", win_errstr(result)); + printf(_("cannot enum printers: %s\n"), win_errstr(result)); return false; } @@ -695,13 +705,15 @@ static bool net_spoolss_open_printer_ex(struct rpc_pipe_client *pipe_hnd, /* be more verbose */ if (W_ERROR_V(result) == W_ERROR_V(WERR_ACCESS_DENIED)) { - d_fprintf(stderr, "no access to printer [%s] on [%s] for user [%s] granted\n", + d_fprintf(stderr, + _("no access to printer [%s] on [%s] for user [%s] " + "granted\n"), printername2, pipe_hnd->srv_name_slash, username); return false; } if (!W_ERROR_IS_OK(result)) { - d_fprintf(stderr, "cannot open printer %s on server %s: %s\n", + d_fprintf(stderr,_("cannot open printer %s on server %s: %s\n"), printername2, pipe_hnd->srv_name_slash, win_errstr(result)); return false; } @@ -727,7 +739,7 @@ static bool net_spoolss_getprinter(struct rpc_pipe_client *pipe_hnd, 0, /* offered */ info); if (!W_ERROR_IS_OK(result)) { - printf("cannot get printer-info: %s\n", win_errstr(result)); + printf(_("cannot get printer-info: %s\n"), win_errstr(result)); return false; } @@ -808,7 +820,7 @@ static bool net_spoolss_setprinter(struct rpc_pipe_client *pipe_hnd, &result); if (!W_ERROR_IS_OK(result)) { - printf("cannot set printer-info: %s\n", win_errstr(result)); + printf(_("cannot set printer-info: %s\n"), win_errstr(result)); return false; } @@ -836,7 +848,8 @@ static bool net_spoolss_setprinterdata(struct rpc_pipe_client *pipe_hnd, &result); if (!W_ERROR_IS_OK(result)) { - printf ("unable to set printerdata: %s\n", win_errstr(result)); + printf (_("unable to set printerdata: %s\n"), + win_errstr(result)); return false; } @@ -856,7 +869,7 @@ static bool net_spoolss_enumprinterkey(struct rpc_pipe_client *pipe_hnd, result = rpccli_spoolss_enumprinterkey(pipe_hnd, mem_ctx, hnd, keyname, keylist, 0); if (!W_ERROR_IS_OK(result)) { - printf("enumprinterkey failed: %s\n", win_errstr(result)); + printf(_("enumprinterkey failed: %s\n"), win_errstr(result)); return false; } @@ -882,7 +895,7 @@ static bool net_spoolss_enumprinterdataex(struct rpc_pipe_client *pipe_hnd, info); if (!W_ERROR_IS_OK(result)) { - printf("enumprinterdataex failed: %s\n", win_errstr(result)); + printf(_("enumprinterdataex failed: %s\n"), win_errstr(result)); return false; } @@ -910,7 +923,8 @@ static bool net_spoolss_setprinterdataex(struct rpc_pipe_client *pipe_hnd, &result); if (!W_ERROR_IS_OK(result)) { - printf("could not set printerdataex: %s\n", win_errstr(result)); + printf(_("could not set printerdataex: %s\n"), + win_errstr(result)); return false; } @@ -934,7 +948,7 @@ static bool net_spoolss_enumforms(struct rpc_pipe_client *pipe_hnd, num_forms, forms); if (!W_ERROR_IS_OK(result)) { - printf("could not enum forms: %s\n", win_errstr(result)); + printf(_("could not enum forms: %s\n"), win_errstr(result)); return false; } @@ -958,7 +972,7 @@ static bool net_spoolss_enumprinterdrivers (struct rpc_pipe_client *pipe_hnd, count, info); if (!W_ERROR_IS_OK(result)) { - printf("cannot enum drivers: %s\n", win_errstr(result)); + printf(_("cannot enum drivers: %s\n"), win_errstr(result)); return false; } @@ -991,7 +1005,8 @@ static bool net_spoolss_getprinterdriver(struct rpc_pipe_client *pipe_hnd, env, win_errstr(result))); if (W_ERROR_V(result) != W_ERROR_V(WERR_UNKNOWN_PRINTER_DRIVER) && W_ERROR_V(result) != W_ERROR_V(WERR_INVALID_ENVIRONMENT)) { - printf("cannot get driver: %s\n", win_errstr(result)); + printf(_("cannot get driver: %s\n"), + win_errstr(result)); } return false; } @@ -1020,7 +1035,7 @@ static bool net_spoolss_addprinterdriver(struct rpc_pipe_client *pipe_hnd, (void *)&info->info3; break; default: - printf("unsupported info level: %d\n", level); + printf(_("unsupported info level: %d\n"), level); return false; } @@ -1031,11 +1046,11 @@ static bool net_spoolss_addprinterdriver(struct rpc_pipe_client *pipe_hnd, &result); /* be more verbose */ if (W_ERROR_V(result) == W_ERROR_V(WERR_ACCESS_DENIED)) { - printf("You are not allowed to add drivers\n"); + printf(_("You are not allowed to add drivers\n")); return false; } if (!W_ERROR_IS_OK(result)) { - printf("cannot add driver: %s\n", win_errstr(result)); + printf(_("cannot add driver: %s\n"), win_errstr(result)); return false; } @@ -1135,7 +1150,7 @@ NTSTATUS rpc_printer_list_internals(struct net_context *c, sharename = info[i].info2.sharename; if (printername && sharename) { - d_printf("printer %d: %s, shared as: %s\n", + d_printf(_("printer %d: %s, shared as: %s\n"), i+1, printername, sharename); } } @@ -1175,7 +1190,7 @@ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c, union spoolss_DriverInfo *info; int d; - printf("listing printer-drivers\n"); + printf(_("listing printer-drivers\n")); for (i=0; archi_table[i].long_archi!=NULL; i++) { @@ -1190,12 +1205,13 @@ NTSTATUS rpc_printer_driver_list_internals(struct net_context *c, } if (num_drivers == 0) { - d_printf ("no drivers found on server for architecture: [%s].\n", + d_printf(_("no drivers found on server for " + "architecture: [%s].\n"), archi_table[i].long_archi); continue; } - d_printf("got %d printer-drivers for architecture: [%s]\n", + d_printf(_("got %d printer-drivers for architecture: [%s]\n"), num_drivers, archi_table[i].long_archi); @@ -1268,17 +1284,17 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_ /* check action and set string */ switch (action) { case DSPRINT_PUBLISH: - action_str = "published"; + action_str = N_("published"); break; case DSPRINT_UPDATE: - action_str = "updated"; + action_str = N_("updated"); break; case DSPRINT_UNPUBLISH: - action_str = "unpublished"; + action_str = N_("unpublished"); break; default: - action_str = "unknown action"; - printf("unkown action: %d\n", action); + action_str = N_("unknown action"); + printf(_("unkown action: %d\n"), action); break; } @@ -1299,11 +1315,13 @@ static NTSTATUS rpc_printer_publish_internals_args(struct rpc_pipe_client *pipe_ &result); if (!W_ERROR_IS_OK(result) && (W_ERROR_V(result) != W_ERROR_V(WERR_IO_PENDING))) { - printf("cannot set printer-info: %s\n", win_errstr(result)); + printf(_("cannot set printer-info: %s\n"), + win_errstr(result)); goto done; } - printf("successfully %s printer %s in Active Directory\n", action_str, sharename); + printf(_("successfully %s printer %s in Active Directory\n"), + action_str, sharename); } nt_status = NT_STATUS_OK; @@ -1414,19 +1432,22 @@ NTSTATUS rpc_printer_publish_list_internals(struct net_context *c, state = info.info7.action; switch (state) { case DSPRINT_PUBLISH: - printf("printer [%s] is published", sharename); + printf(_("printer [%s] is published"), + sharename); if (c->opt_verbose) - printf(", guid: %s", info.info7.guid); + printf(_(", guid: %s"),info.info7.guid); printf("\n"); break; case DSPRINT_UNPUBLISH: - printf("printer [%s] is unpublished\n", sharename); + printf(_("printer [%s] is unpublished\n"), + sharename); break; case DSPRINT_UPDATE: - printf("printer [%s] is currently updating\n", sharename); + printf(_("printer [%s] is currently updating\n"), + sharename); break; default: - printf("unkown state: %d\n", state); + printf(_("unkown state: %d\n"), state); break; } } @@ -1496,7 +1517,7 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, } if (!num_printers) { - printf ("no printers found on server.\n"); + printf (_("no printers found on server.\n")); nt_status = NT_STATUS_OK; goto done; } @@ -1517,7 +1538,7 @@ NTSTATUS rpc_printer_migrate_security_internals(struct net_context *c, get any real NT_STATUS-codes anymore from now on */ nt_status = NT_STATUS_UNSUCCESSFUL; - d_printf("migrating printer ACLs for: [%s] / [%s]\n", + d_printf(_("migrating printer ACLs for: [%s] / [%s]\n"), printername, sharename); /* according to msdn you have specify these access-rights @@ -1643,7 +1664,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, } if (!num_printers) { - printf ("no printers found on server.\n"); + printf (_("no printers found on server.\n")); nt_status = NT_STATUS_OK; goto done; } @@ -1663,7 +1684,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, get any real NT_STATUS-codes anymore from now on */ nt_status = NT_STATUS_UNSUCCESSFUL; - d_printf("migrating printer forms for: [%s] / [%s]\n", + d_printf(_("migrating printer forms for: [%s] / [%s]\n"), printername, sharename); @@ -1699,7 +1720,8 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, continue; if (c->opt_verbose) - d_printf("\tmigrating form # %d [%s] of type [%d]\n", + d_printf(_("\tmigrating form # %d [%s] of type " + "[%d]\n"), f, forms[f].info1.form_name, forms[f].info1.flags); @@ -1714,7 +1736,7 @@ NTSTATUS rpc_printer_migrate_forms_internals(struct net_context *c, info, &result); if (!W_ERROR_IS_OK(result)) { - d_printf("\tAddForm form %d: [%s] refused.\n", + d_printf(_("\tAddForm form %d: [%s] refused.\n"), f, forms[f].info1.form_name); continue; } @@ -1825,7 +1847,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, } if (num_printers == 0) { - printf ("no printers found on server.\n"); + printf (_("no printers found on server.\n")); nt_status = NT_STATUS_OK; goto done; } @@ -1847,7 +1869,7 @@ NTSTATUS rpc_printer_migrate_drivers_internals(struct net_context *c, get any real NT_STATUS-codes anymore from now on */ nt_status = NT_STATUS_UNSUCCESSFUL; - d_printf("migrating printer driver for: [%s] / [%s]\n", + d_printf(_("migrating printer driver for: [%s] / [%s]\n"), printername, sharename); /* open dst printer handle */ @@ -2014,7 +2036,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, } if (!num_printers) { - printf ("no printers found on server.\n"); + printf (_("no printers found on server.\n")); nt_status = NT_STATUS_OK; goto done; } @@ -2034,7 +2056,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, get any real NT_STATUS-codes anymore from now on */ nt_status = NT_STATUS_UNSUCCESSFUL; - d_printf("migrating printer queue for: [%s] / [%s]\n", + d_printf(_("migrating printer queue for: [%s] / [%s]\n"), printername, sharename); /* open dst printer handle */ @@ -2046,7 +2068,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, /* check for existing dst printer */ if (!net_spoolss_getprinter(pipe_hnd_dst, mem_ctx, &hnd_dst, level, &info_dst)) { - printf ("could not get printer, creating printer.\n"); + printf (_("could not get printer, creating printer.\n")); } else { DEBUG(1,("printer already exists: %s\n", sharename)); /* close printer handle here - dst only, not got src yet. */ @@ -2070,7 +2092,7 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, /* copy each src printer to a dst printer 1:1, maybe some values have to be changed though */ - d_printf("creating printer: %s\n", printername); + d_printf(_("creating printer: %s\n"), printername); info_ctr.level = level; info_ctr.info.info2 = (struct spoolss_SetPrinterInfo2 *) @@ -2081,11 +2103,14 @@ NTSTATUS rpc_printer_migrate_printers_internals(struct net_context *c, &info_ctr); if (W_ERROR_IS_OK(result)) - d_printf ("printer [%s] successfully added.\n", printername); + d_printf (_("printer [%s] successfully added.\n"), + printername); else if (W_ERROR_V(result) == W_ERROR_V(WERR_PRINTER_ALREADY_EXISTS)) - d_fprintf (stderr, "printer [%s] already exists.\n", printername); + d_fprintf (stderr, _("printer [%s] already exists.\n"), + printername); else { - d_fprintf (stderr, "could not create printer [%s]\n", printername); + d_fprintf (stderr, _("could not create printer [%s]\n"), + printername); goto done; } @@ -2178,7 +2203,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, } if (!num_printers) { - printf ("no printers found on server.\n"); + printf (_("no printers found on server.\n")); nt_status = NT_STATUS_OK; goto done; } @@ -2212,7 +2237,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, get any real NT_STATUS-codes anymore from now on */ nt_status = NT_STATUS_UNSUCCESSFUL; - d_printf("migrating printer settings for: [%s] / [%s]\n", + d_printf(_("migrating printer settings for: [%s] / [%s]\n"), printername, sharename); @@ -2365,7 +2390,7 @@ NTSTATUS rpc_printer_migrate_settings_internals(struct net_context *c, in case of an error */ if (!net_spoolss_enumprinterkey(pipe_hnd, mem_ctx, &hnd_src, "", &keylist)) { - printf("got no key-data\n"); + printf(_("got no key-data\n")); continue; } |