Reload translation of command helps when language changes.

This commit is contained in:
Valentin Lorentz 2012-12-21 20:08:34 +01:00
parent 989c674c58
commit d58ad0c86f

View File

@ -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()