i18n: use gettext instead of _
authorMartin Geisler <mg@daimi.au.dk>
Tue, 09 Sep 2008 21:32:39 +0200
changeset 7014 46456a51e247
parent 7013 f56e788fa292
child 7015 6651de7176a0
i18n: use gettext instead of _ Both gettext and _ trigger a translation at runtime, but _ can only be used with a string argument since it also triggers string extraction.
doc/gendoc.py
--- a/doc/gendoc.py	Tue Sep 09 21:32:39 2008 +0200
+++ b/doc/gendoc.py	Tue Sep 09 21:32:39 2008 +0200
@@ -3,7 +3,7 @@
 sys.path.insert(0, "..")
 from mercurial import demandimport; demandimport.enable()
 from mercurial.commands import table, globalopts
-from mercurial.i18n import gettext as _
+from mercurial.i18n import gettext, _
 from mercurial.help import helptable
 
 def get_desc(docstr):
@@ -93,10 +93,10 @@
 
     # print topics
     for names, section, doc in helptable:
-        underlined(_(section).upper())
+        underlined(gettext(section).upper())
         if callable(doc):
             doc = doc()
-        ui.write(_(doc))
+        ui.write(gettext(doc))
         ui.write("\n")
 
 if __name__ == "__main__":