From caa18e4924694a1c8f3a013801865cb05238734e Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 30 Oct 2010 12:49:12 +0200 Subject: [PATCH 1/2] Topic: fix a translation --- plugins/Topic/locale/fr.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Topic/locale/fr.po b/plugins/Topic/locale/fr.po index e3f3aa23f..50872e50d 100644 --- a/plugins/Topic/locale/fr.po +++ b/plugins/Topic/locale/fr.po @@ -227,9 +227,9 @@ msgid "" " isn't sent in the channel itself.\n" " " msgstr "" -"[]\n" +"[] \n" "\n" -" Retourne le topic numéro du canal. est un index dans les topics. n'est nécessaire que si le message n'est pas envoyé sur le canal lui-même." +"Retourne le topic numéro du canal. est un index dans les topics. n'est nécessaire que si le message n'est pas envoyé sur le canal lui-même." #: plugin.py:415 msgid "" From 5150c4ef606fc876521e2d0bd0344d3c924a3069 Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Sat, 30 Oct 2010 12:49:43 +0200 Subject: [PATCH 2/2] Now tests if a plugin has the _ object before using it --- src/i18n.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/i18n.py b/src/i18n.py index 1d3864c73..7f6f4d1d1 100644 --- a/src/i18n.py +++ b/src/i18n.py @@ -209,8 +209,8 @@ class PluginInternationalization: return (be, has) def internationalizeDocstring(obj): - # FIXME: check if the plugin has an _ object - internationalizedCommands.update({hash(obj): obj}) - obj.__doc__=sys.modules[obj.__module__]._.__call__(obj.__doc__) - # We use _.__call__() instead of _() because of a pygettext warning. + if sys.modules[obj.__module__].__dict__.has_key('_'): + internationalizedCommands.update({hash(obj): obj}) + obj.__doc__=sys.modules[obj.__module__]._.__call__(obj.__doc__) + # We use _.__call__() instead of _() because of a pygettext warning. return obj