SEL-Columbia / formhub

Mobile Data Collection made easy.
http://formhub.org
BSD 2-Clause "Simplified" License
259 stars 163 forks source link

Formhub

.. image:: https://api.travis-ci.org/SEL-Columbia/formhub.png?branch=master :target: https://travis-ci.org/SEL-Columbia/formhub

Getting Started

Contributing

If you would like to contribute code please read Contributing Code to Formhub <https://github.com/SEL-Columbia/formhub/wiki/Contributing-Code-to-Formhub>_.

Code Structure

Formhub is written in Python <https://www.python.org/>, using the Django Web Framework <https://www.djangoproject.com/>.

In Django terms, an "app" is a bundle of Django code, including models and views, that lives together in a single Python package and represents a full Django application.

Formhub consists of three Django apps:

Internationalization and Localization

Formhub can be presented in specific languages and formats, customized for specific audiences.

These examples were derived from Django's Internationalization and Localization Documentation <https://docs.djangoproject.com/en/dev/topics/i18n/> and there is also a good explanation in The Django Book's Chapter on Internationalization <http://www.djangobook.com/en/2.0/chapter19.html>.

To generate a locale from scratch, e.g. Spanish:

.. code-block:: sh

$ django-admin.py makemessages -l es -e py,html,email,txt ;
$ for app in {main,odk_viewer} ; do cd ${app} && django-admin.py makemessages -d djangojs -l es && cd - ; done

To update PO files

.. code-block:: sh

$ django-admin.py makemessages -a ;
$ for app in {main,odk_viewer} ; do cd ${app} && django-admin.py makemessages -d djangojs -a && cd - ; done

To compile MO files and update live translations

.. code-block:: sh

$ django-admin.py compilemessages ;
$ for app in {main,odk_viewer} ; do cd ${app} && django-admin.py compilemessages && cd - ; done