From 6737424bc6fae02da68fbf0655ea1cd4ac1142e2 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 29 Oct 2010 15:33:36 +0200 Subject: [PATCH] Shorten PluginInternationalisation.get* in src/i18n.py --- src/i18n.py | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/i18n.py b/src/i18n.py index 6f80564b2..51db7ba3c 100644 --- a/src/i18n.py +++ b/src/i18n.py @@ -184,38 +184,29 @@ class PluginInternationalization: def _getL10nCode(self): return getLocalePath('supybot', self.currentLocaleName, 'py') - def getPluralizers(self, current_pluralize, current_depluralize): + def getPluralizers(self, pluralize, depluralize): # This should be used only by src/utils/str.py try: execfile(self._getL10nCode()) except IOError: - pass # Handled by the else v- - if locals().has_key('pluralize') and locals().has_key('depluralize'): - return (pluralize, depluralize) - else: - return (current_pluralize, current_depluralize) + pass + return (pluralize, depluralize) - def getOrdinal(self, current_ordinal): + def getOrdinal(self, ordinal): # This should be used only by src/utils/str.py try: execfile(self._getL10nCode()) except IOError: - pass # Handled by the else v- - if locals().has_key('ordinal'): - return ordinal - else: - return current_ordinal + pass + return ordinal - def getBeAndHave(self, current_be, current_have): + def getBeAndHave(self, be, have): # This should be used only by src/utils/str.py try: execfile(self._getL10nCode()) except IOError: - pass # Handled by the else v- - if locals().has_key('be') and locals().has_key('have'): - return (be, have) - else: - return (current_be, current_have) + pass + return (be, have) def internationalizeDocstring(obj): # FIXME: check if the plugin has an _ object