forked from GeoNode/geonode
-
Notifications
You must be signed in to change notification settings - Fork 0
/
contribute_to_translation.txt
123 lines (67 loc) · 4.68 KB
/
contribute_to_translation.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
.. _contrib_trans:
==========================================
How to contribute to GeoNode's Translation
==========================================
GeoNode uses `Transifex <https://www.transifex.com/projects/p/geonode/>`_ to translate the webpage and code from english to any other language. To be able to contribute to the translation, you need to get an account on transifex.
Edit translations directly on Transifex webpage
===============================================
Here you will see how easy it is to update the translations directly on the transifex website.
#. Create account
Go to `<https://www.transifex.com>`_ and, click *Try it for free* and enter the needed information to create your free account.
.. figure:: img/transifex_homepage.PNG
#. Join our project
After activating the link you've got you will be asked whether you want to start a new project or to join an existing project.
.. figure:: img/transifex_join_project.PNG
Click *join an existing project* and type *geonode* into the search bar. You will be directed to the geonode project site on transifex. To join the team, click on the language you want to add a translation in. Then a button *Join the team* will appaer. Hit it, and you will submit for permission to join.
#. Wait for permission to update translations from translation leader (email)
#. Start to Add a translation
Click on the language where you want to add a translation. You'll see some bars, e.g. *javascript* and *master*. Choose the one you want to add a translation and you will see a dialog window like this
.. figure:: img/download_translation.PNG
Now you have two options to start translating. Either you use the transifex interface (*option 1*) or you download the file to translate locally (*option 2*).
**Option 1**
To start translating using the Transifex interface, hit *Translate now*. You'll see an interface like this
.. figure:: img/transifex_interface.PNG
Click *untranslated* and add your translation like shown below
.. figure:: img/transifex_add_translation.PNG
When you stop translating, do not forget to hit the green *save* button at the top right!
**Option 2**
To translate in your favourite editor, download the file hitting *Download file for translation*. This will download a .po file, which includes the strings to be translated (*msgid*). Put your translation into the *msgstr* and when you're done, save the file and upload it to transifex (using the same dialog window as for the download).
Translate on local machine from github
======================================
Using this options it is assumed that you have a local Geonode GitHub repository forked.
.. note:: It is recommended to first create a new branch e.g. *translation* in your repository for your translations.
#. As a firt step, generate all of the needed .pot files (any time the master documentation changes)::
$ cd docs
$ sphinx-build -b gettext . i18n/pot
#. Run the pre_translate.sh script to generate/merge (update) all of the .po files for each language::
$ sh i18n/scripts/pre_translate.sh
#. Do a pull from transifex to get latest translations::
$ tx pull -a
#. Now edit the .po files you need, make the translations and then run the post_translate.sh script::
$ vi i18n/it/LC_MESSAGES/index.po
$ sh i18n/scripts/post_translate.sh
#. Now you have to push the changed .po files and the appropriate .pot file (can be found in geonode/docs/i18n/pot) to your remote repository using::
$ git commit
$ git push
#. Now make a pull request and GeoNode will push your changes to transifex.
Only for transifex maintainers
------------------------------
.. note:: This section is only for the maintainers of a transifex group!
#. As a firt step, generate all of the needed .pot files (any time from master documentation changes)::
$ cd docs
$ sphinx-build -b gettext . i18n/pot
#. Run the pre_translate.sh script to generate/merge (update) all of the .po files for each language::
$ sh i18n/scripts/pre_translate.sh
#. Do a pull from transifex to get latest translations::
$ tx pull -a
#. Now edit the .po files you need (here using Italian /it), make the translations and then run the post_translate.sh script::
$ vi i18n/it/LC_MESSAGES/index.po
$ sh i18n/scripts/post_translate.sh
#. Do a push to transifex to update translations on the server::
$ tx push -s -t
#. Finally build your html or pdf, and you should get the localized versions as well::
$ make html LANG=it
How to add a new language
=========================
To add a new language, click on *Request language* on the right top of the transifex webpage.
.. figure:: img/transifex_request_language.PNG