diff --git a/lingua_franca/config.py b/lingua_franca/config.py index 1ad0f5fc..6efcf4b3 100644 --- a/lingua_franca/config.py +++ b/lingua_franca/config.py @@ -1,3 +1,3 @@ -load_langs_on_demand = False +load_langs_on_demand = True inject_timezones = True ovos_defaults = True # use mycroft.conf for default values diff --git a/lingua_franca/internal.py b/lingua_franca/internal.py index af62012c..91ec0807 100644 --- a/lingua_franca/internal.py +++ b/lingua_franca/internal.py @@ -360,7 +360,7 @@ def get_full_lang_code(lang=''): except UnsupportedLanguageError: warn(InvalidLangWarning) lang = get_default_loc() - return lang + return lang.lower() def __get_full_lang_code_deprecation_warning(lang=''): @@ -436,6 +436,8 @@ def nice_number(number, lang='', speech=True, denominators=None): "received this value:\n" + str(run_own_code_on)) # TODO deprecate these kwarg values 6-12 months after v0.3.0 releases + # TODO - deprecate the whole dynamic loading thing instead? this abandonware is hell to maintain.... + if run_own_code_on != [None]: def is_error_type(_type): if not callable(_type): diff --git a/lingua_franca/parse.py b/lingua_franca/parse.py index 1216e1fa..137be158 100644 --- a/lingua_franca/parse.py +++ b/lingua_franca/parse.py @@ -119,6 +119,7 @@ def extract_color_spans(text, lang=''): @localized_function(run_own_code_on=[FunctionNotLocalizedError]) def yes_or_no(text, lang=""): + lang = get_full_lang_code(lang) text = normalize(text, lang=lang, remove_articles=True).lower() return match_yes_or_no(text, lang)