[fix] languages and disambiguation do initialization by default
This commit is contained in:
@@ -59,6 +59,9 @@ def init_languages(languages_dir=LANGUAGES_DIR):
|
||||
languages_initialized = True
|
||||
|
||||
|
||||
init_languages()
|
||||
|
||||
|
||||
def get_country_languages(country, official=True, overrides=True):
|
||||
if official:
|
||||
languages = official_languages[country]
|
||||
|
||||
@@ -32,16 +32,10 @@ WELL_REPRESENTED_LANGUAGE_COUNTRIES = {
|
||||
'pt': set(['pt', 'br']),
|
||||
}
|
||||
|
||||
char_scripts = []
|
||||
script_languages = {}
|
||||
char_scripts = get_chars_by_script()
|
||||
script_languages = {script: set(langs) for script, langs in get_script_languages().iteritems()}
|
||||
|
||||
|
||||
def init_disambiguation():
|
||||
global char_scripts, script_languages
|
||||
char_scripts[:] = []
|
||||
char_scripts.extend(get_chars_by_script())
|
||||
script_languages.update({script: set(langs) for script, langs in get_script_languages().iteritems()})
|
||||
|
||||
UNKNOWN_SCRIPT = 'Unknown'
|
||||
COMMON_SCRIPT = 'Common'
|
||||
MAX_ASCII = 127
|
||||
|
||||
Reference in New Issue
Block a user