Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork33.7k
Description
Bug report
gettext functions and methods that consider plural forms (likengettext()) and directly or indirectly useGNUTranslations emit a deprecation warning if the number is not integer. But it only points to the line whereGNUTranslations methodsngettext() ornpgettext() 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 thegettext 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 anygettext code.
Also I have found that many code is not covered by tests (in particularNullTranslations and domain-aware functions likedngettext()). The PR extends tests.
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status