spambayes/spambayes i18n.py,1.7,1.8

"Mark Hammond" <[email protected]> Thu, 28 Jun 2007 18:08:45 -0700
Newsgroups gmane.mail.spam.spambayes.cvs
Message-ID <[email protected]>
Update of /cvsroot/spambayes/spambayes/spambayes
In directory sc8-pr-cvs8.sourceforge.net:/tmp/cvs-serv21706/spambayes

Modified Files:
	i18n.py 
Log Message:
To help in testing localizations, let SPAMBAYES_LANG in the environment
override getdefaultlocale()[0]


Index: i18n.py
===================================================================
RCS file: /cvsroot/spambayes/spambayes/spambayes/i18n.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** i18n.py	8 Mar 2007 23:21:30 -0000	1.7
--- i18n.py	29 Jun 2007 01:08:43 -0000	1.8
***************
*** 115,120 ****
          """Get the default language for the locale."""
          # Note that this may return None.
!         return getdefaultlocale()[0] 
!             
      def add_language(self, lang_code=None):
          """Add a language to the current languages list.
--- 115,123 ----
          """Get the default language for the locale."""
          # Note that this may return None.
!         try:
!             return os.environ["SPAMBAYES_LANG"]
!         except KeyError:
!             return getdefaultlocale()[0] 
! 
      def add_language(self, lang_code=None):
          """Add a language to the current languages list.