Iwant: Make i18n module optional.
This commit is contained in:
parent
37144ac176
commit
576e3f1e87
@ -30,9 +30,16 @@
|
|||||||
|
|
||||||
import supybot.conf as conf
|
import supybot.conf as conf
|
||||||
import supybot.registry as registry
|
import supybot.registry as registry
|
||||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
|
||||||
|
|
||||||
_ = PluginInternationalization('Iwant')
|
try:
|
||||||
|
from supybot.i18n import PluginInternationalization
|
||||||
|
from supybot.i18n import internationalizeDocstring
|
||||||
|
_ = PluginInternationalization('Iwant')
|
||||||
|
except:
|
||||||
|
# This are useless functions that's allow to run the plugin on a bot
|
||||||
|
# without the i18n plugin
|
||||||
|
_ = lambda x:x
|
||||||
|
internationalizeDocstring = lambda x:x
|
||||||
|
|
||||||
def configure(advanced):
|
def configure(advanced):
|
||||||
# This will be called by supybot to configure this module. advanced is
|
# This will be called by supybot to configure this module. advanced is
|
||||||
|
@ -35,9 +35,16 @@ from supybot.commands import *
|
|||||||
import supybot.plugins as plugins
|
import supybot.plugins as plugins
|
||||||
import supybot.ircutils as ircutils
|
import supybot.ircutils as ircutils
|
||||||
import supybot.callbacks as callbacks
|
import supybot.callbacks as callbacks
|
||||||
from supybot.i18n import PluginInternationalization, internationalizeDocstring
|
|
||||||
|
|
||||||
_ = PluginInternationalization('Iwant')
|
try:
|
||||||
|
from supybot.i18n import PluginInternationalization
|
||||||
|
from supybot.i18n import internationalizeDocstring
|
||||||
|
_ = PluginInternationalization('Iwant')
|
||||||
|
except:
|
||||||
|
# This are useless functions that's allow to run the plugin on a bot
|
||||||
|
# without the i18n plugin
|
||||||
|
_ = lambda x:x
|
||||||
|
internationalizeDocstring = lambda x:x
|
||||||
|
|
||||||
def unserialize(string):
|
def unserialize(string):
|
||||||
list = string.replace('||', '|').split(' | ')
|
list = string.replace('||', '|').split(' | ')
|
||||||
|
Loading…
x
Reference in New Issue
Block a user