mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-23 19:22:45 +01:00
Shorten PluginInternationalisation.get* in src/i18n.py
This commit is contained in:
parent
ec6a267c09
commit
6737424bc6
21
src/i18n.py
21
src/i18n.py
@ -184,38 +184,29 @@ class PluginInternationalization:
|
|||||||
def _getL10nCode(self):
|
def _getL10nCode(self):
|
||||||
return getLocalePath('supybot', self.currentLocaleName, 'py')
|
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
|
# This should be used only by src/utils/str.py
|
||||||
try:
|
try:
|
||||||
execfile(self._getL10nCode())
|
execfile(self._getL10nCode())
|
||||||
except IOError:
|
except IOError:
|
||||||
pass # Handled by the else v-
|
pass
|
||||||
if locals().has_key('pluralize') and locals().has_key('depluralize'):
|
|
||||||
return (pluralize, depluralize)
|
return (pluralize, depluralize)
|
||||||
else:
|
|
||||||
return (current_pluralize, current_depluralize)
|
|
||||||
|
|
||||||
def getOrdinal(self, current_ordinal):
|
def getOrdinal(self, ordinal):
|
||||||
# This should be used only by src/utils/str.py
|
# This should be used only by src/utils/str.py
|
||||||
try:
|
try:
|
||||||
execfile(self._getL10nCode())
|
execfile(self._getL10nCode())
|
||||||
except IOError:
|
except IOError:
|
||||||
pass # Handled by the else v-
|
pass
|
||||||
if locals().has_key('ordinal'):
|
|
||||||
return ordinal
|
return ordinal
|
||||||
else:
|
|
||||||
return current_ordinal
|
|
||||||
|
|
||||||
def getBeAndHave(self, current_be, current_have):
|
def getBeAndHave(self, be, have):
|
||||||
# This should be used only by src/utils/str.py
|
# This should be used only by src/utils/str.py
|
||||||
try:
|
try:
|
||||||
execfile(self._getL10nCode())
|
execfile(self._getL10nCode())
|
||||||
except IOError:
|
except IOError:
|
||||||
pass # Handled by the else v-
|
pass
|
||||||
if locals().has_key('be') and locals().has_key('have'):
|
|
||||||
return (be, have)
|
return (be, have)
|
||||||
else:
|
|
||||||
return (current_be, current_have)
|
|
||||||
|
|
||||||
def internationalizeDocstring(obj):
|
def internationalizeDocstring(obj):
|
||||||
# FIXME: check if the plugin has an _ object
|
# FIXME: check if the plugin has an _ object
|
||||||
|
Loading…
Reference in New Issue
Block a user