[jhbuild] translate command usage args when used, not on class definition



commit d13405f0f389492750e235283e93b10cf0eb2311
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat May 16 14:17:56 2009 +0200

    translate command usage args when used, not on class definition
---
 jhbuild/commands/__init__.py  |    4 ++--
 jhbuild/commands/base.py      |   16 ++++++++--------
 jhbuild/commands/bot.py       |    2 +-
 jhbuild/commands/info.py      |    2 +-
 jhbuild/commands/rdepends.py  |    2 +-
 jhbuild/commands/tinderbox.py |    2 +-
 6 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/jhbuild/commands/__init__.py b/jhbuild/commands/__init__.py
index 229b8c9..2f795f6 100644
--- a/jhbuild/commands/__init__.py
+++ b/jhbuild/commands/__init__.py
@@ -34,7 +34,7 @@ class Command:
 
     doc = ''
     name = None
-    usage_args = _('[ options ... ]')
+    usage_args = N_('[ options ... ]')
 
     def __init__(self, options=[]):
         self.options = options
@@ -45,7 +45,7 @@ class Command:
 
     def parse_args(self, args):
         self.parser = optparse.OptionParser(
-            usage='%%prog %s %s' % (self.name, self.usage_args),
+            usage='%%prog %s %s' % (self.name, _(self.usage_args)),
             description=self.doc)
         self.parser.add_options(self.options)
         return self.parser.parse_args(args)
diff --git a/jhbuild/commands/base.py b/jhbuild/commands/base.py
index f144bda..c17154c 100644
--- a/jhbuild/commands/base.py
+++ b/jhbuild/commands/base.py
@@ -44,7 +44,7 @@ class cmd_update(Command):
     doc = _('Update all modules from version control')
 
     name = 'update'
-    usage_args = '[ options ... ] [ modules ... ]'
+    usage_args = N_('[ options ... ] [ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [
@@ -100,7 +100,7 @@ class cmd_updateone(Command):
     doc = _('Update one or more modules from version control')
 
     name = 'updateone'
-    usage_args = '[ options ... ] [ modules ... ]'
+    usage_args = N_('[ options ... ] [ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [
@@ -136,7 +136,7 @@ class cmd_cleanone(Command):
     doc = _('Clean one or more modules')
 
     name = 'cleanone'
-    usage_args = '[ options ... ] [ modules ... ]'
+    usage_args = N_('[ options ... ] [ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [
@@ -217,7 +217,7 @@ class cmd_build(Command):
     doc = _('Update and compile all modules (the default)')
 
     name = 'build'
-    usage_args = _('[ options ... ] [ modules ... ]')
+    usage_args = N_('[ options ... ] [ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [
@@ -340,7 +340,7 @@ class cmd_buildone(Command):
     doc = _('Update and compile one or more modules')
 
     name = 'buildone'
-    usage_args = _('[ options ... ] [ modules ... ]')
+    usage_args = N_('[ options ... ] [ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [
@@ -423,7 +423,7 @@ class cmd_run(Command):
     doc = _('Run a command under the JHBuild environment')
 
     name = 'run'
-    usage_args = _('[ options ... ] program [ arguments ... ]')
+    usage_args = N_('[ options ... ] program [ arguments ... ]')
 
     def __init__(self):
         Command.__init__(self, [
@@ -491,7 +491,7 @@ class cmd_list(Command):
     doc = _('List the modules that would be built')
 
     name = 'list'
-    usage_args = _('[ options ... ] [ modules ... ]')
+    usage_args = N_('[ options ... ] [ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [
@@ -558,7 +558,7 @@ class cmd_dot(Command):
     doc = _('Output a Graphviz dependency graph for one or more modules')
 
     name = 'dot'
-    usage_args = _('[ modules ... ]')
+    usage_args = N_('[ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [
diff --git a/jhbuild/commands/bot.py b/jhbuild/commands/bot.py
index 73e8050..6730127 100644
--- a/jhbuild/commands/bot.py
+++ b/jhbuild/commands/bot.py
@@ -53,7 +53,7 @@ class cmd_bot(Command):
     doc = _('Control buildbot')
 
     name = 'bot'
-    usage_args = '[ options ... ]'
+    usage_args = N_('[ options ... ]')
 
     def __init__(self):
         Command.__init__(self, [
diff --git a/jhbuild/commands/info.py b/jhbuild/commands/info.py
index 06a7da9..3e50bda 100644
--- a/jhbuild/commands/info.py
+++ b/jhbuild/commands/info.py
@@ -37,7 +37,7 @@ class cmd_info(Command):
     doc = _('Display information about one or more modules')
 
     name = 'info'
-    usage_args = _('[ modules ... ]')
+    usage_args = N_('[ modules ... ]')
 
 
     def run(self, config, options, args):
diff --git a/jhbuild/commands/rdepends.py b/jhbuild/commands/rdepends.py
index 76da930..0f1e1fe 100644
--- a/jhbuild/commands/rdepends.py
+++ b/jhbuild/commands/rdepends.py
@@ -28,7 +28,7 @@ class cmd_rdepends(Command):
     doc = _('Display reverse-dependencies of a module')
 
     name = 'rdepends'
-    usage_args = _('[ module ]')
+    usage_args = N_('[ module ]')
 
     def __init__(self):
         Command.__init__(self, [
diff --git a/jhbuild/commands/tinderbox.py b/jhbuild/commands/tinderbox.py
index 410b5ec..3adc5e5 100644
--- a/jhbuild/commands/tinderbox.py
+++ b/jhbuild/commands/tinderbox.py
@@ -28,7 +28,7 @@ class cmd_tinderbox(Command):
     doc = _('Build modules non-interactively and store build logs')
 
     name = 'tinderbox'
-    usage_args = _('[ options ... ] [ modules ... ]')
+    usage_args = N_('[ options ... ] [ modules ... ]')
 
     def __init__(self):
         Command.__init__(self, [



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