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()).
This commit is contained in:
Seth Yastrov
2021-06-04 15:02:08 +02:00
committed by GitHub
parent 893ad6bb02
commit 48c0bf0713

View File

@@ -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: ...