aboutsummaryrefslogtreecommitdiff
path: root/src/hydrilla/translations.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/hydrilla/translations.py')
-rw-r--r--src/hydrilla/translations.py8
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] = {}