You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
-
74
68
## Script Attributes
75
69
76
70
Script attributes are defined under a class named `Meta` within the script. These are optional, but encouraged.
Copy file name to clipboardExpand all lines: docs/development/release-checklist.md
+1-9Lines changed: 1 addition & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,15 +86,7 @@ This will automatically update the schema file at `contrib/generated_schema.json
86
86
87
87
### Update & Compile Translations
88
88
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.)
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.
Copy file name to clipboardExpand all lines: docs/development/translations.md
+26-5Lines changed: 26 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,17 +6,38 @@ All language translations in NetBox are generated from the source file found at
6
6
7
7
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.
8
8
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
-
11
9
## Updating Translation Sources
12
10
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.
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.
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:
14
35
15
36
```nohighlight
16
-
./manage.py makemessages -l en
37
+
./manage.py compilemessages
17
38
```
18
39
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.)
0 commit comments