From fd03cb65606f9ac054be25f02693b9da9c2bce2d Mon Sep 17 00:00:00 2001 From: steffen123 Date: Sun, 15 Aug 2010 05:38:00 +0200 Subject: [PATCH] gettextify options --- pyfpdb/Options.py | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/pyfpdb/Options.py b/pyfpdb/Options.py index 6b5e3285..23656ff2 100644 --- a/pyfpdb/Options.py +++ b/pyfpdb/Options.py @@ -19,35 +19,39 @@ import sys from optparse import OptionParser # http://docs.python.org/library/optparse.html +import gettext +trans = gettext.translation("fpdb", localedir="locale", languages=["de_DE"]) +trans.install() + def fpdb_options(): """Process command line options for fpdb and HUD_main.""" parser = OptionParser() parser.add_option("-x", "--errorsToConsole", action="store_true", - help="If passed error output will go to the console rather than .") + help=_("If passed error output will go to the console rather than .")) parser.add_option("-d", "--databaseName", dest="dbname", - help="Overrides the default database name") + help=_("Overrides the default database name")) parser.add_option("-c", "--configFile", dest="config", default=None, - help="Specifies a configuration file.") + help=_("Specifies a configuration file.")) parser.add_option("-r", "--rerunPython", action="store_true", - help="Indicates program was restarted with a different path (only allowed once).") + help=_("Indicates program was restarted with a different path (only allowed once).")) parser.add_option("-i", "--infile", dest="infile", default="Slartibartfast", - help="Input file") + help=_("Input file")) parser.add_option("-k", "--konverter", dest="hhc", default="PokerStarsToFpdb", - help="Module name for Hand History Converter") + help=_("Module name for Hand History Converter")) parser.add_option("-l", "--logging", dest = "log_level", choices = ('DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL', 'EMPTY'), - help = "Error logging level. (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)", + help = _("Error logging level:")+" (DEBUG, INFO, WARNING, ERROR, CRITICAL, EMPTY)", default = 'EMPTY') parser.add_option("-v", "--version", action = "store_true", - help = "Print version information and exit.") + help = _("Print version information and exit.")) (options, argv) = parser.parse_args() return (options, argv) @@ -58,5 +62,5 @@ if __name__== "__main__": print "database name =", options.dbname print "config file =", options.config - print "press enter to end" + print _("press enter to end") sys.stdin.readline()