mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44: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
|
||||
|
||||
@@ -22,12 +22,6 @@ collections.UserString.maketrans
|
||||
contextlib._GeneratorContextManager.__init__
|
||||
ctypes.CDLL.__init__
|
||||
fractions.Fraction.__new__ # private _normalize param was made keyword-only in Python 3.6
|
||||
gettext.NullTranslations.npgettext
|
||||
gettext.NullTranslations.pgettext
|
||||
gettext.dnpgettext
|
||||
gettext.dpgettext
|
||||
gettext.npgettext
|
||||
gettext.pgettext
|
||||
importlib.metadata
|
||||
importlib.resources
|
||||
io.BufferedRandom.read1
|
||||
|
||||
@@ -20,12 +20,6 @@ copy.PyStringMap
|
||||
ctypes.CDLL.__init__
|
||||
email.message.MIMEPart.as_string
|
||||
enum.Enum._generate_next_value_
|
||||
gettext.NullTranslations.npgettext
|
||||
gettext.NullTranslations.pgettext
|
||||
gettext.dnpgettext
|
||||
gettext.dpgettext
|
||||
gettext.npgettext
|
||||
gettext.pgettext
|
||||
importlib.metadata
|
||||
importlib.resources
|
||||
io.BufferedRandom.read1
|
||||
|
||||
@@ -31,12 +31,6 @@ dataclasses.Field.__init__
|
||||
dataclasses.field
|
||||
email.message.MIMEPart.as_string
|
||||
enum.Enum._generate_next_value_
|
||||
gettext.NullTranslations.npgettext
|
||||
gettext.NullTranslations.pgettext
|
||||
gettext.dnpgettext
|
||||
gettext.dpgettext
|
||||
gettext.npgettext
|
||||
gettext.pgettext
|
||||
http.client.HTTPSConnection.__init__
|
||||
http.server.SimpleHTTPRequestHandler.__init__
|
||||
importlib.metadata
|
||||
|
||||
@@ -210,15 +210,6 @@ encodings.utf_8.encode
|
||||
enum.EnumMeta.__call__
|
||||
enum.EnumMeta.__new__
|
||||
getopt.GetoptError.__init__
|
||||
gettext.GNUTranslations.lngettext
|
||||
gettext.GNUTranslations.ngettext
|
||||
gettext.NullTranslations.__init__
|
||||
gettext.NullTranslations.lngettext
|
||||
gettext.NullTranslations.ngettext
|
||||
gettext.dngettext
|
||||
gettext.ldngettext
|
||||
gettext.lngettext
|
||||
gettext.ngettext
|
||||
hmac.HMAC.__init__
|
||||
html.parser.HTMLParser.feed
|
||||
http.HTTPStatus.description
|
||||
|
||||
Reference in New Issue
Block a user