This repository contains code shared by standard-specific instances of the CoVE web app. Eg:
Currently it does not stand alone as a CoVE django app.
We recommend dealer. To use it:
dealer
to your requirements filesettings.py
file:
DEALER_TYPE = 'git'
'dealer.contrib.django.Middleware',
to the MIDDLEWARE
listIn your Django app:
Create a templates/APP
directory, replacing APP
with the name of your Django app
Create a base.html
file in the new directory, with at minimum:
{% extends 'base.html' %}
{% load i18n %}
Add to the base.html
file, for example, replacing OpenDataServices/cove
with the path to your GitHub repository:
{% block version_link %}
<p class="text-muted">{% blocktrans %}Running version {% endblocktrans %}<a href="https://github.com/OpenDataServices/cove/tree/{{ request.tag }}">{{ request.tag }}</a></p>
{% endblock %}
We use Django's translation framework to provide this application in different languages. We have used Google Translate to perform initial translations from English, but expect those translations to be worked on by humans over time.
Translators can provide translations for this application by becomming a collaborator on Transifex https://www.transifex.com/OpenDataServices/cove
For more information about Django's translation framework, see https://docs.djangoproject.com/en/1.8/topics/i18n/translation/
In short:
If you add new text to the interface, ensure to wrap it in the relevant gettext blocks/functions.
In order to generate messages and post them on Transifex:
First check the Transifex lock <https://opendataservices.plan.io/projects/co-op/wiki/CoVE_Transifex_lock>
, because only one branch can be translated on Transifex at a time.
Then:
python manage.py makemessages -l en
tx push -s
In order to fetch messages from transifex:
tx pull -a
In order to compile them:
python manage.py compilemessages
Keep the makemessages and pull messages steps in thier own commits seperate from the text changes.
To check that all new text is written so that it is able to be translated you could install and run django-template-i18n-lint
pip install django-template-i18n-lint
django-template-i18n-lint cove
TODO