mirror of
https://github.com/davidhalter/django-stubs.git
synced 2026-08-16 12:48:03 +08:00
first version finished
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from typing import (
|
||||
Optional,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def activate(language: str) -> None: ...
|
||||
|
||||
|
||||
def check_for_language(lang_code: Optional[str]) -> bool: ...
|
||||
|
||||
|
||||
def deactivate() -> None: ...
|
||||
|
||||
|
||||
def deactivate_all() -> None: ...
|
||||
|
||||
|
||||
def get_language() -> Optional[str]: ...
|
||||
|
||||
|
||||
def get_language_bidi() -> bool: ...
|
||||
|
||||
|
||||
def get_language_from_path(path: str) -> Optional[str]: ...
|
||||
|
||||
|
||||
def get_language_from_request(request: WSGIRequest, check_path: bool = ...) -> str: ...
|
||||
|
||||
|
||||
def get_language_info(lang_code: str): ...
|
||||
|
||||
|
||||
def gettext(message: str) -> str: ...
|
||||
|
||||
|
||||
def gettext_noop(message: str) -> str: ...
|
||||
|
||||
|
||||
def ngettext(singular: str, plural: str, number: Union[float, int]) -> str: ...
|
||||
|
||||
|
||||
def npgettext(context: str, singular: str, plural: str, number: int) -> str: ...
|
||||
|
||||
|
||||
def pgettext(context: str, message: str) -> str: ...
|
||||
|
||||
|
||||
def templatize(src: str, **kwargs) -> str: ...
|
||||
|
||||
|
||||
def to_language(locale: str) -> str: ...
|
||||
|
||||
|
||||
def to_locale(language: str) -> str: ...
|
||||
|
||||
|
||||
def trim_whitespace(s: str) -> str: ...
|
||||
|
||||
|
||||
class override:
|
||||
def __enter__(self) -> None: ...
|
||||
def __exit__(self, exc_type: None, exc_value: None, traceback: None) -> None: ...
|
||||
def __init__(self, language: Optional[str], deactivate: bool = ...) -> None: ...
|
||||
@@ -0,0 +1,4 @@
|
||||
def blankout(src: str, char: str) -> str: ...
|
||||
|
||||
|
||||
def templatize(src: str, origin: str = ...) -> str: ...
|
||||
@@ -0,0 +1,10 @@
|
||||
def check_for_language(x: str) -> bool: ...
|
||||
|
||||
|
||||
def get_language_from_path(request: str) -> None: ...
|
||||
|
||||
|
||||
def get_supported_language_variant(lang_code: str, strict: bool = ...) -> str: ...
|
||||
|
||||
|
||||
def ngettext(singular: str, plural: str, number: int) -> str: ...
|
||||
@@ -0,0 +1,85 @@
|
||||
from collections import OrderedDict
|
||||
from django.core.handlers.wsgi import WSGIRequest
|
||||
from gettext import NullTranslations
|
||||
from typing import (
|
||||
List,
|
||||
Optional,
|
||||
Tuple,
|
||||
Union,
|
||||
)
|
||||
|
||||
|
||||
def activate(language: str) -> None: ...
|
||||
|
||||
|
||||
def all_locale_paths() -> List[str]: ...
|
||||
|
||||
|
||||
def check_for_language(lang_code: str) -> bool: ...
|
||||
|
||||
|
||||
def deactivate() -> None: ...
|
||||
|
||||
|
||||
def deactivate_all() -> None: ...
|
||||
|
||||
|
||||
def do_ntranslate(singular: str, plural: str, number: Union[float, int], translation_function: str) -> str: ...
|
||||
|
||||
|
||||
def get_language() -> Optional[str]: ...
|
||||
|
||||
|
||||
def get_language_bidi() -> bool: ...
|
||||
|
||||
|
||||
def get_language_from_path(path: str, strict: bool = ...) -> Optional[str]: ...
|
||||
|
||||
|
||||
def get_language_from_request(request: WSGIRequest, check_path: bool = ...) -> str: ...
|
||||
|
||||
|
||||
def get_languages() -> OrderedDict: ...
|
||||
|
||||
|
||||
def get_supported_language_variant(lang_code: Optional[str], strict: bool = ...) -> str: ...
|
||||
|
||||
|
||||
def gettext(message: str) -> str: ...
|
||||
|
||||
|
||||
def gettext_noop(message: str) -> str: ...
|
||||
|
||||
|
||||
def ngettext(singular: str, plural: str, number: Union[float, int]) -> str: ...
|
||||
|
||||
|
||||
def npgettext(context: str, singular: str, plural: str, number: int) -> str: ...
|
||||
|
||||
|
||||
def parse_accept_lang_header(lang_string: str) -> Tuple: ...
|
||||
|
||||
|
||||
def pgettext(context: str, message: str) -> str: ...
|
||||
|
||||
|
||||
def reset_cache(**kwargs) -> None: ...
|
||||
|
||||
|
||||
def translation(language: str) -> DjangoTranslation: ...
|
||||
|
||||
|
||||
class DjangoTranslation:
|
||||
def __init__(
|
||||
self,
|
||||
language: str,
|
||||
domain: Optional[str] = ...,
|
||||
localedirs: Optional[List[str]] = ...
|
||||
) -> None: ...
|
||||
def _add_fallback(self, localedirs: Optional[List[str]] = ...) -> None: ...
|
||||
def _add_installed_apps_translations(self) -> None: ...
|
||||
def _add_local_translations(self) -> None: ...
|
||||
def _init_translation_catalog(self) -> None: ...
|
||||
def _new_gnu_trans(self, localedir: str, use_null_fallback: bool = ...) -> NullTranslations: ...
|
||||
def merge(self, other: NullTranslations) -> None: ...
|
||||
def to_language(self) -> str: ...
|
||||
Reference in New Issue
Block a user