forked from GeoNode/geonode
/
localization.txt
52 lines (34 loc) · 1.34 KB
/
localization.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
.. _localization:
============
Localization
============
To enable a new language in GeoNode you have to do the following:
#. Install gettext::
sudo apt-get install gettext
#. Create a directory named locale in the root of your project::
mkdir locale
#. In the root of your project, run::
python manage.py makemessages -l fr
#. 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:
#. Install django-rossetta::
http://code.google.com/p/django-rosetta/
#. Install django-modeltranslation
#. 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)