From d58ad0c86fcf55477577cc55d2592065ec1ff69b Mon Sep 17 00:00:00 2001 From: Valentin Lorentz Date: Fri, 21 Dec 2012 20:08:34 +0100 Subject: [PATCH] Reload translation of command helps when language changes. --- src/i18n.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/i18n.py b/src/i18n.py index b960d67ac..5a9d73450 100644 --- a/src/i18n.py +++ b/src/i18n.py @@ -68,6 +68,7 @@ def import_conf(): conf.registerGlobalValue(conf.supybot, 'language', conf.registry.String(currentLocale, """Determines the bot's default language. Valid values are things like en, fr, de, etc.""")) + conf.supybot.language.addCallback(reloadLocalesIfRequired) def getPluginDir(plugin_name): """Gets the directory of the given plugin""" @@ -118,8 +119,8 @@ def reloadLocalesIfRequired(): def reloadLocales(): for pluginName in i18nClasses: i18nClasses[pluginName].loadLocale() - for commandHash in internationalizedCommands: - internationalizeDocstring(internationalizedCommands[commandHash]) + for command in internationalizedCommands.values(): + internationalizeDocstring(command) for function in internationalizedFunctions: function.loadLocale()