From f3d5cd160209a1cbc83248c7ef17ca6bfd74a282 Mon Sep 17 00:00:00 2001 From: Zixuan James Li Date: Mon, 1 Aug 2022 19:00:47 -0400 Subject: [PATCH] Mark unicode translation functions for deprecation. https://docs.djangoproject.com/en/4.0/releases/4.0/#features-removed-in-4-0. Signed-off-by: Zixuan James Li --- django-stubs/utils/translation/__init__.pyi | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/django-stubs/utils/translation/__init__.pyi b/django-stubs/utils/translation/__init__.pyi index abef8dd608..cd9d50d01b 100644 --- a/django-stubs/utils/translation/__init__.pyi +++ b/django-stubs/utils/translation/__init__.pyi @@ -27,11 +27,8 @@ class Trans: def __getattr__(self, real_name: Any): ... def gettext_noop(message: str) -> str: ... -def ugettext_noop(message: str) -> str: ... def gettext(message: str) -> str: ... -def ugettext(message: str) -> str: ... def ngettext(singular: str, plural: str, number: float) -> str: ... -def ungettext(singular: str, plural: str, number: float) -> str: ... def pgettext(context: str, message: str) -> str: ... def npgettext(context: str, singular: str, plural: str, number: int) -> str: ... @@ -41,6 +38,12 @@ def pgettext_lazy(context: str, message: str) -> Promise: ... def ngettext_lazy(singular: str, plural: str, number: Union[int, str, None] = ...) -> Promise: ... def npgettext_lazy(context: str, singular: str, plural: str, number: Union[int, str, None] = ...) -> Promise: ... +# NOTE: These translation functions are deprecated and removed in Django 4.0. We should remove them when we drop +# support for 3.2 +def ugettext_noop(message: str) -> str: ... +def ugettext(message: str) -> str: ... +def ungettext(singular: str, plural: str, number: float) -> str: ... + ugettext_lazy = gettext_lazy ungettext_lazy = ngettext_lazy