Merge branch 'i18n' into l10n-fr

This commit is contained in:
Valentin Lorentz 2010-10-31 11:31:53 +01:00
commit f536540204
6 changed files with 17 additions and 1 deletions

View File

@ -42,7 +42,6 @@ import supybot.irclib as irclib
import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
from supybot.utils.iter import ifilter
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Misc')

View File

@ -29,6 +29,8 @@
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Note')
def configure(advanced):
# This will be called by supybot to configure this module. advanced is

View File

@ -42,6 +42,8 @@ import supybot.ircmsgs as ircmsgs
import supybot.plugins as plugins
import supybot.ircutils as ircutils
import supybot.callbacks as callbacks
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Note')
class NoteRecord(dbi.Record):
__fields__ = [

View File

@ -30,6 +30,8 @@
import supybot.conf as conf
import supybot.registry as registry
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Owner')
def configure(advanced):
# This will be called by supybot to configure this module. advanced is

View File

@ -54,6 +54,8 @@ import supybot.ircmsgs as ircmsgs
import supybot.ircutils as ircutils
import supybot.registry as registry
import supybot.callbacks as callbacks
from supybot.i18n import PluginInternationalization, internationalizeDocstring
_ = PluginInternationalization('Owner')
###
# supybot.commands.

View File

@ -37,6 +37,7 @@ import unittest
import threading
import supybot.log as log
import supybot.i18n as i18n
import supybot.conf as conf
import supybot.utils as utils
import supybot.ircdb as ircdb
@ -359,6 +360,7 @@ class PluginTestCase(SupyTestCase):
return
for cb in self.irc.callbacks:
name = cb.name()
print " --- " + name
if ((name in self._noTestDoc) and \
not name.lower() in self.__class__.__name__.lower()):
continue
@ -370,6 +372,13 @@ class PluginTestCase(SupyTestCase):
attr == callbacks.canonicalName(attr):
self.failUnless(getattr(cb, attr, None).__doc__,
'%s.%s has no help.' % (name, attr))
def testInternationalization(self):
name = self.__class__.__module__[0:-len('.test')]
if self.__class__.__module__.startswith('supybot'):
return
self.failIf(hasattr(sys.modules[name], '_') == False,
'%s has no internationalizer.' % name)
class ChannelPluginTestCase(PluginTestCase):