Fixes #20766: Prevent translation of code/commands in error templates #872

Closed
opened 2026-04-05 18:23:45 +02:00 by MrUnknownDE · 0 comments
Owner

Originally created by @jnovinger on 11/14/2025

Fixes: #20766

Use blocktrans 'with' clause to pass literal code/commands as variables, preventing them from being translated. This fixes issues where commands like 'manage.py collectstatic' were incorrectly translated to nonsensical strings in non-English locales.

Updated templates:

  • media_failure.html: manage.py collectstatic
  • programming_error.html: python3 manage.py migrate, SELECT VERSION()
  • import_error.html: requirements.txt, local_requirements.txt, pip freeze
*Originally created by @jnovinger on 11/14/2025* ### Fixes: #20766 Use `blocktrans` 'with' clause to pass literal code/commands as variables, preventing them from being translated. This fixes issues where commands like 'manage.py collectstatic' were incorrectly translated to nonsensical strings in non-English locales. Updated templates: - `media_failure.html`: `manage.py collectstatic` - `programming_error.html`: `python3 manage.py migrate`, `SELECT VERSION()` - `import_error.html`: `requirements.txt`, `local_requirements.txt`, `pip freeze`
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github/netbox#872