diff jabberbot/i18n.py @ 2504:c27ee67397f0

Make pylint happy where it made sense, fix a few minor bugs.
author Karol 'grzywacz' Nowak <grzywacz@sul.uni.lodz.pl>
date Sun, 22 Jul 2007 05:33:02 +0200
parents 754e3eedb9e5
children af857f8c2e44
line wrap: on
line diff
--- a/jabberbot/i18n.py	Sun Jul 22 05:11:19 2007 +0200
+++ b/jabberbot/i18n.py	Sun Jul 22 05:33:02 2007 +0200
@@ -7,10 +7,10 @@
 """
 import logging, xmlrpclib
 
-translations = None
+TRANSLATIONS = None
 
 
-def getText(original, lang="en"):
+def get_text(original, lang="en"):
     """ Return a translation of text in the user's language.
 
         @type original: unicode
@@ -18,12 +18,12 @@
     if original == u"":
         return u""
 
-    global translations
-    if not translations:
+    global TRANSLATIONS
+    if not TRANSLATIONS:
         init_i18n()
 
     try:
-        return translations[lang][original]
+        return TRANSLATIONS[lang][original]
     except KeyError:
         return original
 
@@ -34,8 +34,8 @@
     @type config: jabberbot.config.BotConfig
 
     """
-    global translations
-    translations = request_translations(config) or {'en': {}}
+    global TRANSLATIONS
+    TRANSLATIONS = request_translations(config) or {'en': {}}
 
 
 def request_translations(config):