-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Description
Bug report
gettext functions and methods that consider plural forms (like ngettext()) and directly or indirectly use GNUTranslations emit a deprecation warning if the number is not integer. But it only points to the line where GNUTranslations methods ngettext() or npgettext() are used directly. Since module level functions use it indirectly, and methods of other classes can use it indirectly as a fallback, the deprecation warning usually points to the line in the gettext module instead of the line in the user code that uses it. It makes deprecation warnings much less useful.
The following PR dynamically calculate the stacklevel for warning, skipping any gettext code.
Also I have found that many code is not covered by tests (in particular NullTranslations and domain-aware functions like dngettext()). The PR extends tests.
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status