From: "Zeeshan Ali (Khattak)" <zeeshanak@xxxxxxxxx> Make some strings more translator-friendly at the same time. --- osinfo/osinfo_deployment.c | 5 ++- osinfo/osinfo_devicelink.c | 3 +- osinfo/osinfo_devicelinkfilter.c | 3 +- osinfo/osinfo_entity.c | 3 +- osinfo/osinfo_install_config_param.c | 5 ++- osinfo/osinfo_install_script.c | 43 ++++++++++---------- osinfo/osinfo_list.c | 3 +- osinfo/osinfo_loader.c | 30 +++++++------- osinfo/osinfo_media.c | 41 ++++++++++--------- osinfo/osinfo_os.c | 5 ++- osinfo/osinfo_product.c | 13 +++--- osinfo/osinfo_resources.c | 11 ++--- osinfo/osinfo_tree.c | 23 ++++++----- po/POTFILES.in | 18 ++++++++ tools/osinfo-db-validate.c | 24 ++++++----- tools/osinfo-detect.c | 35 ++++++++-------- tools/osinfo-install-script.c | 22 +++++----- tools/osinfo-query.c | 79 ++++++++++++++++++------------------ 18 files changed, 200 insertions(+), 166 deletions(-) diff --git a/osinfo/osinfo_deployment.c b/osinfo/osinfo_deployment.c index 709c8c6..d69fd81 100644 --- a/osinfo/osinfo_deployment.c +++ b/osinfo/osinfo_deployment.c @@ -25,6 +25,7 @@ #include <config.h> #include <osinfo/osinfo.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoDeployment, osinfo_deployment, OSINFO_TYPE_ENTITY); @@ -150,7 +151,7 @@ osinfo_deployment_class_init (OsinfoDeploymentClass *klass) */ pspec = g_param_spec_object("os", "Os", - "Operating system", + _("Operating system"), OSINFO_TYPE_OS, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | @@ -167,7 +168,7 @@ osinfo_deployment_class_init (OsinfoDeploymentClass *klass) */ pspec = g_param_spec_object("platform", "Platform", - "Virtualization platform", + _("Virtualization platform"), OSINFO_TYPE_PLATFORM, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | diff --git a/osinfo/osinfo_devicelink.c b/osinfo/osinfo_devicelink.c index 67e0037..1ae75e2 100644 --- a/osinfo/osinfo_devicelink.c +++ b/osinfo/osinfo_devicelink.c @@ -25,6 +25,7 @@ #include <config.h> #include <osinfo/osinfo.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoDeviceLink, osinfo_devicelink, OSINFO_TYPE_ENTITY); @@ -125,7 +126,7 @@ osinfo_devicelink_class_init (OsinfoDeviceLinkClass *klass) */ pspec = g_param_spec_object("target", "Target", - "Target device", + _("Target device"), OSINFO_TYPE_DEVICE, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | diff --git a/osinfo/osinfo_devicelinkfilter.c b/osinfo/osinfo_devicelinkfilter.c index 690394e..371bb63 100644 --- a/osinfo/osinfo_devicelinkfilter.c +++ b/osinfo/osinfo_devicelinkfilter.c @@ -25,6 +25,7 @@ #include <config.h> #include <osinfo/osinfo.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoDeviceLinkFilter, osinfo_devicelinkfilter, OSINFO_TYPE_FILTER); @@ -130,7 +131,7 @@ osinfo_devicelinkfilter_class_init (OsinfoDeviceLinkFilterClass *klass) */ pspec = g_param_spec_object("target-filter", "Target Filter", - "Device link target filter", + _("Device link target filter"), OSINFO_TYPE_FILTER, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | diff --git a/osinfo/osinfo_entity.c b/osinfo/osinfo_entity.c index fcfec6a..33c73ea 100644 --- a/osinfo/osinfo_entity.c +++ b/osinfo/osinfo_entity.c @@ -25,6 +25,7 @@ #include <config.h> #include <osinfo/osinfo.h> +#include <glib/gi18n-lib.h> G_DEFINE_ABSTRACT_TYPE (OsinfoEntity, osinfo_entity, G_TYPE_OBJECT); @@ -132,7 +133,7 @@ osinfo_entity_class_init (OsinfoEntityClass *klass) */ pspec = g_param_spec_string ("id", "ID", - "Unique identifier", + _("Unique identifier"), NULL /* default value */, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | diff --git a/osinfo/osinfo_install_config_param.c b/osinfo/osinfo_install_config_param.c index 7e1e3fc..40d59b4 100644 --- a/osinfo/osinfo_install_config_param.c +++ b/osinfo/osinfo_install_config_param.c @@ -24,6 +24,7 @@ #include <config.h> #include <osinfo/osinfo.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoInstallConfigParam, osinfo_install_config_param, OSINFO_TYPE_ENTITY); @@ -137,7 +138,7 @@ osinfo_install_config_param_class_init (OsinfoInstallConfigParamClass *klass) **/ pspec = g_param_spec_string("name", "Name", - "Parameter name", + _("Parameter name"), NULL, G_PARAM_WRITABLE | G_PARAM_READABLE | @@ -155,7 +156,7 @@ osinfo_install_config_param_class_init (OsinfoInstallConfigParamClass *klass) **/ pspec = g_param_spec_string("policy", "Policy", - "Parameter policy", + _("Parameter policy"), NULL, G_PARAM_WRITABLE | G_PARAM_READABLE | diff --git a/osinfo/osinfo_install_script.c b/osinfo/osinfo_install_script.c index cc75153..0248f52 100644 --- a/osinfo/osinfo_install_script.c +++ b/osinfo/osinfo_install_script.c @@ -29,6 +29,7 @@ #include <libxslt/transform.h> #include <libxslt/xsltutils.h> #include <libxslt/xsltInternals.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoInstallScript, osinfo_install_script, OSINFO_TYPE_ENTITY); @@ -168,7 +169,7 @@ osinfo_install_script_class_init (OsinfoInstallScriptClass *klass) pspec = g_param_spec_string("template-uri", "TemplateURI", - "URI for install script template", + _("URI for install script template"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_WRITABLE | @@ -182,7 +183,7 @@ osinfo_install_script_class_init (OsinfoInstallScriptClass *klass) pspec = g_param_spec_string("template-data", "TemplateData", - "Data for install script template", + _("Data for install script template"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_WRITABLE | @@ -196,7 +197,7 @@ osinfo_install_script_class_init (OsinfoInstallScriptClass *klass) pspec = g_param_spec_string("profile", "Profile", - "Install script profile name", + _("Install script profile name"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_WRITABLE | @@ -210,7 +211,7 @@ osinfo_install_script_class_init (OsinfoInstallScriptClass *klass) pspec = g_param_spec_string("product-key-format", "Product Key Format", - "Product key format mask", + _("Product key format mask"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | @@ -469,7 +470,7 @@ static xsltStylesheetPtr osinfo_install_script_load_template(const gchar *uri, pctxt = xmlNewParserCtxt(); if (!pctxt || !pctxt->sax) { g_set_error(error, 0, 0, "%s", - "Unable to create XML parser context"); + _("Unable to create XML parser context")); goto cleanup; } @@ -477,13 +478,13 @@ static xsltStylesheetPtr osinfo_install_script_load_template(const gchar *uri, XML_PARSE_NOENT | XML_PARSE_NONET | XML_PARSE_NOWARNING))) { g_set_error(error, 0, 0, "%s", - "Unable to read XSL template"); + _("Unable to read XSL template")); goto cleanup; } if (!(xslt = xsltParseStylesheetDoc(doc))) { g_set_error(error, 0, 0, "%s", - "Unable to parse XSL template"); + _("Unable to parse XSL template")); goto cleanup; } @@ -504,7 +505,7 @@ static xmlNodePtr osinfo_install_script_generate_entity_config(OsinfoInstallConf if (!(node = xmlNewDocNode(NULL, NULL, (xmlChar*)name, NULL))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to create XML node '%s': '%s'", + g_set_error(error, 0, 0, _("Unable to create XML node '%s': '%s'"), name, err ? err->message : ""); goto error; } @@ -512,13 +513,13 @@ static xmlNodePtr osinfo_install_script_generate_entity_config(OsinfoInstallConf if (!(data = xmlNewDocNode(NULL, NULL, (const xmlChar*)"id", (const xmlChar*)osinfo_entity_get_id(entity)))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to create XML node 'id': '%s'", + g_set_error(error, 0, 0, _("Unable to create XML node 'id': '%s'"), err ? err->message : ""); goto error; } if (!(xmlAddChild(node, data))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to add XML child '%s'", err ? err->message : ""); + g_set_error(error, 0, 0, _("Unable to add XML child '%s'"), err ? err->message : ""); goto error; } data = NULL; @@ -532,13 +533,13 @@ static xmlNodePtr osinfo_install_script_generate_entity_config(OsinfoInstallConf if (!(data = xmlNewDocNode(NULL, NULL, (const xmlChar*)tmp1->data, (const xmlChar*)tmp2->data))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to create XML node '%s': '%s'", + g_set_error(error, 0, 0, _("Unable to create XML node '%s': '%s'"), (const gchar *)tmp1->data, err ? err->message : ""); goto error; } if (!(xmlAddChild(node, data))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to add XML child '%s'", err ? err->message : ""); + g_set_error(error, 0, 0, _("Unable to add XML child '%s'"), err ? err->message : ""); goto error; } data = NULL; @@ -582,7 +583,7 @@ static xmlDocPtr osinfo_install_script_generate_config_xml(OsinfoInstallScript * goto error; if (!(xmlAddChild(root, node))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to set XML root '%s'", err ? err->message : ""); + g_set_error(error, 0, 0, _("Unable to set XML root '%s'"), err ? err->message : ""); goto error; } @@ -593,7 +594,7 @@ static xmlDocPtr osinfo_install_script_generate_config_xml(OsinfoInstallScript * goto error; if (!(xmlAddChild(root, node))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to set XML root '%s'", err ? err->message : ""); + g_set_error(error, 0, 0, _("Unable to set XML root '%s'"), err ? err->message : ""); goto error; } @@ -604,7 +605,7 @@ static xmlDocPtr osinfo_install_script_generate_config_xml(OsinfoInstallScript * goto error; if (!(xmlAddChild(root, node))) { xmlErrorPtr err = xmlGetLastError(); - g_set_error(error, 0, 0, "Unable to set XML root '%s'", err ? err->message : ""); + g_set_error(error, 0, 0, _("Unable to set XML root '%s'"), err ? err->message : ""); goto error; } @@ -626,17 +627,17 @@ static gchar *osinfo_install_script_apply_xslt(xsltStylesheetPtr ss, int len; if (!(ctxt = xsltNewTransformContext(ss, doc))) { - g_set_error(error, 0, 0, "%s", "Unable to create XSL transform context"); + g_set_error(error, 0, 0, "%s", _("Unable to create XSL transform context")); goto cleanup; } if (!(docOut = xsltApplyStylesheetUser(ss, doc, NULL, NULL, NULL, ctxt))) { - g_set_error(error, 0, 0, "%s", "Unable to apply XSL transform context"); + g_set_error(error, 0, 0, "%s", _("Unable to apply XSL transform context")); goto cleanup; } if (xsltSaveResultToString((xmlChar **)&ret, &len, docOut, ss) < 0) { - g_set_error(error, 0, 0, "%s", "Unable to convert XSL output to string"); + g_set_error(error, 0, 0, "%s", _("Unable to convert XSL output to string")); goto cleanup; } @@ -692,7 +693,7 @@ static void osinfo_install_script_template_loaded(GObject *src, &length, NULL, &error)) { - g_prefix_error(&error, "Failed to load script template %s: ", uri); + g_prefix_error(&error, _("Failed to load script template %s: "), uri); g_simple_async_result_take_error(data->res, error); goto cleanup; } @@ -705,7 +706,7 @@ static void osinfo_install_script_template_loaded(GObject *src, &output, data->config, &error)) { - g_prefix_error(&error, "Failed to apply script template %s: ", uri); + g_prefix_error(&error, _("Failed to apply script template %s: "), uri); g_simple_async_result_take_error(data->res, error); goto cleanup; } @@ -749,7 +750,7 @@ void osinfo_install_script_generate_async(OsinfoInstallScript *script, &output, data->config, &error)) { - g_prefix_error(&error, "%s", "Failed to apply script template: "); + g_prefix_error(&error, "%s", _("Failed to apply script template: ")); g_simple_async_result_take_error(data->res, error); g_simple_async_result_complete(data->res); osinfo_install_script_generate_data_free(data); diff --git a/osinfo/osinfo_list.c b/osinfo/osinfo_list.c index ba3f117..d161f10 100644 --- a/osinfo/osinfo_list.c +++ b/osinfo/osinfo_list.c @@ -25,6 +25,7 @@ #include <config.h> #include <osinfo/osinfo.h> +#include <glib/gi18n-lib.h> G_DEFINE_ABSTRACT_TYPE (OsinfoList, osinfo_list, G_TYPE_OBJECT); @@ -127,7 +128,7 @@ osinfo_list_class_init (OsinfoListClass *klass) */ pspec = g_param_spec_gtype("element-type", "Element type", - "List element type", + _("List element type"), OSINFO_TYPE_ENTITY, G_PARAM_CONSTRUCT_ONLY | G_PARAM_READWRITE | diff --git a/osinfo/osinfo_loader.c b/osinfo/osinfo_loader.c index ae90637..2bd85bf 100644 --- a/osinfo/osinfo_loader.c +++ b/osinfo/osinfo_loader.c @@ -23,7 +23,6 @@ */ #include <config.h> -#include <glib/gi18n-lib.h> #include <osinfo/osinfo.h> @@ -34,6 +33,7 @@ #include <libxml/tree.h> #include <libxml/xpath.h> #include <libxml/xmlreader.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoLoader, osinfo_loader, G_TYPE_OBJECT); @@ -270,7 +270,7 @@ static void osinfo_loader_entity(OsinfoLoader *loader, if (!param->children || param->children->type != XML_TEXT_NODE) { - OSINFO_ERROR(err, "Expected a text node attribute value"); + OSINFO_ERROR(err, _("Expected a text node attribute value")); goto cleanup; } @@ -349,7 +349,7 @@ static void osinfo_loader_device(OsinfoLoader *loader, NULL, }; if (!id) { - OSINFO_ERROR(err, "Missing device id property"); + OSINFO_ERROR(err, _("Missing device id property")); return; } @@ -379,7 +379,7 @@ static void osinfo_loader_device_link(OsinfoLoader *loader, }; gchar *id = (gchar *)xmlGetProp(related[i], BAD_CAST "id"); if (!id) { - OSINFO_ERROR(err, "Missing device link id property"); + OSINFO_ERROR(err, _("Missing device link id property")); goto cleanup; } OsinfoDevice *dev = osinfo_loader_get_device(loader, id); @@ -423,7 +423,7 @@ static void osinfo_loader_product_relshp(OsinfoLoader *loader, for (i = 0 ; i < nrelated ; i++) { gchar *id = (gchar *)xmlGetProp(related[i], BAD_CAST "id"); if (!id) { - OSINFO_ERROR(err, "Missing product upgrades id property"); + OSINFO_ERROR(err, _("Missing product upgrades id property")); goto cleanup; } OsinfoProduct *relproduct; @@ -498,7 +498,7 @@ static void osinfo_loader_platform(OsinfoLoader *loader, NULL, }; if (!id) { - OSINFO_ERROR(err, "Missing platform id property"); + OSINFO_ERROR(err, _("Missing platform id property")); return; } @@ -529,13 +529,13 @@ static void osinfo_loader_deployment(OsinfoLoader *loader, NULL }; if (!id) { - OSINFO_ERROR(err, "Missing deployment id property"); + OSINFO_ERROR(err, _("Missing deployment id property")); return; } gchar *osid = osinfo_loader_string("string(./os/@id)", ctxt, err); if (!osid && 0) { - OSINFO_ERROR(err, "Missing deployment os id property"); + OSINFO_ERROR(err, _("Missing deployment os id property")); g_free(id); return; } @@ -544,7 +544,7 @@ static void osinfo_loader_deployment(OsinfoLoader *loader, gchar *platformid = osinfo_loader_string("string(./platform/@id)", ctxt, err); if (!platformid) { - OSINFO_ERROR(err, "Missing deployment platform id property"); + OSINFO_ERROR(err, _("Missing deployment platform id property")); g_free(id); return; } @@ -610,7 +610,7 @@ static void osinfo_loader_install_script(OsinfoLoader *loader, gchar *value = NULL; if (!id) { - OSINFO_ERROR(err, "Missing install script id property"); + OSINFO_ERROR(err, _("Missing install script id property")); return; } @@ -883,7 +883,7 @@ static void osinfo_loader_os(OsinfoLoader *loader, NULL }; if (!id) { - OSINFO_ERROR(err, "Missing os id property"); + OSINFO_ERROR(err, _("Missing os id property")); return; } @@ -969,7 +969,7 @@ static void osinfo_loader_os(OsinfoLoader *loader, for (i = 0 ; i < nnodes ; i++) { gchar *scriptid = (gchar *)xmlGetProp(nodes[i], BAD_CAST "id"); if (!scriptid) { - OSINFO_ERROR(err, "Missing OS install script property"); + OSINFO_ERROR(err, _("Missing OS install script property")); g_free(nodes); goto cleanup; } @@ -1019,7 +1019,7 @@ static void osinfo_loader_root(OsinfoLoader *loader, int ninstallScript; if (!xmlStrEqual(root->name, BAD_CAST "libosinfo")) { - OSINFO_ERROR(err, "Incorrect root element"); + OSINFO_ERROR(err, _("Incorrect root element")); return; } @@ -1127,7 +1127,7 @@ static void osinfo_loader_process_xml(OsinfoLoader *loader, /* Set up a parser context so we can catch the details of XML errors. */ pctxt = xmlNewParserCtxt(); if (!pctxt || !pctxt->sax) { - OSINFO_ERROR(err, "Unable to construct parser context"); + OSINFO_ERROR(err, _("Unable to construct parser context")); goto cleanup; } @@ -1149,7 +1149,7 @@ static void osinfo_loader_process_xml(OsinfoLoader *loader, root = xmlDocGetRootElement(xml); if (!root) { - OSINFO_ERROR(err, "Missing root element"); + OSINFO_ERROR(err, _("Missing root XML element")); goto cleanup; } diff --git a/osinfo/osinfo_media.c b/osinfo/osinfo_media.c index 10eeffb..74f745c 100644 --- a/osinfo/osinfo_media.c +++ b/osinfo/osinfo_media.c @@ -29,6 +29,7 @@ #include <gio/gio.h> #include <stdlib.h> #include <string.h> +#include <glib/gi18n-lib.h> #define MAX_VOLUME 32 #define MAX_SYSTEM 32 @@ -333,7 +334,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("architecture", "ARCHITECTURE", - "CPU Architecture", + _("CPU Architecture"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -348,7 +349,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("url", "URL", - "The URL to this media", + _("The URL to this media"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -363,7 +364,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("volume-id", "VolumeID", - "Expected ISO9660 volume ID", + _("The expected ISO9660 volume ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -378,7 +379,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("publisher-id", "PublisherID", - "Expected ISO9660 publisher ID", + _("The expected ISO9660 publisher ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -393,7 +394,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("application-id", "ApplicationID", - "Expected ISO9660 application ID", + _("The expected ISO9660 application ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -408,7 +409,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("system-id", "SystemID", - "Expected ISO9660 system ID", + _("The expected ISO9660 system ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -423,7 +424,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("kernel-path", "KernelPath", - "The path to the kernel image", + _("The path to the kernel image"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -438,7 +439,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_string ("initrd-path", "InitrdPath", - "The path to the inirtd image", + _("The path to the inirtd image"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -453,7 +454,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_boolean ("installer", "Installer", - "Media provides a installer", + _("Media provides a installer"), TRUE /* default value */, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | /* to set default value */ @@ -469,7 +470,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_boolean ("live", "Live", - "Media can boot directly w/o installation", + _("Media can boot directly w/o installation"), FALSE /* default value */, G_PARAM_READWRITE | G_PARAM_CONSTRUCT | /* to set default value */ @@ -494,7 +495,7 @@ osinfo_media_class_init (OsinfoMediaClass *klass) */ pspec = g_param_spec_int ("installer-reboots", "InstallerReboots", - "Number of installer reboots", + _("Number of installer reboots"), G_MININT, G_MAXINT, -1 /* default value */, @@ -613,14 +614,14 @@ static void on_svd_read (GObject *source, &error); if (ret < 0) { g_prefix_error(&error, - "Failed to read supplementary volume descriptor: "); + _("Failed to read supplementary volume descriptor: ")); goto EXIT; } if (ret == 0) { g_set_error(&error, OSINFO_MEDIA_ERROR, OSINFO_MEDIA_ERROR_NO_SVD, - "Supplementary volume descriptor was truncated"); + _("Supplementary volume descriptor was truncated")); goto EXIT; } @@ -643,7 +644,7 @@ static void on_svd_read (GObject *source, g_set_error(&error, OSINFO_MEDIA_ERROR, OSINFO_MEDIA_ERROR_NOT_BOOTABLE, - "Install media is not bootable"); + _("Install media is not bootable")); goto EXIT; } @@ -699,14 +700,14 @@ static void on_pvd_read (GObject *source, res, &error); if (ret < 0) { - g_prefix_error(&error, "Failed to read primary volume descriptor: "); + g_prefix_error(&error, _("Failed to read primary volume descriptor: ")); goto ON_ERROR; } if (ret == 0) { g_set_error(&error, OSINFO_MEDIA_ERROR, OSINFO_MEDIA_ERROR_NO_PVD, - "Primary volume descriptor was truncated"); + _("Primary volume descriptor was truncated")); goto ON_ERROR; } @@ -731,7 +732,7 @@ static void on_pvd_read (GObject *source, g_set_error(&error, OSINFO_MEDIA_ERROR, OSINFO_MEDIA_ERROR_INSUFFICIENT_METADATA, - "Insufficient metadata on installation media"); + _("Insufficient metadata on installation media")); goto ON_ERROR; } @@ -766,12 +767,12 @@ static void on_location_skipped(GObject *source, if (g_input_stream_skip_finish(stream, res, &error) < PVD_OFFSET) { if (error) - g_prefix_error(&error, "Failed to skip %d bytes", PVD_OFFSET); + g_prefix_error(&error, _("Failed to skip %d bytes"), PVD_OFFSET); else g_set_error(&error, OSINFO_MEDIA_ERROR, OSINFO_MEDIA_ERROR_NO_DESCRIPTORS, - "No volume descriptors"); + _("No volume descriptors")); g_simple_async_result_take_error(data->res, error); g_simple_async_result_complete (data->res); create_from_location_async_data_free(data); @@ -803,7 +804,7 @@ static void on_location_read(GObject *source, stream = g_file_read_finish(G_FILE(source), res, &error); if (error != NULL) { - g_prefix_error(&error, "Failed to open file"); + g_prefix_error(&error, _("Failed to open file")); g_simple_async_result_take_error(data->res, error); g_simple_async_result_complete (data->res); create_from_location_async_data_free(data); diff --git a/osinfo/osinfo_os.c b/osinfo/osinfo_os.c index 3dd65c7..18a1458 100644 --- a/osinfo/osinfo_os.c +++ b/osinfo/osinfo_os.c @@ -25,6 +25,7 @@ #include <config.h> #include <osinfo/osinfo.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoOs, osinfo_os, OSINFO_TYPE_PRODUCT); @@ -137,7 +138,7 @@ osinfo_os_class_init (OsinfoOsClass *klass) */ pspec = g_param_spec_string ("family", "Family", - "Generic Family", + _("Generic Family"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | @@ -155,7 +156,7 @@ osinfo_os_class_init (OsinfoOsClass *klass) */ pspec = g_param_spec_string ("distro", "Distro", - "Generic Distro", + _("Generic Distro"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | diff --git a/osinfo/osinfo_product.c b/osinfo/osinfo_product.c index f330209..bf3c049 100644 --- a/osinfo/osinfo_product.c +++ b/osinfo/osinfo_product.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include <string.h> +#include <glib/gi18n-lib.h> G_DEFINE_ABSTRACT_TYPE (OsinfoProduct, osinfo_product, OSINFO_TYPE_ENTITY); @@ -161,7 +162,7 @@ osinfo_product_class_init (OsinfoProductClass *klass) */ pspec = g_param_spec_string ("name", "Name", - "Name", + _("Name"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | @@ -176,7 +177,7 @@ osinfo_product_class_init (OsinfoProductClass *klass) */ pspec = g_param_spec_string ("short-id", "ShortID", - "Short ID", + _("Short ID"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | @@ -191,7 +192,7 @@ osinfo_product_class_init (OsinfoProductClass *klass) */ pspec = g_param_spec_string ("vendor", "Vendor", - "Vendor", + _("Vendor"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | @@ -206,7 +207,7 @@ osinfo_product_class_init (OsinfoProductClass *klass) */ pspec = g_param_spec_string ("version", "Version", - "Version", + _("Version"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | @@ -221,7 +222,7 @@ osinfo_product_class_init (OsinfoProductClass *klass) */ pspec = g_param_spec_string ("codename", "Codename", - "Codename", + _("Codename"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | @@ -236,7 +237,7 @@ osinfo_product_class_init (OsinfoProductClass *klass) */ pspec = g_param_spec_string ("logo", "Logo", - "URI of the logo", + _("URI of the logo"), NULL /* default value */, G_PARAM_READABLE | G_PARAM_STATIC_NAME | diff --git a/osinfo/osinfo_resources.c b/osinfo/osinfo_resources.c index 29f62bd..cfd2340 100644 --- a/osinfo/osinfo_resources.c +++ b/osinfo/osinfo_resources.c @@ -29,6 +29,7 @@ #include <gio/gio.h> #include <stdlib.h> #include <string.h> +#include <glib/gi18n-lib.h> G_DEFINE_TYPE (OsinfoResources, osinfo_resources, OSINFO_TYPE_ENTITY); @@ -166,7 +167,7 @@ osinfo_resources_class_init (OsinfoResourcesClass *klass) */ pspec = g_param_spec_string ("architecture", "ARCHITECTURE", - "CPU Architecture", + _("CPU Architecture"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY | @@ -184,7 +185,7 @@ osinfo_resources_class_init (OsinfoResourcesClass *klass) */ pspec = g_param_spec_int64 ("cpu", "CPU", - "CPU frequency in hertz (Hz)", + _("CPU frequency in hertz (Hz)"), -1, G_MAXINT, -1, @@ -203,7 +204,7 @@ osinfo_resources_class_init (OsinfoResourcesClass *klass) */ pspec = g_param_spec_int ("n-cpus", "N-CPUs", - "Number of CPUs", + _("Number of CPUs"), -1, G_MAXINT, -1, @@ -222,7 +223,7 @@ osinfo_resources_class_init (OsinfoResourcesClass *klass) */ pspec = g_param_spec_int64 ("ram", "RAM", - "Amount of Random Access Memory (RAM) in bytes", + _("Amount of Random Access Memory (RAM) in bytes"), -1, G_MAXINT64, -1, @@ -241,7 +242,7 @@ osinfo_resources_class_init (OsinfoResourcesClass *klass) */ pspec = g_param_spec_int64 ("storage", "Storage", - "Amount of storage space in bytes", + _("Amount of storage space in bytes"), -1, G_MAXINT64, -1, diff --git a/osinfo/osinfo_tree.c b/osinfo/osinfo_tree.c index 9cc41dd..b8a8645 100644 --- a/osinfo/osinfo_tree.c +++ b/osinfo/osinfo_tree.c @@ -29,6 +29,7 @@ #include <gio/gio.h> #include <stdlib.h> #include <string.h> +#include <glib/gi18n-lib.h> typedef struct _CreateFromLocationAsyncData CreateFromLocationAsyncData; struct _CreateFromLocationAsyncData { @@ -273,7 +274,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("architecture", "ARCHITECTURE", - "CPU Architecture", + _("CPU Architecture"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -288,7 +289,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("url", "URL", - "The URL to this tree", + _("The URL to this tree"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -303,7 +304,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("volume-id", "VolumeID", - "Expected ISO9660 volume ID", + _("The expected ISO9660 volume ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -318,7 +319,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("publisher-id", "PublisherID", - "Expected ISO9660 publisher ID", + _("The expected ISO9660 publisher ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -333,7 +334,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("application-id", "ApplicationID", - "Expected ISO9660 application ID", + _("The expected ISO9660 application ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -348,7 +349,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("system-id", "SystemID", - "Expected ISO9660 system ID", + _("The expected ISO9660 system ID"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -363,7 +364,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("kernel-path", "KernelPath", - "The path to the kernel image", + _("The path to the kernel image"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -378,7 +379,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("initrd-path", "InitrdPath", - "The path to the inirtd image", + _("The path to the inirtd image"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -393,7 +394,7 @@ osinfo_tree_class_init(OsinfoTreeClass *klass) */ pspec = g_param_spec_string("boot-iso-path", "BootISOPath", - "The path to the bootable ISO image", + _("The path to the bootable ISO image"), NULL /* default value */, G_PARAM_READWRITE | G_PARAM_STATIC_NAME | @@ -621,7 +622,7 @@ static void on_location_read(GObject *source, &length, NULL, &error)) { - g_prefix_error(&error, "Failed to load .treeinfo file: "); + g_prefix_error(&error, _("Failed to load .treeinfo file: ")); g_simple_async_result_take_error(data->res, error); g_simple_async_result_complete(data->res); create_from_location_async_data_free(data); @@ -632,7 +633,7 @@ static void on_location_read(GObject *source, content, length, &error))) { - g_prefix_error(&error, "Failed to process keyinfo file: "); + g_prefix_error(&error, _("Failed to process keyinfo file: ")); g_simple_async_result_take_error(data->res, error); goto cleanup; } diff --git a/po/POTFILES.in b/po/POTFILES.in index 2257997..6eb629e 100644 --- a/po/POTFILES.in +++ b/po/POTFILES.in @@ -23,3 +23,21 @@ data/devices/virtio-pci.xml.in data/devices/qemu-usb.xml.in data/hypervisors/rhel-xen.xml.in data/hypervisors/xen.xml.in +osinfo/osinfo_deployment.c +osinfo/osinfo_devicelink.c +osinfo/osinfo_devicelinkfilter.c +osinfo/osinfo_entity.c +osinfo/osinfo_install_config_param.c +osinfo/osinfo_install_script.c +osinfo/osinfo_list.c +osinfo/osinfo_loader.c +osinfo/osinfo_media.c +osinfo/osinfo_os.c +osinfo/osinfo_product.c +osinfo/osinfo_resources.c +osinfo/osinfo_tree.c +tools/osinfo-db-validate.c +tools/osinfo-detect.c +tools/osinfo-install-script.c +tools/osinfo-query.c + diff --git a/tools/osinfo-db-validate.c b/tools/osinfo-db-validate.c index 5b7274b..5a86af8 100644 --- a/tools/osinfo-db-validate.c +++ b/tools/osinfo-db-validate.c @@ -35,7 +35,7 @@ static gboolean verbose = FALSE; static const GOptionEntry entries[] = { { "verbose", 'v', 0, G_OPTION_ARG_NONE, (void*)&verbose, - "Verbose progress information", NULL, }, + N_("Verbose progress information"), NULL, }, { NULL, 0, 0, 0, NULL, NULL, NULL } }; @@ -52,7 +52,7 @@ static void validate_structured_error_nop(void *userData G_GNUC_UNUSED, if (error->file) g_printerr("%s:%d %s", error->file, error->line, error->message); else - g_printerr("Schema validity error %s", error->message); + g_printerr(_("Schema validity error %s"), error->message); } static xmlDocPtr parse_file(GFile *file, GError **error) @@ -68,7 +68,7 @@ static xmlDocPtr parse_file(GFile *file, GError **error) if (!(pctxt = xmlNewParserCtxt())) { g_set_error(error, 0, 0, "%s", - "Unable to create libxml parser"); + _("Unable to create libxml parser")); goto cleanup; } @@ -76,7 +76,7 @@ static xmlDocPtr parse_file(GFile *file, GError **error) XML_PARSE_NOENT | XML_PARSE_NONET | XML_PARSE_NOWARNING))) { g_set_error(error, 0, 0, - "Unable to parse XML document %s", + _("Unable to parse XML document '%s'"), uri); goto cleanup; } @@ -108,7 +108,7 @@ static gboolean validate_file_regular(xmlRelaxNGValidCtxtPtr rngValid, if (xmlRelaxNGValidateDoc(rngValid, doc) != 0) { g_set_error(error, 0, 0, - "Unable to validate doc %s", + _("Unable to validate XML document '%s'"), uri); goto cleanup; } @@ -158,7 +158,7 @@ static gboolean validate_file(xmlRelaxNGValidCtxtPtr rngValid, GFile *file, GFil gchar *uri = g_file_get_uri(file); if (verbose) - g_print("Process %s\n", uri); + g_print(_("Processing '%s'...\n"), uri); if (!info) { if (!(thisinfo = g_file_query_info(file, "standard::*", @@ -181,6 +181,7 @@ static gboolean validate_file(xmlRelaxNGValidCtxtPtr rngValid, GFile *file, GFil goto cleanup; } + g_print(_("Processed '%s'.\n"), uri); ret = TRUE; cleanup: @@ -205,7 +206,7 @@ static gboolean validate_files(gint argc, gchar **argv, GError **error) rngParser = xmlRelaxNGNewParserCtxt(SCHEMA); if (!rngParser) { g_set_error(error, 0, 0, - "Unable to create RNG parser for %s", + _("Unable to create RNG parser for %s"), SCHEMA); goto cleanup; } @@ -213,7 +214,7 @@ static gboolean validate_files(gint argc, gchar **argv, GError **error) rng = xmlRelaxNGParse(rngParser); if (!rng) { g_set_error(error, 0, 0, - "Unable to parse RNG %s", + _("Unable to parse RNG %s"), SCHEMA); goto cleanup; } @@ -221,7 +222,7 @@ static gboolean validate_files(gint argc, gchar **argv, GError **error) rngValid = xmlRelaxNGNewValidCtxt(rng); if (!rngValid) { g_set_error(error, 0, 0, - "Unable to create RNG validation context %s", + _("Unable to create RNG validation context %s"), SCHEMA); goto cleanup; } @@ -257,12 +258,13 @@ gint main(gint argc, gchar **argv) g_type_init(); - context = g_option_context_new("- Validate XML documents "); + context = g_option_context_new(_("- Validate XML documents ")); g_option_context_add_main_entries(context, entries, NULL); if (!g_option_context_parse(context, &argc, &argv, &error)) { - g_printerr("Error while parsing options: %s\n", error->message); + g_printerr(_("Error while parsing commandline options: %s\n"), + error->message); g_printerr("%s\n", g_option_context_get_help(context, FALSE, NULL)); goto error; } diff --git a/tools/osinfo-detect.c b/tools/osinfo-detect.c index 1b94e36..ecb3907 100644 --- a/tools/osinfo-detect.c +++ b/tools/osinfo-detect.c @@ -62,7 +62,7 @@ static gboolean parse_format_str(const gchar *option_name, g_set_error(error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, - "Invalid value '%s'", value); + _("Invalid value '%s'"), value); return FALSE; } @@ -83,7 +83,7 @@ static gboolean parse_type_str(const gchar *option_name, g_set_error(error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED, - "Invalid value '%s'", value); + _("Invalid value '%s'"), value); return FALSE; } @@ -95,12 +95,12 @@ static GOptionEntry entries[] = { { "format", 'f', 0, G_OPTION_ARG_CALLBACK, parse_format_str, - "Output format. Default: plain", - "plain|env." }, + N_("Output format. Default: plain"), + N_("plain|env.") }, { "type", 't', 0, G_OPTION_ARG_CALLBACK, parse_type_str, - "URL type. Default: media", - "media|tree." }, + N_("URL type. Default: media"), + N_("media|tree.") }, { NULL } }; @@ -110,12 +110,12 @@ static void print_bootable(gboolean bootable) if (format == OUTPUT_FORMAT_ENV) g_print("OSINFO_BOOTABLE=1\n"); else - g_print("Media is bootable.\n"); + g_print(_("Media is bootable.\n")); else if (format == OUTPUT_FORMAT_ENV) g_print("OSINFO_BOOTABLE=0\n"); else - g_print("Media is not bootable.\n"); + g_print(_("Media is not bootable.\n")); } static void print_os_media(OsinfoOs *os, OsinfoMedia *media) @@ -136,9 +136,9 @@ static void print_os_media(OsinfoOs *os, OsinfoMedia *media) const gchar *name = osinfo_product_get_name(OSINFO_PRODUCT(os)); if (osinfo_media_get_installer (media)) - g_print("Media is an installer for OS '%s'\n", name); + g_print(_("Media is an installer for OS '%s'\n"), name); if (osinfo_media_get_live (media)) - g_print("Media is live media for OS '%s'\n", name); + g_print(_("Media is live media for OS '%s'\n"), name); } } @@ -172,7 +172,7 @@ static void print_os_tree(OsinfoOs *os, OsinfoTree *tree, OsinfoTree *matched_tr } else { const gchar *name = osinfo_product_get_name(OSINFO_PRODUCT(os)); - g_print("Tree is an installer for OS '%s'\n", name); + g_print(_("Tree is an installer for OS '%s'\n"), name); } } @@ -190,12 +190,13 @@ gint main(gint argc, gchar **argv) bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR); bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8"); - context = g_option_context_new("- Detect if media is bootable " \ - "and the relavent OS and distribution."); + context = g_option_context_new(_("- Detect if media is bootable " \ + "and the relavent OS and distribution.")); /* FIXME: We don't have a gettext package to pass to this function. */ g_option_context_add_main_entries(context, entries, NULL); if (!g_option_context_parse(context, &argc, &argv, &error)) { - g_printerr("Error while parsing options: %s\n", error->message); + g_printerr(_("Error while parsing commandline options: %s\n"), + error->message); g_printerr("%s\n", g_option_context_get_help(context, FALSE, NULL)); ret = -1; @@ -214,7 +215,7 @@ gint main(gint argc, gchar **argv) loader = osinfo_loader_new(); osinfo_loader_process_default_path(loader, &error); if (error != NULL) { - g_printerr("Error loading OS data: %s\n", error->message); + g_printerr(_("Error loading OS data: %s\n"), error->message); /* errors loading the osinfo database are not fatal as this can * happen when the user has an invalid file in * ~/.local/share/libosinfo for example. Let's report but ignore @@ -231,7 +232,7 @@ gint main(gint argc, gchar **argv) media = osinfo_media_create_from_location(argv[1], NULL, &error); if (error != NULL) { if (error->code != OSINFO_MEDIA_ERROR_NOT_BOOTABLE) { - g_printerr("Error parsing media: %s\n", error->message); + g_printerr(_("Error parsing media: %s\n"), error->message); ret = -3; goto EXIT; @@ -248,7 +249,7 @@ gint main(gint argc, gchar **argv) OsinfoTree *matched_tree = NULL; tree = osinfo_tree_create_from_location(argv[1], NULL, &error); if (error != NULL) { - g_printerr("Error parsing tree: %s\n", error->message); + g_printerr(_("Error parsing installer tree: %s\n"), error->message); ret = -3; goto EXIT; diff --git a/tools/osinfo-install-script.c b/tools/osinfo-install-script.c index 66116e1..fd16c67 100644 --- a/tools/osinfo-install-script.c +++ b/tools/osinfo-install-script.c @@ -45,7 +45,7 @@ static gboolean handle_config(const gchar *option_name G_GNUC_UNUSED, if (!(val = strchr(value, '='))) { g_set_error(error, 0, 0, - "Expected configuration key=value"); + _("Expected configuration key=value")); return FALSE; } len = val - value; @@ -63,14 +63,14 @@ static gboolean handle_config(const gchar *option_name G_GNUC_UNUSED, static GOptionEntry entries[] = { { "profile", 'p', 0, G_OPTION_ARG_STRING, (void*)&profile, - "Install script profile", NULL, }, + N_("Install script profile"), NULL, }, { "output-dir", 'd', 0, G_OPTION_ARG_STRING, (void*)&output_dir, - "Install script output directory", NULL, }, + N_("Install script output directory"), NULL, }, { "prefix", 'P', 0, G_OPTION_ARG_STRING, (void*)&prefix, - "The output filename prefix", NULL, }, + N_("The output filename prefix"), NULL, }, { "config", 'c', 0, G_OPTION_ARG_CALLBACK, handle_config, - "Set configuration parameter", "key=value" }, + N_("Set configuration parameter"), "key=value" }, { NULL } }; @@ -140,8 +140,8 @@ static gboolean generate_script(OsinfoOs *os) NULL, &error); if (error != NULL) { - g_printerr("Unable to generate install script: %s\n", - error->message ? error->message : "unknown"); + g_printerr(_("Unable to generate install script: %s\n"), + error->message ? error->message : "unknown"); goto cleanup; } } @@ -174,11 +174,11 @@ gint main(gint argc, gchar **argv) config = osinfo_install_config_new("http://libosinfo.fedorahosted.org/config"); - context = g_option_context_new("- Generate an OS install script"); + context = g_option_context_new(_("- Generate an OS install script")); /* FIXME: We don't have a gettext package to pass to this function. */ g_option_context_add_main_entries(context, entries, NULL); if (!g_option_context_parse(context, &argc, &argv, &error)) { - g_printerr("Error while parsing options: %s\n", error->message); + g_printerr(_("Error while parsing options: %s\n"), error->message); g_printerr("%s\n", g_option_context_get_help(context, FALSE, NULL)); ret = -1; @@ -195,7 +195,7 @@ gint main(gint argc, gchar **argv) loader = osinfo_loader_new(); osinfo_loader_process_default_path(loader, &error); if (error != NULL) { - g_printerr("Error loading OS data: %s\n", error->message); + g_printerr(_("Error loading OS data: %s\n"), error->message); ret = -3; goto EXIT; @@ -204,7 +204,7 @@ gint main(gint argc, gchar **argv) db = osinfo_loader_get_db(loader); os = find_os(db, argv[1]); if (!os) { - g_printerr("Error finding OS: %s\n", argv[1]); + g_printerr(_("Error finding OS: %s\n"), argv[1]); ret = -4; goto EXIT; } diff --git a/tools/osinfo-query.c b/tools/osinfo-query.c index 006f86d..81ec239 100644 --- a/tools/osinfo-query.c +++ b/tools/osinfo-query.c @@ -54,71 +54,71 @@ struct OsinfoType { static struct OsinfoLabel os_labels[] = { { OSINFO_PRODUCT_PROP_SHORT_ID, - "Short ID", TRUE, 20 }, + N_("Short ID"), TRUE, 20 }, { OSINFO_PRODUCT_PROP_NAME, - "Name", TRUE, 50 }, + N_("Name"), TRUE, 50 }, { OSINFO_PRODUCT_PROP_VERSION, - "Version", TRUE, 8 }, + N_("Version"), TRUE, 8 }, { OSINFO_OS_PROP_FAMILY, - "Family", FALSE, 12 }, + N_("Family"), FALSE, 12 }, { OSINFO_OS_PROP_DISTRO, - "Distro", FALSE, 12 }, + N_("Distro"), FALSE, 12 }, { OSINFO_PRODUCT_PROP_VENDOR, - "Vendor", FALSE, 25 }, + N_("Vendor"), FALSE, 25 }, { OSINFO_PRODUCT_PROP_RELEASE_DATE, - "Release date", FALSE, 12 }, + N_("Release date"), FALSE, 12 }, { OSINFO_PRODUCT_PROP_EOL_DATE, - "End of life", FALSE, 12 }, + N_("End of life"), FALSE, 12 }, { OSINFO_PRODUCT_PROP_CODENAME, - "Code name", FALSE, 10 }, + N_("Code name"), FALSE, 10 }, { OSINFO_ENTITY_PROP_ID, - "ID", TRUE, 40 }, + N_("ID"), TRUE, 40 }, { NULL, NULL, 0, 0}, }; static struct OsinfoLabel platform_labels[] = { { OSINFO_PRODUCT_PROP_SHORT_ID, - "Short ID", TRUE, 20 }, + N_("Short ID"), TRUE, 20 }, { OSINFO_PRODUCT_PROP_NAME, - "Name", TRUE, 50 }, + N_("Name"), TRUE, 50 }, { OSINFO_PRODUCT_PROP_VERSION, - "Version", TRUE, 8 }, + N_("Version"), TRUE, 8 }, { OSINFO_PRODUCT_PROP_VENDOR, - "Vendor", TRUE, 25 }, + N_("Vendor"), TRUE, 25 }, { OSINFO_PRODUCT_PROP_RELEASE_DATE, - "Release date", FALSE, 12 }, + N_("Release date"), FALSE, 12 }, { OSINFO_PRODUCT_PROP_EOL_DATE, - "End of life", FALSE, 12 }, + N_("End of life"), FALSE, 12 }, { OSINFO_PRODUCT_PROP_CODENAME, - "Code name", FALSE, 10 }, + N_("Code name"), FALSE, 10 }, { OSINFO_ENTITY_PROP_ID, - "ID", TRUE, 40 }, + N_("ID"), TRUE, 40 }, { NULL, NULL, 0, 0 }, }; static struct OsinfoLabel device_labels[] = { { OSINFO_DEVICE_PROP_VENDOR, - "Vendor", TRUE, 20 }, + N_("Vendor"), TRUE, 20 }, { OSINFO_DEVICE_PROP_VENDOR_ID, - "Vendor ID", TRUE, 12 }, + N_("Vendor ID"), TRUE, 12 }, { OSINFO_DEVICE_PROP_PRODUCT, - "Product", TRUE, 20 }, + N_("Product"), TRUE, 20 }, { OSINFO_DEVICE_PROP_PRODUCT_ID, - "Product ID", TRUE, 12 }, + N_("Product ID"), TRUE, 12 }, { OSINFO_PRODUCT_PROP_NAME, - "Name", TRUE, 14 }, + N_("Name"), TRUE, 14 }, { OSINFO_DEVICE_PROP_CLASS, - "Class", TRUE, 15 }, + N_("Class"), TRUE, 15 }, { OSINFO_DEVICE_PROP_BUS_TYPE, - "Bus", TRUE, 8 }, + N_("Bus"), TRUE, 8 }, { OSINFO_ENTITY_PROP_ID, - "ID", TRUE, 40 }, + N_("ID"), TRUE, 40 }, { NULL, NULL, 0, 0 }, }; static struct OsinfoLabel deployment_labels[] = { { OSINFO_ENTITY_PROP_ID, - "ID", TRUE, 40 }, + N_("ID"), TRUE, 40 }, { NULL, NULL, 0, 0 }, }; @@ -150,7 +150,7 @@ static gboolean toggle_fields(struct OsinfoLabel *labels, } if (!found) { g_set_error(error, 0, 0, - "Unknown property name %s", fields[i]); + _("Unknown property name %s"), fields[i]); goto cleanup; } } @@ -174,7 +174,7 @@ static gboolean build_filter(struct OsinfoLabel *labels, for (i = 0 ; i < argc ; i++) { const gchar *tmp = strchr(argv[i], '='); if (!tmp) { - g_set_error(error, 0, 0, "%s", "Syntax error in condition, expecting KEY=VALUE"); + g_set_error(error, 0, 0, "%s", _("Syntax error in condition, expecting KEY=VALUE")); goto cleanup; } gchar *key = g_strndup(argv[i], tmp-argv[i]); @@ -188,7 +188,7 @@ static gboolean build_filter(struct OsinfoLabel *labels, if (!found) { g_set_error(error, 0, 0, - "Unknown property name %s", key); + _("Unknown property name %s"), key); goto cleanup; } @@ -397,25 +397,26 @@ gint main(gint argc, gchar **argv) GOptionEntry entries[] = { { "sort", 's', 0, G_OPTION_ARG_STRING, &sortKey, - "Sort column", NULL }, + _("Sort column"), NULL }, { "fields", 'f', 0, G_OPTION_ARG_STRING, &fields, - "Display fields", NULL }, + _("Display fields"), NULL }, { NULL, 0, 0, 0, NULL, NULL, NULL } }; - context = g_option_context_new("- Query the OS info database"); + context = g_option_context_new(_("- Query the OS info database")); g_option_context_add_main_entries(context, entries, NULL); if (!g_option_context_parse(context, &argc, &argv, &error)) { - g_printerr("Error while parsing options: %s\n", error->message); + g_printerr(_("Error while parsing commandline options: %s\n"), + error->message); g_printerr("%s\n", g_option_context_get_help(context, FALSE, NULL)); goto error; } if (argc < 2) { - g_printerr("Missing data type parameter\n"); + g_printerr(_("Missing data type parameter\n")); goto error; } @@ -424,7 +425,7 @@ gint main(gint argc, gchar **argv) loader = osinfo_loader_new(); osinfo_loader_process_default_path(loader, &error); if (error != NULL) { - g_printerr("Error loading OS data: %s\n", error->message); + g_printerr(_("Error loading OS data: %s\n"), error->message); goto error; } @@ -443,17 +444,17 @@ gint main(gint argc, gchar **argv) } if (!entities) { - g_printerr("Unknown type '%s' requested\n", type); + g_printerr(_("Unknown type '%s' requested\n"), type); goto error; } if (!build_filter(labels, filter, argc-2, argv+2, &error)) { - g_printerr("Unable to construct filter: %s\n", error->message); + g_printerr(_("Unable to construct filter: %s\n"), error->message); goto error; } if (!toggle_fields(labels, fields, &error)) { - g_printerr("Unable to set field visibility: %s\n", error->message); + g_printerr(_("Unable to set field visibility: %s\n"), error->message); goto error; } -- 1.7.12.1