Skip to content

Commit

Permalink
Cleanup: remove support for pluralization during gettext resource tra…
Browse files Browse the repository at this point in the history
…nslation
  • Loading branch information
jayaddison committed Nov 17, 2022
1 parent cd3f2e4 commit 849a0e2
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions sphinx/locale/__init__.py
Expand Up @@ -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
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

Expand Down

0 comments on commit 849a0e2

Please sign in to comment.