diff options
-rw-r--r-- | fietsboek/util.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fietsboek/util.py b/fietsboek/util.py index ecf5b66..da3d530 100644 --- a/fietsboek/util.py +++ b/fietsboek/util.py @@ -311,6 +311,7 @@ def check_password_constraints(password: str, repeat_password: Optional[str] = N if len(password) < 8: raise ValueError(_("password_constraint.length")) + def _locale_packages(locale_packages: Optional[list[str]] = None) -> list[str]: # We expect this to be "fietsboek", but we are open to forks. my_package = __name__.split(".", 1)[0] @@ -395,14 +396,15 @@ def list_locales(locale_packages: Optional[list[str]] = None) -> list[tuple[str, continue locale_name = potential_locale.name try: - display_name = ((potential_locale / DISPLAY_NAME_PATH) - .read_text(encoding="utf-8")) + display_name = (potential_locale / DISPLAY_NAME_PATH).read_text( + encoding="utf-8" + ) except FileNotFoundError: display_name = locale_name locales.append((locale_name, display_name)) except FileNotFoundError: continue - locales.sort(key=lambda l: l[0]) + locales.sort(key=lambda locale: locale[0]) return locales |