Skip to content

Commit 5530556

Browse files
Merge pull request netbox-community#16429 from netbox-community/develop
Release v4.0.5
2 parents 3f345cd + 58f22ee commit 5530556

File tree

60 files changed

+33845
-29441
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+33845
-29441
lines changed

.github/workflows/auto-assign-issue.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
auto-assign:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: pozil/auto-assign-issue@v1
15+
- uses: pozil/auto-assign-issue@v2
1616
if: "contains(github.event.issue.labels.*.name, 'status: needs triage')"
1717
with:
1818
# Weighted assignments
19-
assignees: arthanson:3, jeffgdotorg:3, jeremystretch:3, abhi1693, DanSheps
19+
assignees: arthanson:3, jeffgdotorg:3, jeremystretch:3, DanSheps
2020
numOfAssignee: 1
2121
abortIfPreviousAssignees: true

.github/workflows/ci.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
name: CI
2-
on: [push, pull_request]
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- 'contrib/**'
7+
- 'docs/**'
8+
pull_request:
9+
paths-ignore:
10+
- 'contrib/**'
11+
- 'docs/**'
12+
313
permissions:
414
contents: read
15+
516
jobs:
617
build:
718
runs-on: ubuntu-latest
@@ -34,20 +45,20 @@ jobs:
3445
uses: actions/checkout@v4
3546

3647
- name: Set up Python ${{ matrix.python-version }}
37-
uses: actions/setup-python@v4
48+
uses: actions/setup-python@v5
3849
with:
3950
python-version: ${{ matrix.python-version }}
4051

4152
- name: Use Node.js ${{ matrix.node-version }}
42-
uses: actions/setup-node@v3
53+
uses: actions/setup-node@v4
4354
with:
4455
node-version: ${{ matrix.node-version }}
4556

4657
- name: Install Yarn Package Manager
4758
run: npm install -g yarn
4859

4960
- name: Setup Node.js with Yarn Caching
50-
uses: actions/setup-node@v3
61+
uses: actions/setup-node@v4
5162
with:
5263
node-version: ${{ matrix.node-version }}
5364
cache: yarn

.github/workflows/close-stale-issues.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
necessary.
3030
days-before-issue-stale: 90
3131
days-before-issue-close: 30
32-
exempt-issue-labels: 'status: accepted,status: blocked,status: needs milestone'
32+
exempt-issue-labels: 'status: accepted,status: backlog,status: blocked'
3333
stale-issue-label: 'pending closure'
3434
stale-issue-message: >
3535
This issue has been automatically marked as stale because it has not had
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Update translation strings
2+
3+
on:
4+
schedule:
5+
- cron: '0 5 * * *'
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
LOCALE: "en"
13+
14+
jobs:
15+
makemessages:
16+
runs-on: ubuntu-latest
17+
env:
18+
NETBOX_CONFIGURATION: netbox.configuration_testing
19+
20+
steps:
21+
- name: Check out repo
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v5
26+
with:
27+
python-version: 3.11
28+
29+
- name: Install system dependencies
30+
run: sudo apt install -y gettext
31+
32+
- name: Install Python dependencies
33+
run: |
34+
python -m pip install --upgrade pip
35+
pip install -r requirements.txt
36+
37+
- name: Run makemessages
38+
run: python netbox/manage.py makemessages -l ${{ env.LOCALE }}
39+
40+
- name: Commit changes
41+
uses: EndBug/add-and-commit@v9
42+
with:
43+
add: 'netbox/translations/'
44+
default_author: github_actions
45+
message: 'Update source translation strings'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ local_settings.py
2121
!upgrade.sh
2222
fabfile.py
2323
gunicorn.py
24+
uwsgi.ini
2425
netbox.log
2526
netbox.pid
2627
.DS_Store

docs/customization/custom-scripts.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,6 @@ class AnotherCustomScript(Script):
6565
script_order = (MyCustomScript, AnotherCustomScript)
6666
```
6767

68-
## Module Attributes
69-
70-
### `name`
71-
72-
You can define `name` within a script module (the Python file which contains one or more scripts) to set the module name. If `name` is not defined, the module's file name will be used.
73-
7468
## Script Attributes
7569

7670
Script attributes are defined under a class named `Meta` within the script. These are optional, but encouraged.

docs/development/release-checklist.md

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -86,15 +86,7 @@ This will automatically update the schema file at `contrib/generated_schema.json
8686

8787
### Update & Compile Translations
8888

89-
Log into [Transifex](https://app.transifex.com/netbox-community/netbox/dashboard/) to download the updated string maps. Download the resource (portable object, or `.po`) file for each language and save them to `netbox/translations/$lang/LC_MESSAGES/django.po`, overwriting the current files. (Be sure to click the **Download for use** link.)
90-
91-
![Transifex download](../media/development/transifex_download.png)
92-
93-
Once the resource files for all languages have been updated, compile the machine object (`.mo`) files using the `compilemessages` management command:
94-
95-
```nohighlight
96-
./manage.py compilemessages
97-
```
89+
Updated language translations should be pulled from [Transifex](https://app.transifex.com/netbox-community/netbox/dashboard/) and re-compiled for each new release. Follow the documented process for [updating translated strings](./translations.md#updating-translated-strings) to do this.
9890

9991
### Update Version and Changelog
10092

docs/development/translations.md

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,38 @@ All language translations in NetBox are generated from the source file found at
66

77
Reviewers log into Transifex and navigate to their designated language(s) to translate strings. The initial translation for most strings will be machine-generated via the AWS Translate service. Human reviewers are responsible for reviewing these translations and making corrections where necessary.
88

9-
Immediately prior to each NetBox release, the translation maps for all completed languages will be downloaded from Transifex, compiled, and checked into the NetBox code base by a maintainer.
10-
119
## Updating Translation Sources
1210

13-
To update the English `.po` file from which all translations are derived, use the `makemessages` management command:
11+
To update the English `.po` file from which all translations are derived, use the `makemessages` management command (ignoring the `project-static/` directory):
12+
13+
```nohighlight
14+
./manage.py makemessages -l en -i "project-static/*"
15+
```
16+
17+
Then, commit the change and push to the `develop` branch on GitHub. Any new strings will appear for translation on Transifex automatically.
18+
19+
## Updating Translated Strings
20+
21+
Typically, translated strings need to be updated only as part of the NetBox [release process](./release-checklist.md).
22+
23+
To update translated strings, start by initiating a sync from Transifex. From the Transifex dashboard, navigate to Settings > Integrations > GitHub > Manage, and click the **Manual Sync** button at top right.
24+
25+
![Transifex manual sync](../media/development/transifex_sync.png)
26+
27+
Enter a threshold percentage of 1 (to ensure all translations are captured) and select the `develop` branch, then click **Sync**. This will initiate a pull request to GitHub to update any newly modified translation (`.po`) files.
28+
29+
!!! tip
30+
The new PR should appear within a few minutes. If it does not, check that there are in fact new translations to be added.
31+
32+
![Transifex pull request](../media/development/transifex_pull_request.png)
33+
34+
Once the PR has been merged, the updated strings need to be compiled into new `.mo` files so they can be used by the application. Update the `develop` branch locally to pull in the changes from the Transifex PR, then run Django's [`compilemessages`](https://docs.djangoproject.com/en/stable/ref/django-admin/#django-admin-compilemessages) management command:
1435

1536
```nohighlight
16-
./manage.py makemessages -l en
37+
./manage.py compilemessages
1738
```
1839

19-
Then, commit the change and push to the `develop` branch on GitHub. After some time, any new strings will appear for translation on Transifex automatically.
40+
Once any new `.mo` files have been generated, they need to be committed and pushed back up to GitHub. (Again, this is typically done as part of publishing a new NetBox release.)
2041

2142
## Proposing New Languages
2243

-54.3 KB
Binary file not shown.
108 KB
Loading

0 commit comments

Comments
 (0)