Mark more messages for translation. --- cfg.mk | 45 +++++++++++++++++++++++-------- po/POTFILES.in | 1 + src/interface/netcf_driver.c | 60 +++++++++++++++++++++++------------------- src/libvirt.c | 12 ++++---- src/nodeinfo.c | 2 +- src/test/test_driver.c | 12 ++++---- src/util/stats_linux.c | 4 +- src/xen/block_stats.c | 19 +++++++----- tools/virsh.c | 8 +++--- 9 files changed, 97 insertions(+), 66 deletions(-) diff --git a/cfg.mk b/cfg.mk index b87f261..d34a25e 100644 --- a/cfg.mk +++ b/cfg.mk @@ -168,49 +168,70 @@ sc_prohibit_gethostby: # |grep -vE '^(qsort|if|close|assert|fputc|free|N_|vir.*GetName|.*Unlock|virNodeListDevices|virHashRemoveEntry|freeaddrinfo|.*[fF]ree|xdrmem_create|xmlXPathFreeObject|virUUIDFormat|openvzSetProgramSentinal|polkit_action_unref)$' msg_gen_function = -msg_gen_function += ReportError msg_gen_function += ESX_ERROR msg_gen_function += ESX_VI_ERROR -msg_gen_function += remoteError +msg_gen_function += eventReportError +msg_gen_function += interfaceReportError msg_gen_function += lxcError +msg_gen_function += macvtapError msg_gen_function += networkReportError +msg_gen_function += nodeReportError msg_gen_function += oneError msg_gen_function += openvzError -msg_gen_function += qemudDispatchClientFailure -msg_gen_function += qemudReportError -msg_gen_function += regerror +msg_gen_function += pciReportError +msg_gen_function += PHYP_ERROR msg_gen_function += remoteDispatchFormatError +msg_gen_function += remoteError +msg_gen_function += statsErrorFunc +msg_gen_function += testError msg_gen_function += umlReportError +msg_gen_function += usbReportError +#msg_gen_function += vboxError +msg_gen_function += virCPUReportError msg_gen_function += virConfError msg_gen_function += virDomainReportError -msg_gen_function += virSecurityReportError -msg_gen_function += virHashError +msg_gen_function += virGenericReportError +msg_gen_function += virHookReportError +msg_gen_function += virInterfaceReportError +msg_gen_function += virJSONError msg_gen_function += virLibConnError +msg_gen_function += virLibConnWarning msg_gen_function += virLibDomainError +msg_gen_function += virLibNetworkError +msg_gen_function += virLibInterfaceError +msg_gen_function += virLibStoragePoolError +msg_gen_function += virLibStorageVolError +msg_gen_function += virLibNodeDeviceError +msg_gen_function += virLibSecretError +msg_gen_function += virLibNWFilterError msg_gen_function += virNetworkReportError msg_gen_function += virNodeDeviceReportError +msg_gen_function += virNWFilterReportError msg_gen_function += virProxyError msg_gen_function += virRaiseError +msg_gen_function += virRaiseErrorFull msg_gen_function += virReportErrorHelper msg_gen_function += virReportSystemError +msg_gen_function += virSecretReportError +msg_gen_function += virSecurityReportError msg_gen_function += virSexprError -msg_gen_function += virStorageLog +msg_gen_function += virStatsError msg_gen_function += virStorageReportError -msg_gen_function += virXMLError +msg_gen_function += virUtilError +msg_gen_function += virXendError msg_gen_function += virXenInotifyError msg_gen_function += virXenStoreError -msg_gen_function += virXendError -msg_gen_function += vshCloseLogFile +msg_gen_function += virXMLError msg_gen_function += xenapiSessionErrorHandler msg_gen_function += xenUnifiedError msg_gen_function += xenXMError + # Uncomment the following and run "make syntax-check" to see diagnostics # that are not yet marked for translation, but that need to be rewritten # so that they are translatable. # msg_gen_function += error # msg_gen_function += fprintf -# msg_gen_function += testError # msg_gen_function += virXenError # msg_gen_function += vshPrint # msg_gen_function += vshError diff --git a/po/POTFILES.in b/po/POTFILES.in index a952910..895c321 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -78,6 +78,7 @@ src/util/virterror.c src/util/xml.c src/vbox/vbox_driver.c src/vbox/vbox_tmpl.c +src/xen/block_stats.c src/xen/proxy_internal.c src/xen/xend_internal.c src/xen/xen_driver.c diff --git a/src/interface/netcf_driver.c b/src/interface/netcf_driver.c index dd36caf..22255b5 100644 --- a/src/interface/netcf_driver.c +++ b/src/interface/netcf_driver.c @@ -102,11 +102,12 @@ static struct netcf_if *interfaceDriverGetNetcfIF(struct netcf *ncf, virInterfac int errcode = ncf_error(ncf, &errmsg, &details); if (errcode != NETCF_NOERROR) { interfaceReportError(netcf_to_vir_err(errcode), - "couldn't find interface named '%s' (netcf: %s - %s)", - ifinfo->name, errmsg, details ? details : ""); + _("couldn't find interface named '%s' (netcf: %s - %s)"), + ifinfo->name, errmsg, details ? details : ""); } else { interfaceReportError(VIR_ERR_NO_INTERFACE, - "couldn't find interface named '%s'", ifinfo->name); + _("couldn't find interface named '%s'"), + ifinfo->name); } } return iface; @@ -182,9 +183,9 @@ static int interfaceNumOfInterfaces(virConnectPtr conn) const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "%s (netcf: %s - %s)", - _("failed to get number of interfaces on host"), - errmsg, details ? details : ""); + _("failed to get number of interfaces on host " + "(netcf: %s - %s)"), + errmsg, details ? details : ""); } interfaceDriverUnlock(driver); @@ -203,9 +204,8 @@ static int interfaceListInterfaces(virConnectPtr conn, char **const names, int n const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "%s (netcf: %s - %s)", - _("failed to list host interfaces"), - errmsg, details ? details : ""); + _("failed to list host interfaces (netcf: %s - %s)"), + errmsg, details ? details : ""); } interfaceDriverUnlock(driver); @@ -224,8 +224,8 @@ static int interfaceNumOfDefinedInterfaces(virConnectPtr conn) const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "%s (netcf: %s - %s)", - _("failed to get number of defined interfaces on host"), + _("failed to get number of defined interfaces on " + "host (netcf: %s - %s)"), errmsg, details ? details : ""); } @@ -245,9 +245,9 @@ static int interfaceListDefinedInterfaces(virConnectPtr conn, char **const names const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "%s (netcf: %s - %s)", - _("failed to list host defined interfaces"), - errmsg, details ? details : ""); + _("failed to list host defined interfaces " + "(netcf: %s - %s)"), + errmsg, details ? details : ""); } interfaceDriverUnlock(driver); @@ -269,11 +269,12 @@ static virInterfacePtr interfaceLookupByName(virConnectPtr conn, int errcode = ncf_error(driver->netcf, &errmsg, &details); if (errcode != NETCF_NOERROR) { interfaceReportError(netcf_to_vir_err(errcode), - "couldn't find interface named '%s' (netcf: %s - %s)", + _("couldn't find interface named '%s' " + "(netcf: %s - %s)"), name, errmsg, details ? details : ""); } else { interfaceReportError(VIR_ERR_NO_INTERFACE, - "couldn't find interface named '%s'", name); + _("couldn't find interface named '%s'"), name); } goto cleanup; } @@ -301,19 +302,20 @@ static virInterfacePtr interfaceLookupByMACString(virConnectPtr conn, const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "couldn't find interface with MAC address '%s' (netcf: %s - %s)", + _("couldn't find interface with MAC address '%s' " + "(netcf: %s - %s)"), macstr, errmsg, details ? details : ""); goto cleanup; } if (niface == 0) { interfaceReportError(VIR_ERR_NO_INTERFACE, - "couldn't find interface with MAC address '%s'", + _("couldn't find interface with MAC address '%s'"), macstr); goto cleanup; } if (niface > 1) { - interfaceReportError(VIR_ERR_MULTIPLE_INTERFACES, - "%s", _("multiple interfaces with matching MAC address")); + interfaceReportError(VIR_ERR_MULTIPLE_INTERFACES, "%s", + _("multiple interfaces with matching MAC address")); goto cleanup; } @@ -351,8 +353,9 @@ static char *interfaceGetXMLDesc(virInterfacePtr ifinfo, const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "could not get interface XML description (netcf: %s - %s)", - errmsg, details ? details : ""); + _("could not get interface XML description " + "(netcf: %s - %s)"), + errmsg, details ? details : ""); goto cleanup; } @@ -405,8 +408,9 @@ static virInterfacePtr interfaceDefineXML(virConnectPtr conn, const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "could not get interface XML description (netcf: %s - %s)", - errmsg, details ? details : ""); + _("could not get interface XML description " + "(netcf: %s - %s)"), + errmsg, details ? details : ""); goto cleanup; } @@ -438,7 +442,7 @@ static int interfaceUndefine(virInterfacePtr ifinfo) { const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "failed to undefine interface %s (netcf: %s - %s)", + _("failed to undefine interface %s (netcf: %s - %s)"), ifinfo->name, errmsg, details ? details : ""); goto cleanup; } @@ -469,7 +473,8 @@ static int interfaceCreate(virInterfacePtr ifinfo, const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "failed to create (start) interface %s (netcf: %s - %s)", + _("failed to create (start) interface %s " + "(netcf: %s - %s)"), ifinfo->name, errmsg, details ? details : ""); goto cleanup; } @@ -500,7 +505,8 @@ static int interfaceDestroy(virInterfacePtr ifinfo, const char *errmsg, *details; int errcode = ncf_error(driver->netcf, &errmsg, &details); interfaceReportError(netcf_to_vir_err(errcode), - "failed to destroy (stop) interface %s (netcf: %s - %s)", + _("failed to destroy (stop) interface %s " + "(netcf: %s - %s)"), ifinfo->name, errmsg, details ? details : ""); goto cleanup; } diff --git a/src/libvirt.c b/src/libvirt.c index 32da9c4..e9b41ba 100644 --- a/src/libvirt.c +++ b/src/libvirt.c @@ -1019,7 +1019,7 @@ do_open (const char *name, if (res == VIR_DRV_OPEN_ERROR) { if (STREQ(virNetworkDriverTab[i]->name, "remote")) { virLibConnWarning(VIR_WAR_NO_NETWORK, - "Is the daemon running ?"); + _("Is the daemon running ?")); } break; } else if (res == VIR_DRV_OPEN_SUCCESS) { @@ -1038,7 +1038,7 @@ do_open (const char *name, if (res == VIR_DRV_OPEN_ERROR) { if (STREQ(virInterfaceDriverTab[i]->name, "remote")) { virLibConnWarning(VIR_WAR_NO_INTERFACE, - "Is the daemon running ?"); + _("Is the daemon running ?")); } break; } else if (res == VIR_DRV_OPEN_SUCCESS) { @@ -1058,7 +1058,7 @@ do_open (const char *name, if (res == VIR_DRV_OPEN_ERROR) { if (STREQ(virStorageDriverTab[i]->name, "remote")) { virLibConnWarning(VIR_WAR_NO_STORAGE, - "Is the daemon running ?"); + _("Is the daemon running ?")); } break; } else if (res == VIR_DRV_OPEN_SUCCESS) { @@ -1078,10 +1078,10 @@ do_open (const char *name, if (res == VIR_DRV_OPEN_ERROR) { if (STREQ(virDeviceMonitorTab[i]->name, "remote")) { virLibConnWarning(VIR_WAR_NO_NODE, - "Is the libvirtd daemon running ?"); + _("Is the libvirtd daemon running ?")); } else { char *msg; - if (virAsprintf(&msg, "Is the %s daemon running?", + if (virAsprintf(&msg, _("Is the %s daemon running?"), virDeviceMonitorTab[i]->name) > 0) { virLibConnWarning(VIR_WAR_NO_NODE, msg); VIR_FREE(msg); @@ -1105,7 +1105,7 @@ do_open (const char *name, if (res == VIR_DRV_OPEN_ERROR) { if (STREQ(virSecretDriverTab[i]->name, "remote")) { virLibConnWarning(VIR_WAR_NO_SECRET, - "Is the daemon running ?"); + _("Is the daemon running ?")); } break; } else if (res == VIR_DRV_OPEN_SUCCESS) { diff --git a/src/nodeinfo.c b/src/nodeinfo.c index 4e1b69f..dee092b 100644 --- a/src/nodeinfo.c +++ b/src/nodeinfo.c @@ -206,7 +206,7 @@ int linuxNodeInfoCPUPopulate(FILE *cpuinfo, buf++; if (*buf != ':' || !buf[1]) { nodeReportError(VIR_ERR_INTERNAL_ERROR, - "parsing cpuinfo cpu cores %c", *buf); + _("parsing cpuinfo cpu cores %c"), *buf); return -1; } if (virStrToLong_ui(buf+1, &p, 10, &id) == 0 diff --git a/src/test/test_driver.c b/src/test/test_driver.c index 2ceff0e..cac7694 100644 --- a/src/test/test_driver.c +++ b/src/test/test_driver.c @@ -2058,7 +2058,7 @@ static int testSetVcpus(virDomainPtr domain, /* We allow more cpus in guest than host */ if (nrCpus > maxvcpus) { testError(VIR_ERR_INVALID_ARG, - "requested cpu amount exceeds maximum (%d > %d)", + _("requested cpu amount exceeds maximum (%d > %d)"), nrCpus, maxvcpus); goto cleanup; } @@ -2511,7 +2511,7 @@ static int testDomainGetSchedulerParams(virDomainPtr domain, } if (*nparams != 1) { - testError(VIR_ERR_INVALID_ARG, "nparams"); + testError(VIR_ERR_INVALID_ARG, "%s", _("nparams")); goto cleanup; } strcpy(params[0].field, "weight"); @@ -2547,15 +2547,15 @@ static int testDomainSetSchedulerParams(virDomainPtr domain, } if (nparams != 1) { - testError(VIR_ERR_INVALID_ARG, "nparams"); + testError(VIR_ERR_INVALID_ARG, "%s", _("nparams")); goto cleanup; } if (STRNEQ(params[0].field, "weight")) { - testError(VIR_ERR_INVALID_ARG, "field"); + testError(VIR_ERR_INVALID_ARG, "%s", _("field")); goto cleanup; } if (params[0].type != VIR_DOMAIN_SCHED_FIELD_UINT) { - testError(VIR_ERR_INVALID_ARG, "type"); + testError(VIR_ERR_INVALID_ARG, "%s", _("type")); goto cleanup; } /* XXX */ @@ -3744,7 +3744,7 @@ testStorageFindPoolSources(virConnectPtr conn ATTRIBUTE_UNUSED, case VIR_STORAGE_POOL_NETFS: if (!source || !source->host.name) { testError(VIR_ERR_INVALID_ARG, - "%s", "hostname must be specified for netfs sources"); + "%s", _("hostname must be specified for netfs sources")); goto cleanup; } diff --git a/src/util/stats_linux.c b/src/util/stats_linux.c index da9649d..69b815f 100644 --- a/src/util/stats_linux.c +++ b/src/util/stats_linux.c @@ -105,8 +105,8 @@ linuxDomainInterfaceStats(const char *path, } fclose (fp); - virStatsError(VIR_ERR_INTERNAL_ERROR, - "/proc/net/dev: Interface not found"); + virStatsError(VIR_ERR_INTERNAL_ERROR, "%s", + _("/proc/net/dev: Interface not found")); return -1; } diff --git a/src/xen/block_stats.c b/src/xen/block_stats.c index 13f6fff..aaab0a7 100644 --- a/src/xen/block_stats.c +++ b/src/xen/block_stats.c @@ -180,7 +180,7 @@ read_bd_stats(xenUnifiedPrivatePtr priv, stats->wr_req == -1 && stats->wr_bytes == -1 && stats->errs == -1) { statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "Failed to read any block statistics", domid); + _("Failed to read any block statistics"), domid); return -1; } @@ -193,7 +193,7 @@ read_bd_stats(xenUnifiedPrivatePtr priv, stats->errs == 0 && !check_bd_connected (priv, device, domid)) { statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "Frontend block device not connected", domid); + _("Frontend block device not connected"), domid); return -1; } @@ -203,7 +203,7 @@ read_bd_stats(xenUnifiedPrivatePtr priv, if (stats->rd_bytes > 0) { if (stats->rd_bytes >= ((unsigned long long)1)<<(63-9)) { statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "stats->rd_bytes would overflow 64 bit counter", + _("stats->rd_bytes would overflow 64 bit counter"), domid); return -1; } @@ -212,7 +212,7 @@ read_bd_stats(xenUnifiedPrivatePtr priv, if (stats->wr_bytes > 0) { if (stats->wr_bytes >= ((unsigned long long)1)<<(63-9)) { statsErrorFunc(VIR_ERR_INTERNAL_ERROR, __FUNCTION__, - "stats->wr_bytes would overflow 64 bit counter", + _("stats->wr_bytes would overflow 64 bit counter"), domid); return -1; } @@ -332,19 +332,22 @@ xenLinuxDomainDeviceID(int domid, const char *path) */ else if (strlen(mod_path) >= 7 && STRPREFIX(mod_path, "/dev/sd")) statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, - "invalid path, device names must be in the range sda[1-15] - sdiv[1-15]", + _("invalid path, device names must be in the range " + "sda[1-15] - sdiv[1-15]"), domid); else if (strlen(mod_path) >= 7 && STRPREFIX(mod_path, "/dev/hd")) statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, - "invalid path, device names must be in the range hda[1-63] - hdt[1-63]", + _("invalid path, device names must be in the range " + "hda[1-63] - hdt[1-63]"), domid); else if (strlen(mod_path) >= 8 && STRPREFIX(mod_path, "/dev/xvd")) statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, - "invalid path, device names must be in the range xvda[1-15] - xvdiz[1-15]", + _("invalid path, device names must be in the range " + "xvda[1-15] - xvdiz[1-15]"), domid); else statsErrorFunc(VIR_ERR_INVALID_ARG, __FUNCTION__, - "unsupported path, use xvdN, hdN, or sdN", domid); + _("unsupported path, use xvdN, hdN, or sdN"), domid); VIR_FREE(mod_path); diff --git a/tools/virsh.c b/tools/virsh.c index ca1a003..b4b1991 100644 --- a/tools/virsh.c +++ b/tools/virsh.c @@ -6553,7 +6553,7 @@ cmdNodeDeviceDumpXML (vshControl *ctl, const vshCmd *cmd) if (!(name = vshCommandOptString(cmd, "device", NULL))) return FALSE; if (!(device = virNodeDeviceLookupByName(ctl->conn, name))) { - vshError(ctl, "%s '%s'", _("Could not find matching device"), name); + vshError(ctl, _("Could not find matching device '%s'"), name); return FALSE; } @@ -6596,7 +6596,7 @@ cmdNodeDeviceDettach (vshControl *ctl, const vshCmd *cmd) if (!(name = vshCommandOptString(cmd, "device", NULL))) return FALSE; if (!(device = virNodeDeviceLookupByName(ctl->conn, name))) { - vshError(ctl, "%s '%s'", _("Could not find matching device"), name); + vshError(ctl, _("Could not find matching device '%s'"), name); return FALSE; } @@ -6637,7 +6637,7 @@ cmdNodeDeviceReAttach (vshControl *ctl, const vshCmd *cmd) if (!(name = vshCommandOptString(cmd, "device", NULL))) return FALSE; if (!(device = virNodeDeviceLookupByName(ctl->conn, name))) { - vshError(ctl, "%s '%s'", _("Could not find matching device"), name); + vshError(ctl, _("Could not find matching device '%s'"), name); return FALSE; } @@ -6678,7 +6678,7 @@ cmdNodeDeviceReset (vshControl *ctl, const vshCmd *cmd) if (!(name = vshCommandOptString(cmd, "device", NULL))) return FALSE; if (!(device = virNodeDeviceLookupByName(ctl->conn, name))) { - vshError(ctl, "%s '%s'", _("Could not find matching device"), name); + vshError(ctl, _("Could not find matching device '%s'"), name); return FALSE; } -- 1.6.3.3 -- libvir-list mailing list libvir-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libvir-list