[PR #20810] [MERGED] Fixes #20766: Prevent translation of code/commands in error templates #16059

Closed
opened 2025-12-30 00:25:34 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/20810
Author: @jnovinger
Created: 11/14/2025
Status: Merged
Merged: 11/20/2025
Merged by: @bctiemann

Base: mainHead: 20766-fix-german-translation-code-literals


📝 Commits (1)

  • 9e13d89 Fixes #20766: Prevent translation of code/commands in error templates

📊 Changes

3 files changed (+9 additions, -9 deletions)

View changed files

📝 netbox/templates/exceptions/import_error.html (+3 -3)
📝 netbox/templates/exceptions/programming_error.html (+4 -4)
📝 netbox/templates/media_failure.html (+2 -2)

📄 Description

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

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/netbox-community/netbox/pull/20810 **Author:** [@jnovinger](https://github.com/jnovinger) **Created:** 11/14/2025 **Status:** ✅ Merged **Merged:** 11/20/2025 **Merged by:** [@bctiemann](https://github.com/bctiemann) **Base:** `main` ← **Head:** `20766-fix-german-translation-code-literals` --- ### 📝 Commits (1) - [`9e13d89`](https://github.com/netbox-community/netbox/commit/9e13d89baaf7c137f0fc94f155e801a4642e5e0d) Fixes #20766: Prevent translation of code/commands in error templates ### 📊 Changes **3 files changed** (+9 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `netbox/templates/exceptions/import_error.html` (+3 -3) 📝 `netbox/templates/exceptions/programming_error.html` (+4 -4) 📝 `netbox/templates/media_failure.html` (+2 -2) </details> ### 📄 Description ### 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` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 00:25:34 +01:00
adam closed this issue 2025-12-30 00:25:34 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#16059