summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAarni Koskela <akx@iki.fi>2022-01-28 17:44:22 +0200
committerAarni Koskela <akx@iki.fi>2022-01-28 17:44:22 +0200
commit7533914882b601475258ea0cdb0dfb3f056000be (patch)
tree5598383d767af2dde13c3547b51bbc3c05c4b266
parent9d6803a2700df9228f0b6a9614ec7a44a3ad27bb (diff)
downloadbabel-7533914882b601475258ea0cdb0dfb3f056000be.tar.gz
Add deprecations to l*gettext variants
-rw-r--r--babel/support.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/babel/support.py b/babel/support.py
index 368191f..021c0b1 100644
--- a/babel/support.py
+++ b/babel/support.py
@@ -319,6 +319,9 @@ class NullTranslations(gettext.NullTranslations, object):
"""Like ``lgettext()``, but look the message up in the specified
domain.
"""
+ import warnings
+ warnings.warn('ldgettext() is deprecated, use dgettext() instead',
+ DeprecationWarning, 2)
return self._domains.get(domain, self).lgettext(message)
def udgettext(self, domain, message):
@@ -339,6 +342,9 @@ class NullTranslations(gettext.NullTranslations, object):
"""Like ``lngettext()``, but look the message up in the specified
domain.
"""
+ import warnings
+ warnings.warn('ldngettext() is deprecated, use dngettext() instead',
+ DeprecationWarning, 2)
return self._domains.get(domain, self).lngettext(singular, plural, num)
def udngettext(self, domain, singular, plural, num):
@@ -378,6 +384,9 @@ class NullTranslations(gettext.NullTranslations, object):
preferred system encoding, if no other encoding was explicitly set with
``bind_textdomain_codeset()``.
"""
+ import warnings
+ warnings.warn('lpgettext() is deprecated, use pgettext() instead',
+ DeprecationWarning, 2)
ctxt_msg_id = self.CONTEXT_ENCODING % (context, message)
missing = object()
tmsg = self._catalog.get(ctxt_msg_id, missing)
@@ -417,6 +426,9 @@ class NullTranslations(gettext.NullTranslations, object):
preferred system encoding, if no other encoding was explicitly set with
``bind_textdomain_codeset()``.
"""
+ import warnings
+ warnings.warn('lnpgettext() is deprecated, use npgettext() instead',
+ DeprecationWarning, 2)
ctxt_msg_id = self.CONTEXT_ENCODING % (context, singular)
try:
tmsg = self._catalog[(ctxt_msg_id, self.plural(num))]