[libvirt PATCH] util: virXMLValidatorInit: improve translatable errors

Ján Tomko posted 1 patch 1 year, 1 month ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/65a3487095b1d2d102e5cea30fef091e042f41c8.1678717781.git.jtomko@redhat.com
src/util/virxml.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
[libvirt PATCH] util: virXMLValidatorInit: improve translatable errors
Posted by Ján Tomko 1 year, 1 month ago
In some translations, the RNG initials were mistranslated
as a random number generator.

Spell it out as RelaxNG to make it clearer.
Include the word 'schema' and quotes around the filename.

Signed-off-by: Ján Tomko <jtomko@redhat.com>
---
 src/util/virxml.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/util/virxml.c b/src/util/virxml.c
index af4be4e443..c0789c062c 100644
--- a/src/util/virxml.c
+++ b/src/util/virxml.c
@@ -1563,7 +1563,7 @@ virXMLValidatorInit(const char *schemafile)
     if (!(validator->rngParser =
           xmlRelaxNGNewParserCtxt(validator->schemafile))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to create RNG parser for %s"),
+                       _("Unable to create RelaxNG parser for schema '%s'"),
                        validator->schemafile);
         return NULL;
     }
@@ -1575,7 +1575,7 @@ virXMLValidatorInit(const char *schemafile)
 
     if (!(validator->rng = xmlRelaxNGParse(validator->rngParser))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to parse RNG %s: %s"),
+                       _("Unable to parse RelaxNG schema '%s': %s"),
                        validator->schemafile,
                        virBufferCurrentContent(&validator->buf));
         return NULL;
@@ -1583,7 +1583,7 @@ virXMLValidatorInit(const char *schemafile)
 
     if (!(validator->rngValid = xmlRelaxNGNewValidCtxt(validator->rng))) {
         virReportError(VIR_ERR_INTERNAL_ERROR,
-                       _("Unable to create RNG validation context %s"),
+                       _("Unable to create RelaxNG validation context for schema '%s'"),
                        validator->schemafile);
         return NULL;
     }
-- 
2.39.2

Re: [libvirt PATCH] util: virXMLValidatorInit: improve translatable errors
Posted by Peter Krempa 1 year, 1 month ago
On Mon, Mar 13, 2023 at 15:29:42 +0100, Ján Tomko wrote:
> In some translations, the RNG initials were mistranslated
> as a random number generator.
> 
> Spell it out as RelaxNG to make it clearer.
> Include the word 'schema' and quotes around the filename.
> 
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> ---
>  src/util/virxml.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Peter Krempa <pkrempa@redhat.com>