mirror of
https://github.com/Mikaela/Limnoria.git
synced 2025-02-18 22:51:01 +01:00
Reload translation of command helps when language changes.
This commit is contained in:
parent
989c674c58
commit
d58ad0c86f
@ -68,6 +68,7 @@ def import_conf():
|
|||||||
conf.registerGlobalValue(conf.supybot, 'language',
|
conf.registerGlobalValue(conf.supybot, 'language',
|
||||||
conf.registry.String(currentLocale, """Determines the bot's default
|
conf.registry.String(currentLocale, """Determines the bot's default
|
||||||
language. Valid values are things like en, fr, de, etc."""))
|
language. Valid values are things like en, fr, de, etc."""))
|
||||||
|
conf.supybot.language.addCallback(reloadLocalesIfRequired)
|
||||||
|
|
||||||
def getPluginDir(plugin_name):
|
def getPluginDir(plugin_name):
|
||||||
"""Gets the directory of the given plugin"""
|
"""Gets the directory of the given plugin"""
|
||||||
@ -118,8 +119,8 @@ def reloadLocalesIfRequired():
|
|||||||
def reloadLocales():
|
def reloadLocales():
|
||||||
for pluginName in i18nClasses:
|
for pluginName in i18nClasses:
|
||||||
i18nClasses[pluginName].loadLocale()
|
i18nClasses[pluginName].loadLocale()
|
||||||
for commandHash in internationalizedCommands:
|
for command in internationalizedCommands.values():
|
||||||
internationalizeDocstring(internationalizedCommands[commandHash])
|
internationalizeDocstring(command)
|
||||||
for function in internationalizedFunctions:
|
for function in internationalizedFunctions:
|
||||||
function.loadLocale()
|
function.loadLocale()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user