Make translation compilation a separate step

- Must be run after a translation file is updated
This commit is contained in:
Oliver Walters 2019-09-26 10:21:14 +10:00
parent fcb47fce09
commit b56a1ade24
3 changed files with 12 additions and 5 deletions

View File

@ -15,8 +15,6 @@ migrate:
cd InvenTree && python3 manage.py migrate cd InvenTree && python3 manage.py migrate
cd InvenTree && python3 manage.py migrate --run-syncdb cd InvenTree && python3 manage.py migrate --run-syncdb
cd InvenTree && python3 manage.py check cd InvenTree && python3 manage.py check
cd InvenTree && python3 manage.py makemessages
cd InvenTree && python3 manage.py compilemessages
# Collect static files into the correct locations # Collect static files into the correct locations
static: static:
@ -41,6 +39,11 @@ postgresql:
apt-get install postgresql postgresql-contrib libpq-dev apt-get install postgresql postgresql-contrib libpq-dev
pip3 install psycopg2 pip3 install psycopg2
# Update translation files
translate:
cd InvenTree && python3 manage.py makemessages
cd InvenTree && python3 manage.py compilemessages
# Run PEP style checks against source code # Run PEP style checks against source code
style: style:
flake8 InvenTree flake8 InvenTree
@ -69,4 +72,4 @@ backup:
cd InvenTree && python3 manage.py dbbackup cd InvenTree && python3 manage.py dbbackup
cd InvenTree && python3 manage.py mediabackup cd InvenTree && python3 manage.py mediabackup
.PHONY: clean migrate superuser install mysql postgresql static style test coverage docreqs docs backup update .PHONY: clean migrate superuser install mysql postgresql translate static style test coverage docreqs docs backup update

View File

@ -19,7 +19,8 @@ To install InvenTree you will need the following system components installed:
* python3 * python3
* python3-pip (pip3) * python3-pip (pip3)
* make * make
* gettext
Each of these programs need to be installed (e.g. using apt or similar) before running the ``make install`` script.
Installation Installation
------------ ------------
@ -89,6 +90,7 @@ Other shorthand functions are provided for the development and testing process:
* ``make migrate`` - Perform database migrations * ``make migrate`` - Perform database migrations
* ``make mysql`` - Install packages required for MySQL database backend * ``make mysql`` - Install packages required for MySQL database backend
* ``make postgresql`` - Install packages required for PostgreSQL database backend * ``make postgresql`` - Install packages required for PostgreSQL database backend
* ``make translate`` - Compile language translation files (requires gettext system package)
* ``make backup`` - Backup database tables and media files * ``make backup`` - Backup database tables and media files
* ``make test`` - Run all unit tests * ``make test`` - Run all unit tests
* ``make coverage`` - Run all unit tests and generate code coverage report * ``make coverage`` - Run all unit tests and generate code coverage report

View File

@ -11,4 +11,6 @@ InvenTree supports multi-language translation using the `Django Translation Fram
Translation strings are located in the `InvenTree/locales/` directory, and translation files can be easily added here. Translation strings are located in the `InvenTree/locales/` directory, and translation files can be easily added here.
To set the default language, change the `langauge` setting in the `config.yaml` settings file. To set the default language, change the `langauge` setting in the `config.yaml` settings file.
To recompile the translation files (after adding new translation strings), run the command ``make translate`` from the root directory.