From 0f723e0357ab290125e6a8e099e8fc1752eb37f0 Mon Sep 17 00:00:00 2001 From: James Addison Date: Thu, 17 Nov 2022 10:26:04 +0000 Subject: [PATCH] Cleanup: remove support for pluralization during gettext resource translation --- sphinx/locale/__init__.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/sphinx/locale/__init__.py b/sphinx/locale/__init__.py index d0a83dc3d54..97b12ea8284 100644 --- a/sphinx/locale/__init__.py +++ b/sphinx/locale/__init__.py @@ -221,16 +221,13 @@ def setup(app): .. versionadded:: 1.8 """ - def gettext(message: str, *args: Any) -> str: + def gettext(message: str) -> str: if not is_translator_registered(catalog, namespace): # not initialized yet return _TranslationProxy(_lazy_translate, catalog, namespace, message) # type: ignore[return-value] # noqa: E501 else: translator = get_translator(catalog, namespace) - if len(args) <= 1: - return translator.gettext(message) - else: # support pluralization - return translator.ngettext(message, args[0], args[1]) + return translator.gettext(message) return gettext