In cli.py is a framework for printing out help information. The
command documentation being displayed is internationalized, however
the text generated by the help framework itself is not
internationalized.

The strings output by the help subsystem need to be internationalized.

--
John Dennis <[email protected]>

Looking to carve out IT costs?
www.redhat.com/carveoutcosts/
From 4256f5f7bde424085866a62260441119e5d6cd31 Mon Sep 17 00:00:00 2001
From: John Dennis <[email protected]>
Date: Wed, 24 Aug 2011 17:38:06 -0400
Subject: [PATCH 45/45] ticket 1706 - internationalize cli help framework
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

In cli.py is a framework for printing out help information. The
command documentation being displayed is internationalized, however
the text generated by the help framework itself is not
internationalized.

The strings output by the help subsystem need to be internationalized.
---
 ipalib/cli.py |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ipalib/cli.py b/ipalib/cli.py
index 5b55443..1e8c4b0 100644
--- a/ipalib/cli.py
+++ b/ipalib/cli.py
@@ -746,7 +746,7 @@ class help(frontend.Local):
             self.print_commands(name)
         elif name in self.Command:
             cmd = self.Command[name]
-            print 'Purpose: %s' % unicode(cmd.doc).strip()
+            print unicode(_('Purpose: %s')) % unicode(_(cmd.doc)).strip()
             self.Backend.cli.build_parser(cmd).print_help()
         elif mod_name in sys.modules:
             self.print_commands(name)
@@ -763,19 +763,19 @@ class help(frontend.Local):
     def print_topics(self):
         topics = sorted(self._topics.keys())
 
-        print 'Usage: ipa [global-options] COMMAND ...'
+        print unicode(_('Usage: ipa [global-options] COMMAND ...'))
         print ''
-        print 'Built-in commands:'
+        print unicode(_('Built-in commands:'))
         for c in self._builtins:
-            print 'Help subtopics:'
+            print unicode(_('Help subtopics:'))
             print '  %s  %s' % (to_cli(c.name).ljust(self._mtl), c.summary)
         print ''
-        print 'Help topics:'
+        print unicode(_('Help topics:'))
         for t in topics:
             topic = self._topics[t]
             print '  %s  %s' % (to_cli(t).ljust(self._mtl), topic[0])
         print ''
-        print 'Try `ipa --help` for a list of global options.'
+        print unicode(_('Try `ipa --help` for a list of global options.'))
 
     def print_commands(self, topic):
         if topic in self._topics and type(self._topics[topic][2]) is dict:
@@ -806,7 +806,7 @@ class help(frontend.Local):
             print doc
             if len(commands) > 1:
                 print ''
-                print 'Topic commands:'
+                print unicode(_('Topic commands:'))
                 for c in commands:
                     print '  %s  %s' % (to_cli(c.name).ljust(mcl), c.summary)
             print "\n"
-- 
1.7.4.4

_______________________________________________
Freeipa-devel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/freeipa-devel

Reply via email to