Skip to content
ingenieroariel edited this page Jun 3, 2011 · 5 revisions

To enable a new language in GeoNode you have to do the following:

  1. Install gettext:

    sudo apt-get install gettext
    
  2. Create a directory named locale in the root of your project:

    mkdir locale
    
  3. In the root of your project, run:

    python manage.py makemessages -l fr
    
  4. Navigate to the GeoNode dir and do:

    cd src/GeoNodePy/geonode/maps; django-admin.py makemessages -l fr
    cd src/GeoNodePy/geonode; django-admin.py makemessages -l fr
    

Optional steps:

  1. Install django-rossetta:

    http://code.google.com/p/django-rosetta/
    
  2. Install django-modeltranslation

  3. If you want to enable metadata in the other format too, make sure you have model translation installed and create a translations.py file like this:

    from modeltranslation.translator import translator, TranslationOptions
    from geonode.maps.models import Layer
    
    class LayerTO(TranslationOptions):
        fields = (
                 'title',
                 'edition',
                 'abstract',
                 'purpose',
                 'constraints_other',
                 'distribution_description',
                 'data_quality_statement',
                 'supplemental_information',
                 )
    
    translator.register(FlatBlock, FlatBlockTO)
    translator.register(Layer, LayerTO)
    
Clone this wiki locally