django-debug-toolbar
django-debug-toolbar copied to clipboard
Error on compilemessages due to translations from django-debug-toolbar
The command django-admin compilemessages fails when I have django-debug-toolbar installed (I tried both 4.1.0 and 4.2.0 which is currently the latest release).
The full error is as follows (the #0 and timing at the start of each line are due to docker compose and should be irrelevant for the issue):
#0 5.203 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/pt_BR/LC_MESSAGES/django.po:151: a format specification for argument 'cache_calls', as in 'msgstr[0]', doesn't exist in 'msgid_plural'
#0 5.203 msgfmt: found 2 fatal errors
#0 5.203 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/sv_SE/LC_MESSAGES/django.po:81: number of format specifications in 'msgid' and 'msgstr' does not match
#0 5.203 msgfmt: found 1 fatal error
#0 5.203 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/sk/LC_MESSAGES/django.po:162: a format specification for argument 'cache_calls', as in 'msgstr[0]', doesn't exist in 'msgid_plural'
#0 5.203 msgfmt: found 4 fatal errors
#0 5.203 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/ca/LC_MESSAGES/django.po:80: number of format specifications in 'msgid' and 'msgstr' does not match
#0 5.203 msgfmt: found 1 fatal error
#0 5.203 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/pt/LC_MESSAGES/django.po:80: number of format specifications in 'msgid' and 'msgstr' does not match
#0 5.203 msgfmt: found 1 fatal error
#0 5.203 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/fi/LC_MESSAGES/django.po:150: a format specification for argument 'cache_calls', as in 'msgstr[0]', doesn't exist in 'msgid_plural'
#0 5.203 msgfmt: found 2 fatal errors
#0 5.203 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/zh_CN/LC_MESSAGES/django.po:146: a format specification for argument 'cache_calls', as in 'msgstr[0]', doesn't exist in 'msgid_plural'
#0 5.203 msgfmt: found 1 fatal error
#0 5.212 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/pl/LC_MESSAGES/django.po:155: a format specification for argument 'cache_calls', as in 'msgstr[0]', doesn't exist in 'msgid_plural'
#0 5.212 msgfmt: found 3 fatal errors
#0 5.213 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/uk/LC_MESSAGES/django.po:83: number of format specifications in 'msgid' and 'msgstr' does not match
#0 5.213 msgfmt: found 1 fatal error
#0 5.215 Execution of msgfmt failed: /tmp/.venv/Lib/site-packages/debug_toolbar/locale/cs/LC_MESSAGES/django.po:154: a format specification for argument 'cache_calls', as in 'msgstr[0]', doesn't exist in 'msgid_plural'
#0 5.215 msgfmt: found 3 fatal errors
All I can find from researching the error is that this error is due to plurals being used incorrectly, but the lines I checked from the traceback don't use any syntax for plurals and in fact seem unrelated to each other (sometimes they're the same place, like for catalan and portuguese, but for other languages they point to completely different places).
Needless to say I did not modify the package after installing it, and all this is running in a clean Docker container that other colleagues have been using for ages, except I'm on Windows (but the container isn't). Any clue why this isn't working for me?
I see a fuzzy translation at the first location:
No idea why the fuzzy translation wouldn't simply be ignored.
Apologies, the command actually includes --use-fuzzy. Still, I don't see why this should make it fail.
@matthiask is the problem that we have query_count and sql_time vs cache_calls and time
@tim-schilling Yes. I don't know why that would be a fatal error when the whole translation is marked as fuzzy though.
@berzi would you be able to create a minimal project that reproduces this effect?
@berzi would you be able to create a minimal project that reproduces this effect?
Unfortunately I don't think so, the error comes from an old and complex project from my company and it would be quite time-consuming to try and recreate it.
@berzi I understand, but from what we can see everything should be working. The only way for us to debug this would be to reproduce it. Since this work would most benefit you in particular, it feels reasonable to ask you to help us with that effort.
If you don't have time that's totally understandable.
This is a low priority for us because it's an undefined amount of work for an undefined amount of benefit.
@berzi I understand, but from what we can see everything should be working. The only way for us to debug this would be to reproduce it. Since this work would most benefit you in particular, it feels reasonable to ask you to help us with that effort.
If you don't have time that's totally understandable.
This is a low priority for us because it's an undefined amount of work for an undefined amount of benefit.
I understand that. The error doesn't block me at the moment so it's low priority for me as well. If I get any new clue or get the time to reproduce the error I'll post here again.
I'm fairly sure it has something to do with Windows, since I'm the only one of all my colleagues who worked and this and had this issue, but there's also many outdated things all along the pipeline (the Django version, the Docker Compose version...) so who knows.
That's actually a good place to start. What versions of python, docker compose and Django are you using?
On Wed, Dec 13, 2023, 6:27 AM berzi @.***> wrote:
@berzi https://github.com/berzi I understand, but from what we can see everything should be working. The only way for us to debug this would be to reproduce it. Since this work would most benefit you in particular, it feels reasonable to ask you to help us with that effort.
If you don't have time that's totally understandable.
This is a low priority for us because it's an undefined amount of work for an undefined amount of benefit.
I understand that. The error doesn't block me at the moment so it's low priority for me as well. If I get any new clue or get the time to reproduce the error I'll post here again.
I'm fairly sure it has something to do with Windows, since I'm the only one of all my colleagues who worked and this and had this issue, but there's also many outdated things all along the pipeline (the Django version, the Docker Compose version...) so who knows.
— Reply to this email directly, view it on GitHub https://github.com/jazzband/django-debug-toolbar/issues/1862#issuecomment-1853826108, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJYZP2UNELQU2KDU5F2TKTYJGNJLAVCNFSM6AAAAABAGFIZLOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNJTHAZDMMJQHA . You are receiving this because you were mentioned.Message ID: @.***>
Docker Compose: 3.7 Python: 3.10 Django: 3.2.20 Django debug toolbar: tried both 4.1.0 and 4.2.0
gettext and other dependencies are installed with the following command:
apt-get install --no-install-recommends -y \
gettext \
libgettextpo-dev \
procps \
locales