LibreOsteo is using AngularJS + Django. You can contribute to it via pull requests
_ .
Please target the develop
branch with your pull requests
(master
points to the latest release).
LibreOsteo code and strings are written in English Language. Internationalization is used to provide a full translation in French. If you need it in another language, please contribute your translations :-).
We are using standard Django gettext-based stuff. In a nutshell:
- Wrap your string with gettext markers:
_('my string')
in .py files{% trans 'my string' %}
in .html files
- Collect new marked strings for translations into django.po:
./manage.py makemessages --no-location
- Translate new strings by editing django.po
- Compile them to
.mo files
. with:
./manage.py compilemessages
Please do commit your updated .mo
.
angular-i18n is not used. Instead, we use Django JS-dedicated mechanisms. So:
- Wrap your strings with gettext markers:
gettext('my string')
in .js files- problem is not solved yet for .html (feel free to suggest a solution)
- Collect new marked strings for translations into djangojs.po:
./manage.py makemessages --no-location -d djangojs
- Translate new strings by editing djangojs.po
- Compile them to
.mo files
. with:
./manage.py compilemessages
Please do commit your updated .mo
.
Testing is a full subject. There is lot of lack into the project to covert all the code. But some actions are in progress to raise the coverage. When developing a new functionality, the requirement is to add some tests (unit tests is mandatory), but also Functional Tests to demonstrate the functionality. Even if first functionalities were not developed with a lack of tests, nothing is to late to change it !
- Write the unit test for REST Api see Django Rest Framework Testing
- Write the functional test to ensure that the UI behaviors is the right expected see Robotframework
You have to run tests before developing any functionality. To run theses tests:
./manage.py test
- Ensure you have all requirements :
pip install -r requirements/requ-testing.txt
-
Ensure you have Firefox with French support language. You can download it with an url like https://download.mozilla.org/?product=firefox-latest&lang=fr&os=linux64
-
Download and install geckodriver into your PATH:
wget https://github.com/mozilla/geckodriver/releases/download/v0.21.0/geckodriver-v0.21.0-linux64.tar.gz -O /tmp/geckodriver.tar.gz
tar -xvf /tmp/geckodriver.tar.gz
export PATH=$PATH:$PWD
- Be sure that your static are up to date:
./manage.py collectstatic --no-input
- Launch the server instance:
python ./server.py
- Execute tests suite:
robot tests