[virt-tools-list] [libosinfo v2 2/2] Translate all (potentially) user visible strings

Zeeshan Ali (Khattak) zeeshanak at gnome.org
Tue Oct 30 12:50:16 UTC 2012


From: "Zeeshan Ali (Khattak)" <zeeshanak at gnome.org>

Make some strings more translator-friendly at the same time.
---
 osinfo/osinfo_deployment.c           |  4 +-
 osinfo/osinfo_devicelink.c           |  2 +-
 osinfo/osinfo_devicelinkfilter.c     |  2 +-
 osinfo/osinfo_entity.c               |  2 +-
 osinfo/osinfo_install_config_param.c |  4 +-
 osinfo/osinfo_install_script.c       | 42 +++++++++----------
 osinfo/osinfo_list.c                 |  2 +-
 osinfo/osinfo_loader.c               | 28 ++++++-------
 osinfo/osinfo_media.c                | 40 +++++++++---------
 osinfo/osinfo_os.c                   |  4 +-
 osinfo/osinfo_priv.h                 |  1 +
 osinfo/osinfo_product.c              | 12 +++---
 osinfo/osinfo_resources.c            | 10 ++---
 osinfo/osinfo_tree.c                 | 22 +++++-----
 po/POTFILES.in                       | 17 ++++++++
 tools/osinfo-db-validate.c           | 24 ++++++-----
 tools/osinfo-detect.c                | 35 ++++++++--------
 tools/osinfo-install-script.c        | 22 +++++-----
 tools/osinfo-query.c                 | 79 ++++++++++++++++++------------------
 19 files changed, 187 insertions(+), 165 deletions(-)

diff --git a/osinfo/osinfo_deployment.c b/osinfo/osinfo_deployment.c
index 5f70e0d..c67456a 100644
--- a/osinfo/osinfo_deployment.c
+++ b/osinfo/osinfo_deployment.c
@@ -148,7 +148,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 |
@@ -165,7 +165,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 d96c6a4..7fe12d4 100644
--- a/osinfo/osinfo_devicelink.c
+++ b/osinfo/osinfo_devicelink.c
@@ -123,7 +123,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 7a33a63..bfadc85 100644
--- a/osinfo/osinfo_devicelinkfilter.c
+++ b/osinfo/osinfo_devicelinkfilter.c
@@ -128,7 +128,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 30d03d3..23b1d91 100644
--- a/osinfo/osinfo_entity.c
+++ b/osinfo/osinfo_entity.c
@@ -130,7 +130,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 e06b53d..0b2fd04 100644
--- a/osinfo/osinfo_install_config_param.c
+++ b/osinfo/osinfo_install_config_param.c
@@ -135,7 +135,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 |
@@ -153,7 +153,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 7b9365b..b5da3f5 100644
--- a/osinfo/osinfo_install_script.c
+++ b/osinfo/osinfo_install_script.c
@@ -166,7 +166,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 |
@@ -180,7 +180,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 |
@@ -194,7 +194,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 |
@@ -208,7 +208,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 |
@@ -467,7 +467,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;
     }
 
@@ -475,13 +475,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;
     }
 
@@ -502,7 +502,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;
     }
@@ -510,13 +510,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;
@@ -530,13 +530,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;
@@ -580,7 +580,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;
     }
 
@@ -591,7 +591,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;
     }
 
@@ -602,7 +602,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;
     }
 
@@ -624,17 +624,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;
     }
 
@@ -690,7 +690,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;
     }
@@ -703,7 +703,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;
     }
@@ -747,7 +747,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 9b415a1..e3f53fa 100644
--- a/osinfo/osinfo_list.c
+++ b/osinfo/osinfo_list.c
@@ -125,7 +125,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 ef935c5..486a572 100644
--- a/osinfo/osinfo_loader.c
+++ b/osinfo/osinfo_loader.c
@@ -268,7 +268,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;
         }
 
@@ -347,7 +347,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;
     }
 
@@ -377,7 +377,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);
@@ -421,7 +421,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;
@@ -496,7 +496,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;
     }
 
@@ -527,13 +527,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;
     }
@@ -542,7 +542,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;
     }
@@ -608,7 +608,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;
     }
 
@@ -881,7 +881,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;
     }
 
@@ -967,7 +967,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;
         }
@@ -1017,7 +1017,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;
     }
 
@@ -1125,7 +1125,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;
     }
 
@@ -1147,7 +1147,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 31e1794..16cc752 100644
--- a/osinfo/osinfo_media.c
+++ b/osinfo/osinfo_media.c
@@ -331,7 +331,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 |
@@ -346,7 +346,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 |
@@ -361,7 +361,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 |
@@ -376,7 +376,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 |
@@ -391,7 +391,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 |
@@ -406,7 +406,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 |
@@ -421,7 +421,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 |
@@ -436,7 +436,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 |
@@ -451,7 +451,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 */
@@ -467,7 +467,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 */
@@ -492,7 +492,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 */,
@@ -611,14 +611,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;
     }
 
@@ -641,7 +641,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;
     }
@@ -697,14 +697,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;
     }
 
@@ -729,7 +729,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;
     }
@@ -764,12 +764,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);
@@ -801,7 +801,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 1e341ee..01f5596 100644
--- a/osinfo/osinfo_os.c
+++ b/osinfo/osinfo_os.c
@@ -135,7 +135,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 |
@@ -153,7 +153,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_priv.h b/osinfo/osinfo_priv.h
index e9d20b0..0a77f67 100644
--- a/osinfo/osinfo_priv.h
+++ b/osinfo/osinfo_priv.h
@@ -27,6 +27,7 @@
 #include <config.h>
 
 #include <osinfo/osinfo.h>
+#include <glib/gi18n-lib.h>
 
 #endif
 /*
diff --git a/osinfo/osinfo_product.c b/osinfo/osinfo_product.c
index 57a5e07..ae08879 100644
--- a/osinfo/osinfo_product.c
+++ b/osinfo/osinfo_product.c
@@ -159,7 +159,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 |
@@ -174,7 +174,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 |
@@ -189,7 +189,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 |
@@ -204,7 +204,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 |
@@ -219,7 +219,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 |
@@ -234,7 +234,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 d1967b0..f064104 100644
--- a/osinfo/osinfo_resources.c
+++ b/osinfo/osinfo_resources.c
@@ -164,7 +164,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 |
@@ -182,7 +182,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,
@@ -201,7 +201,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,
@@ -220,7 +220,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,
@@ -239,7 +239,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 5b3b5ee..d0475b3 100644
--- a/osinfo/osinfo_tree.c
+++ b/osinfo/osinfo_tree.c
@@ -271,7 +271,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 |
@@ -286,7 +286,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 |
@@ -301,7 +301,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 |
@@ -316,7 +316,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 |
@@ -331,7 +331,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 |
@@ -346,7 +346,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 |
@@ -361,7 +361,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 |
@@ -376,7 +376,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 |
@@ -391,7 +391,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 |
@@ -619,7 +619,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);
@@ -630,7 +630,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..513958c 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -23,3 +23,20 @@ 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




More information about the virt-tools-list mailing list