[PR #10832] [MERGED] 10300 initial translation support use gettext #13703

Closed
opened 2025-12-29 23:20:21 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/netbox-community/netbox/pull/10832
Author: @arthanson
Created: 11/3/2022
Status: Merged
Merged: 11/11/2022
Merged by: @jeremystretch

Base: featureHead: 10300-initial-transalation-support


📝 Commits (1)

  • 21863c9 10300 initial translation support use gettext

📊 Changes

67 files changed (+1192 additions, -1134 deletions)

View changed files

📝 netbox/circuits/filtersets.py (+26 -25)
📝 netbox/circuits/forms/bulk_edit.py (+6 -6)
📝 netbox/circuits/forms/bulk_import.py (+7 -6)
📝 netbox/circuits/forms/model_forms.py (+6 -6)
📝 netbox/circuits/models/circuits.py (+2 -1)
📝 netbox/dcim/api/serializers.py (+4 -3)
📝 netbox/dcim/filtersets.py (+166 -165)
📝 netbox/dcim/forms/bulk_create.py (+3 -2)
📝 netbox/dcim/forms/bulk_edit.py (+24 -24)
📝 netbox/dcim/forms/bulk_import.py (+89 -88)
📝 netbox/dcim/forms/common.py (+3 -2)
📝 netbox/dcim/forms/connections.py (+12 -11)
📝 netbox/dcim/forms/model_forms.py (+39 -39)
📝 netbox/dcim/forms/object_create.py (+11 -10)
📝 netbox/dcim/forms/object_import.py (+3 -2)
📝 netbox/dcim/models/device_component_templates.py (+7 -6)
📝 netbox/dcim/models/device_components.py (+18 -17)
📝 netbox/dcim/models/devices.py (+13 -12)
📝 netbox/dcim/models/power.py (+2 -1)
📝 netbox/dcim/models/racks.py (+11 -10)

...and 47 more files

📄 Description

Fixes: #10300

Adds gettext for initial translation support. This PR is not meant to be totally comprehensive, there are still several areas missing that will need to be added in subsequent PRs as detailed below. This just covers the low-hanging fruit and gives a good baseline from which to proceed and sets up the use of gettext as standard so when people copy-pasta or add new code there is a correct base to follow from.

Missing Items for Future (will open another issue):

  1. There are some strings encased in tripe-quotes or f-strings that aren't converted as they require more work and the f-strings especially need to be tested individually.
  2. ValidationError( strings have not been converted (quite a few are f-strings).
  3. Model verbose names and method decorators
  4. the model help_text strings are currently using gettext, they should be changed to gettext_lazy (simple header changes and it doesn't make a difference until translations are actually used)
  5. template tags and templates need the blocktranslate

🔄 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/10832 **Author:** [@arthanson](https://github.com/arthanson) **Created:** 11/3/2022 **Status:** ✅ Merged **Merged:** 11/11/2022 **Merged by:** [@jeremystretch](https://github.com/jeremystretch) **Base:** `feature` ← **Head:** `10300-initial-transalation-support` --- ### 📝 Commits (1) - [`21863c9`](https://github.com/netbox-community/netbox/commit/21863c92f700f7500ab7b33a6c52f39b12865ed9) 10300 initial translation support use gettext ### 📊 Changes **67 files changed** (+1192 additions, -1134 deletions) <details> <summary>View changed files</summary> 📝 `netbox/circuits/filtersets.py` (+26 -25) 📝 `netbox/circuits/forms/bulk_edit.py` (+6 -6) 📝 `netbox/circuits/forms/bulk_import.py` (+7 -6) 📝 `netbox/circuits/forms/model_forms.py` (+6 -6) 📝 `netbox/circuits/models/circuits.py` (+2 -1) 📝 `netbox/dcim/api/serializers.py` (+4 -3) 📝 `netbox/dcim/filtersets.py` (+166 -165) 📝 `netbox/dcim/forms/bulk_create.py` (+3 -2) 📝 `netbox/dcim/forms/bulk_edit.py` (+24 -24) 📝 `netbox/dcim/forms/bulk_import.py` (+89 -88) 📝 `netbox/dcim/forms/common.py` (+3 -2) 📝 `netbox/dcim/forms/connections.py` (+12 -11) 📝 `netbox/dcim/forms/model_forms.py` (+39 -39) 📝 `netbox/dcim/forms/object_create.py` (+11 -10) 📝 `netbox/dcim/forms/object_import.py` (+3 -2) 📝 `netbox/dcim/models/device_component_templates.py` (+7 -6) 📝 `netbox/dcim/models/device_components.py` (+18 -17) 📝 `netbox/dcim/models/devices.py` (+13 -12) 📝 `netbox/dcim/models/power.py` (+2 -1) 📝 `netbox/dcim/models/racks.py` (+11 -10) _...and 47 more files_ </details> ### 📄 Description <!-- Thank you for your interest in contributing to NetBox! Please note that our contribution policy requires that a feature request or bug report be approved and assigned prior to opening a pull request. This helps avoid waste time and effort on a proposed change that we might not be able to accept. IF YOUR PULL REQUEST DOES NOT REFERENCE AN ISSUE WHICH HAS BEEN ASSIGNED TO YOU, IT WILL BE CLOSED AUTOMATICALLY. Please specify your assigned issue number on the line below. --> ### Fixes: #10300 <!-- Please include a summary of the proposed changes below. --> Adds gettext for initial translation support. This PR is not meant to be totally comprehensive, there are still several areas missing that will need to be added in subsequent PRs as detailed below. This just covers the low-hanging fruit and gives a good baseline from which to proceed and sets up the use of gettext as standard so when people copy-pasta or add new code there is a correct base to follow from. Missing Items for Future (will open another issue): 1. There are some strings encased in tripe-quotes or f-strings that aren't converted as they require more work and the f-strings especially need to be tested individually. 2. ValidationError( strings have not been converted (quite a few are f-strings). 3. Model verbose names and method decorators 4. the model help_text strings are currently using gettext, they should be changed to gettext_lazy (simple header changes and it doesn't make a difference until translations are actually used) 5. template tags and templates need the blocktranslate --- <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-29 23:20:21 +01:00
adam closed this issue 2025-12-29 23:20:21 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/netbox#13703