forked from djbook-ru/django_documentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TRANSLATION_README
92 lines (60 loc) · 2.32 KB
/
TRANSLATION_README
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
============
Installation
============
To install all required packages run:
$ pip install -r djbook/deps.txt
============
How to start
============
You can find .po files in `locale/ru/LC_MESSAGES` folder.
To build documentation HTML run:
$ ./translator.py create
Generated HTML you can find in `_build/html`.
So find .po you wish to translate, add changes and run `./translator.py create`.
=============
translator.py
=============
----------
Base usage
----------
To list all command run:
$ ./translator.py --help
To get info about some command run:
$ ./translator.py help [command_name]
--------------
Output control
--------------
Use ``--debug`` option to see debug info and error traceback.
Use ``-v`` for verbose output.
Use ``-q`` for quiet execute.
---------------
Add new command
---------------
We use https://github.com/dhellmann/cliff with a little bit fixed command loader.
You can find command in ``djbook.commands`` package.
There are three level of output:
self.app.stdout.write('hi!\n') # default output
self.log.info('sending greeting') # verbose output
self.log.debug('debugging') # debug output
====================================================
Update documentation from Django source code
====================================================
Visit https://github.com/django/django, find required tag. Run:
$ ./translator.py update <tag>
Then update .po files:
$ ./translator.py makemessages
=====
Notes
=====
In `djbook/_theme/djbook/layout.html` are hardcoded link to comments scripts from server.
Do not forget have them up to date.
=====
Hints
=====
В оригинале часто используют ссылки следующего вида:
`define and send your own custom signals`_
Sphinx при переводе сначала подставляет перевод, потом рендерит html, по этому
просто перевести текст нельзя т.к. метки с таким названием не будет. Для этого
используем http://sphinx-doc.org/markup/inline.html#ref-role найдя в исходниках
страницы название метки. Например:
:ref:`определять и посылать свои собственные сигналы <defining-and-sending-signals>`