diff options
author | Wojtek Kosior <koszko@koszko.org> | 2022-10-28 20:15:30 +0200 |
---|---|---|
committer | Wojtek Kosior <koszko@koszko.org> | 2022-10-28 20:15:30 +0200 |
commit | 43ed7392cdfc734a4304284906b9d0d503381841 (patch) | |
tree | 5d78662357507aac0820825a8ace0859c395779d /src/hydrilla/translations.py | |
parent | 2a622842c38f1f9df2aee6af28bf9932d05a2ef0 (diff) | |
download | haketilo-hydrilla-43ed7392cdfc734a4304284906b9d0d503381841.tar.gz haketilo-hydrilla-43ed7392cdfc734a4304284906b9d0d503381841.zip |
[proxy] make it possible to export embedded documentation as standalone .html files and include these in the binary release tarball
Diffstat (limited to 'src/hydrilla/translations.py')
-rw-r--r-- | src/hydrilla/translations.py | 8 |
1 files changed, 4 insertions, 4 deletions
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] = {} |