From 48c0bf071301a69350559b3832eef97f735d65d1 Mon Sep 17 00:00:00 2001 From: Seth Yastrov Date: Fri, 4 Jun 2021 15:02:08 +0200 Subject: [PATCH] get_language can sometimes return None (#633) https://docs.djangoproject.com/en/3.2/ref/utils/#django.utils.translation.get_language > Returns the currently selected language code. Returns None if translations are temporarily deactivated (by deactivate_all() or when None is passed to override()). --- django-stubs/utils/translation/__init__.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django-stubs/utils/translation/__init__.pyi b/django-stubs/utils/translation/__init__.pyi index 08a1ede..53fa38e 100644 --- a/django-stubs/utils/translation/__init__.pyi +++ b/django-stubs/utils/translation/__init__.pyi @@ -59,7 +59,7 @@ class override(ContextDecorator): def __enter__(self) -> None: ... def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ... -def get_language() -> str: ... +def get_language() -> Optional[str]: ... def get_language_from_path(path: str) -> Optional[str]: ... def get_language_bidi() -> bool: ... def check_for_language(lang_code: Optional[str]) -> bool: ...