[jhbuild] Don't try to translate empty strings



commit d922aa21413a43efc1df49ba4ccc436c4e6df0f2
Author: Christoph Reiter <reiter christoph gmail com>
Date:   Sat Dec 7 23:02:27 2019 +0100

    Don't try to translate empty strings
    
    gettext will return the translation header information when getting
    passed an empty string. Avoid this case.
    
    This was for example visible with the "sanitycheck" command which
    has an empty usage_args which we still tried to translate.
    
    Fixes #52

 jhbuild/commands/__init__.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/jhbuild/commands/__init__.py b/jhbuild/commands/__init__.py
index 8706553f..0d8bb993 100644
--- a/jhbuild/commands/__init__.py
+++ b/jhbuild/commands/__init__.py
@@ -57,8 +57,8 @@ class Command:
 
     def parse_args(self, args):
         self.parser = OptionParser(
-            usage='%%prog %s %s' % (self.name, _(self.usage_args)),
-            description=_(self.doc))
+            usage='%%prog %s %s' % (self.name, _(self.usage_args) if self.usage_args else ''),
+            description=_(self.doc) if self.doc else '')
         self.parser.add_options(self.options)
         return self.parser.parse_args(args)
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]