mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
gettext: various fixes (#4125)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import sys
|
||||
from typing import overload, Any, Container, IO, Iterable, Optional, Type, TypeVar, Union
|
||||
from typing import overload, Any, Container, IO, Iterable, Optional, Sequence, Type, TypeVar, Union
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
from typing import Literal
|
||||
@@ -13,15 +13,16 @@ else:
|
||||
_Path = str
|
||||
|
||||
class NullTranslations:
|
||||
def __init__(self, fp: IO[str] = ...) -> None: ...
|
||||
def __init__(self, fp: Optional[IO[str]] = ...) -> None: ...
|
||||
def _parse(self, fp: IO[str]) -> None: ...
|
||||
def add_fallback(self, fallback: NullTranslations) -> None: ...
|
||||
def gettext(self, message: str) -> str: ...
|
||||
def lgettext(self, message: str) -> str: ...
|
||||
def ngettext(self, singular: str, plural: str, n: int) -> str: ...
|
||||
def lngettext(self, singular: str, plural: str, n: int) -> str: ...
|
||||
def pgettext(self, context: str, message: str) -> str: ...
|
||||
def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def ngettext(self, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def lngettext(self, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def pgettext(self, context: str, message: str) -> str: ...
|
||||
def npgettext(self, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def info(self) -> Any: ...
|
||||
def charset(self) -> Any: ...
|
||||
def output_charset(self) -> Any: ...
|
||||
@@ -31,6 +32,8 @@ class NullTranslations:
|
||||
class GNUTranslations(NullTranslations):
|
||||
LE_MAGIC: int
|
||||
BE_MAGIC: int
|
||||
CONTEXT: str
|
||||
VERSIONS: Sequence[int]
|
||||
|
||||
def find(domain: str, localedir: Optional[_Path] = ..., languages: Optional[Iterable[str]] = ...,
|
||||
all: bool = ...) -> Any: ...
|
||||
@@ -54,15 +57,16 @@ def bindtextdomain(domain: str, localedir: Optional[_Path] = ...) -> str: ...
|
||||
def bind_textdomain_codeset(domain: str, codeset: Optional[str] = ...) -> str: ...
|
||||
def dgettext(domain: str, message: str) -> str: ...
|
||||
def ldgettext(domain: str, message: str) -> str: ...
|
||||
def dngettext(domain: str, singular: str, plural: str, n: int) -> str: ...
|
||||
def ldngettext(domain: str, singular: str, plural: str, n: int) -> str: ...
|
||||
def dngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def ldngettext(domain: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def gettext(message: str) -> str: ...
|
||||
def lgettext(message: str) -> str: ...
|
||||
def ngettext(singular: str, plural: str, n: int) -> str: ...
|
||||
def lngettext(singular: str, plural: str, n: int) -> str: ...
|
||||
def pgettext(context: str, message: str) -> str: ...
|
||||
def dpgettext(domain: str, context: str, message: str) -> str: ...
|
||||
def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def ngettext(msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def lngettext(msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
if sys.version_info >= (3, 8):
|
||||
def pgettext(context: str, message: str) -> str: ...
|
||||
def dpgettext(domain: str, context: str, message: str) -> str: ...
|
||||
def npgettext(context: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
def dnpgettext(domain: str, context: str, msgid1: str, msgid2: str, n: int) -> str: ...
|
||||
|
||||
Catalog = translation
|
||||
|
||||
Reference in New Issue
Block a user