]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
testError: mark most string arguments for translation
authorJim Meyering <meyering@redhat.com>
Thu, 27 Mar 2008 14:01:59 +0000 (14:01 +0000)
committerJim Meyering <meyering@redhat.com>
Thu, 27 Mar 2008 14:01:59 +0000 (14:01 +0000)
* Makefile.maint (msg_gen_function): Add testError
* src/test.c (testDomainSave, testDomainRestore): Mark strings.
(testDomainCoreDump): Likewise.

ChangeLog
Makefile.maint
src/test.c

index 19fb54313fe1b5fefaf2bf76c6e302f609b23988..ba51e61a6100214771fb9bbb63073639510fa2b2 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 Thu Mar 27 14:36:56 CET 2008 Jim Meyering <meyering@redhat.com>
 
+       testError: mark most string arguments for translation
+       * Makefile.maint (msg_gen_function): Add testError
+       * src/test.c (testDomainSave, testDomainRestore): Mark strings.
+       (testDomainCoreDump): Likewise.
+
        openvzLog: mark its string arguments for translation
        * Makefile.maint (msg_gen_function): Add openvzLog.
        * src/openvz_conf.c (openvzAssignVMDef, openvzParseXML): Mark strings.
index 55a96773924d9696e1704a7b370a6afc2d7c67ef..518e59bf0c3f948f226ea55ef7c51b272efb5a00 100644 (file)
@@ -317,9 +317,10 @@ msg_gen_function += ReportError
 msg_gen_function += qemudReportError
 msg_gen_function += openvzLog
 
-# Uncomment this after adjusting remaining diagnostics to be translatable.
+# Uncomment the following and run "make syntax-check" to see diagnostics
+# that are not yet marked for translation, but that need to be rewritten
+# so that they are translatable.
 # msg_gen_function += error
-
 # msg_gen_function += virXenError
 # msg_gen_function += testError
 
index f401d7de2106c22158de8d3ac3f2e554099ca84e..6cf3fdade606e0140cd402dbb2087be72379f7c0 100644 (file)
@@ -1307,31 +1307,31 @@ static int testDomainSave(virDomainPtr domain,
     xml = testDomainDumpXML(domain, 0);
     if (xml == NULL) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot allocate space for metadata");
+                  _("cannot allocate space for metadata"));
         return (-1);
     }
 
     if ((fd = open(path, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR)) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot save domain");
+                  _("cannot save domain"));
         return (-1);
     }
     len = strlen(xml);
     if (safewrite(fd, TEST_SAVE_MAGIC, sizeof(TEST_SAVE_MAGIC)) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot write header");
+                  _("cannot write header"));
         close(fd);
         return (-1);
     }
     if (safewrite(fd, (char*)&len, sizeof(len)) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot write metadata length");
+                  _("cannot write metadata length"));
         close(fd);
         return (-1);
     }
     if (safewrite(fd, xml, len) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot write metadata");
+                  _("cannot write metadata"));
         free(xml);
         close(fd);
         return (-1);
@@ -1339,7 +1339,7 @@ static int testDomainSave(virDomainPtr domain,
     free(xml);
     if (close(fd) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot save domain data");
+                  _("cannot save domain data"));
         close(fd);
         return (-1);
     }
@@ -1363,30 +1363,30 @@ static int testDomainRestore(virConnectPtr conn,
 
     if ((fd = open(path, O_RDONLY)) < 0) {
         testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot read domain image");
+                  _("cannot read domain image"));
         return (-1);
     }
     if (read(fd, magic, sizeof(magic)) != sizeof(magic)) {
         testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "incomplete save header");
+                  _("incomplete save header"));
         close(fd);
         return (-1);
     }
     if (memcmp(magic, TEST_SAVE_MAGIC, sizeof(magic))) {
         testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "mismatched header magic");
+                  _("mismatched header magic"));
         close(fd);
         return (-1);
     }
     if (read(fd, (char*)&len, sizeof(len)) != sizeof(len)) {
         testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "failed to read metadata length");
+                  _("failed to read metadata length"));
         close(fd);
         return (-1);
     }
     if (len < 1 || len > 8192) {
         testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "length of metadata out of range");
+                  _("length of metadata out of range"));
         close(fd);
         return (-1);
     }
@@ -1398,7 +1398,7 @@ static int testDomainRestore(virConnectPtr conn,
     }
     if (read(fd, xml, len) != len) {
         testError(conn, NULL, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "incomplete metdata");
+                  _("incomplete metdata"));
         close(fd);
         return (-1);
     }
@@ -1419,18 +1419,18 @@ static int testDomainCoreDump(virDomainPtr domain,
 
     if ((fd = open(to, O_CREAT|O_TRUNC|O_WRONLY, S_IRUSR|S_IWUSR)) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot save domain core");
+                  _("cannot save domain core"));
         return (-1);
     }
     if (safewrite(fd, TEST_SAVE_MAGIC, sizeof(TEST_SAVE_MAGIC)) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot write header");
+                  _("cannot write header"));
         close(fd);
         return (-1);
     }
     if (close(fd) < 0) {
         testError(domain->conn, domain, NULL, VIR_ERR_INTERNAL_ERROR,
-                  "cannot save domain data");
+                  _("cannot save domain data"));
         close(fd);
         return (-1);
     }