Changeset 1171 for pykota

Show
Ignore:
Timestamp:
10/24/03 23:52:46 (21 years ago)
Author:
jalet
Message:

Now can force language when coming from CGI script.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/tool.py

    r1152 r1171  
    2222# 
    2323# $Log$ 
     24# Revision 1.54  2003/10/24 21:52:46  jalet 
     25# Now can force language when coming from CGI script. 
     26# 
    2427# Revision 1.53  2003/10/08 21:41:38  jalet 
    2528# External policies for printers works ! 
     
    235238class PyKotaTool :     
    236239    """Base class for all PyKota command line tools.""" 
    237     def __init__(self, doc="PyKota %s (c) 2003 %s" % (version.__version__, version.__author__)) : 
     240    def __init__(self, lang=None, doc="PyKota %s (c) 2003 %s" % (version.__version__, version.__author__)) : 
    238241        """Initializes the command line tool.""" 
    239242        # locale stuff 
    240243        try : 
    241             locale.setlocale(locale.LC_ALL, "") 
     244            locale.setlocale(locale.LC_ALL, lang) 
    242245            gettext.install("pykota") 
    243246        except (locale.Error, IOError) : 
    244247            gettext.NullTranslations().install() 
     248            sys.stderr.write("PyKota : Error while loading translations\n") 
    245249     
    246250        # pykota specific stuff