From 43ed7392cdfc734a4304284906b9d0d503381841 Mon Sep 17 00:00:00 2001 From: Wojtek Kosior Date: Fri, 28 Oct 2022 20:15:30 +0200 Subject: [proxy] make it possible to export embedded documentation as standalone .html files and include these in the binary release tarball --- src/hydrilla/translations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/hydrilla/translations.py') diff --git a/src/hydrilla/translations.py b/src/hydrilla/translations.py index 62c8c88..1ff8788 100644 --- a/src/hydrilla/translations.py +++ b/src/hydrilla/translations.py @@ -39,7 +39,7 @@ supported_locales = [f.name for f in localedir.iterdir() if f.is_dir()] default_locale = 'en_US' -def select_best_locale() -> str: +def select_best_locale(supported: t.Iterable[str] = supported_locales) -> str: """ .... @@ -56,8 +56,8 @@ def select_best_locale() -> str: if use_flask: best = flask.request.accept_languages.best_match( - supported_locales, - default=default_locale + supported, + default = default_locale ) assert best is not None return best @@ -72,7 +72,7 @@ def select_best_locale() -> str: except: pass - return locale if locale in supported_locales else default_locale + return locale if locale in supported else default_locale translations: t.Dict[str, gettext.NullTranslations] = {} -- cgit v1.2.3