[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r17934: {projects} Fix locale bug (kaner) (projects/gettor)



Author: ioerror
Date: 2009-01-05 18:30:50 -0500 (Mon, 05 Jan 2009)
New Revision: 17934

Modified:
   projects/gettor/gettor.py
   projects/gettor/gettor_responses.py
Log:
Fix locale bug (kaner)


Modified: projects/gettor/gettor.py
===================================================================
--- projects/gettor/gettor.py	2009-01-05 23:18:45 UTC (rev 17933)
+++ projects/gettor/gettor.py	2009-01-05 23:30:50 UTC (rev 17934)
@@ -132,7 +132,7 @@
         log.error(_("Won't send myself emails."))
         return False
 
-    resp = gettor_responses.gettorResponse(replyLang, logLang)
+    resp = gettor_responses.gettorResponse(replyLang, logLang, conf)
     signature = rmail.hasVerifiedSignature()
     log.info(_("Signature is: %s") % str(signature))
     # Addresses from whitelist can pass without DKIM signature

Modified: projects/gettor/gettor_responses.py
===================================================================
--- projects/gettor/gettor_responses.py	2009-01-05 23:18:45 UTC (rev 17933)
+++ projects/gettor/gettor_responses.py	2009-01-05 23:30:50 UTC (rev 17934)
@@ -22,9 +22,10 @@
 
 class gettorResponse:
 
-    def __init__(self, mailLang="en", logLang="en"):
+    def __init__(self, mailLang="en", logLang="en", config):
         self.mailLang = mailLang
         self.logLang = logLang
+        self.config = config
 
     def setLang(self, language):
         # XXX: Sorta hack, have nothing better on my mind right now
@@ -33,7 +34,7 @@
         # On every exit of a translation-needing function, call this with 
         # lang=loglang
         # :-/
-        trans = gettext.translation("gettor", "/usr/share/locale", [language])
+        trans = gettext.translation("gettor", self.config.getLocaleDir(), [language])
         trans.install()
 
     def sendHelp(self, source, destination):