Translations
NetBox coordinates all translation work using the Transifex platform. Signing up for a Transifex account is free.
All language translations in NetBox are generated from the source file found at netbox/translations/en/LC_MESSAGES/django.po
. This file contains the original English strings with empty mappings, and is generated as part of NetBox's release process. Transifex updates source strings from this file on a recurring basis, so new translation strings will appear in the platform automatically as it is updated in the code base.
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.
Updating Translation Sources
To update the English .po
file from which all translations are derived, use the makemessages
management command (ignoring the project-static/
directory):
./manage.py makemessages -l en -i "project-static/*"
Then, commit the change and push to the develop
branch on GitHub. Any new strings will appear for translation on Transifex automatically.
Note
It is typically not necessary to update source strings manually, as this is done nightly by a GitHub action.
Updating Translated Strings
Typically, translated strings need to be updated only as part of the NetBox release process.
Check the Transifex dashboard for languages that are not marked ready for use, being sure to click Show all languages if it appears at the bottom of the list. Use machine translation to round out any not-ready languages. It's not necessary to review the machine translation immediately as the translation teams will handle that aspect; the goal at this stage is to get translations included in the Transifex pull request.
To download translated strings automatically, you'll need to:
- Install the Transifex CLI client
- Generate a Transifex API token
Once you have the client set up, run the following command:
TX_TOKEN=$TOKEN tx pull
This will download all portable (.po
) translation files from Transifex, updating them locally as needed.
Once retrieved, the updated strings need to be compiled into new .mo
files so they can be used by the application. Run Django's compilemessages
management command to compile them:
./manage.py compilemessages
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.)
Proposing New Languages
If you'd like to add support for a new language to NetBox, the first step is to submit a GitHub issue to capture the proposal. While we'd like to add as many languages as possible, we do need to limit the rate at which new languages are added. New languages will be selected according to community interest and the number of volunteers who sign up as translators.
Once a proposed language has been approved, a NetBox maintainer will:
- Add it to the Transifex platform
- Designate one or more reviewers
- Create the initial machine-generated translations for review
- Add it to the list of supported languages