mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 12:43:09 +01:00
i18n: Validate value of supybot.language
This commit is contained in:
parent
93370b6f0e
commit
fd04fccaec
@ -70,10 +70,12 @@ def import_conf():
|
|||||||
"""Imports the conf into this module"""
|
"""Imports the conf into this module"""
|
||||||
global conf
|
global conf
|
||||||
conf = __import__('supybot.conf').conf
|
conf = __import__('supybot.conf').conf
|
||||||
|
class Languages(conf.registry.OnlySomeStrings):
|
||||||
|
validStrings = ['de', 'en', 'es', 'fi', 'fr', 'it']
|
||||||
conf.registerGlobalValue(conf.supybot, 'language',
|
conf.registerGlobalValue(conf.supybot, 'language',
|
||||||
conf.registry.String(currentLocale, """Determines the bot's default
|
Languages(currentLocale, """Determines the bot's default
|
||||||
language if translations exist. Currently supported are 'de', 'en',
|
language if translations exist. Currently supported are: %s"""
|
||||||
'es', 'fi', 'fr' and 'it'."""))
|
% ', '.join(Languages.validStrings)))
|
||||||
conf.supybot.language.addCallback(reloadLocalesIfRequired)
|
conf.supybot.language.addCallback(reloadLocalesIfRequired)
|
||||||
|
|
||||||
def getPluginDir(plugin_name):
|
def getPluginDir(plugin_name):
|
||||||
|
Loading…
Reference in New Issue
Block a user