mirror of
https://github.com/davidhalter/django-stubs.git
synced 2025-12-13 15:31:55 +08:00
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:
@@ -59,7 +59,7 @@ class override(ContextDecorator):
|
|||||||
def __enter__(self) -> None: ...
|
def __enter__(self) -> None: ...
|
||||||
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> 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_from_path(path: str) -> Optional[str]: ...
|
||||||
def get_language_bidi() -> bool: ...
|
def get_language_bidi() -> bool: ...
|
||||||
def check_for_language(lang_code: Optional[str]) -> bool: ...
|
def check_for_language(lang_code: Optional[str]) -> bool: ...
|
||||||
|
|||||||
Reference in New Issue
Block a user