-
Notifications
You must be signed in to change notification settings - Fork 15
/
HOWTO.txt
43 lines (26 loc) · 1.17 KB
/
HOWTO.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
Steps to generate locale files
------------------------------
First, re-generate the pot file:
pybabel -v extract -F locale/babel.config -o locale/core.pot src/web
Then, for every language, do (in the example, I'm doing it for 'es'):
0. First time for the language, go to step 1; else go to step 2
1. Just copy the .pot file, make a dir you'll need, and then go to step 3
cd locale
cp core.pot es.po
mkdir es/LC_MESSAGES/
2. Merge new strings with previous file
cd locale
msgmerge es.po core.pot > /tmp/temp_po
mv /tmp/temp_po es.po
3. Get your favourite text editor and fill translations
vim es.po
4. Compile the just filled .po to the correct lang place; again, as an
example for 'es':
msgfmt es.po --output-file=es/LC_MESSAGES/core.mo
Alternative method
------------------
Use the `utilities/localize.py` script that uses the Babel python package.
E.g. for adding/updating translations for spanish language:
0. Run `python localize.py es` to add/update messages
1. Fill missing translations in `es.po` file
2. Run `python localize.py es` again (if `es.po` changed)