diff --git a/package_build/i18n.py b/package_build/i18n.py index ea3d8f2..5bdf778 100644 --- a/package_build/i18n.py +++ b/package_build/i18n.py @@ -6,8 +6,9 @@ def get_preferred_languages() -> list[str]: - headers = _get_websocket_headers() - return re.findall(r"([a-zA-Z-]{2,})", headers["Accept-Language"]) or [] + headers = _get_websocket_headers() or {} + accept_language = headers.get("Accept-Language") or "" + return re.findall(r"([a-zA-Z-]{2,})", accept_language) or [] locale_dir = Path(__file__).parent / "locale"