File: i18n.rst

package info (click to toggle)
groonga 15.0.4%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 163,080 kB
  • sloc: ansic: 770,564; cpp: 48,925; ruby: 40,447; javascript: 10,250; yacc: 7,045; sh: 5,602; python: 2,821; makefile: 1,672
file content (218 lines) | stat: -rw-r--r-- 6,091 bytes parent folder | download
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
.. -*- rst -*-

I18N
====

We only had documentation in Japanese.  We start to support
I18N documentation by gettext based `Sphinx I18N feature`_.
We'll use English as base language and translate
English into other languages such as Japanese. We'll put
all documentations into doc/source/ and process them by
Sphinx.

.. _Sphinx I18N feature: https://www.sphinx-doc.org/en/master/usage/advanced/intl.html

But we still use Japanese in doc/source/ for now. We need to
translate Japanese documentation in doc/source/ into
English. We welcome to you help us by translating
documentation.

Translation flow
----------------

After doc/source/\*.txt are updated, we can start translation.

Here is a translation flow:

1. Install Sphinx, if it is not installed.
2. Clone Groonga repository.
3. Update ``.edit`` files
4. Edit ``.edit`` files
5. Update ``.po`` files.
6. Generate HTML files.
7. Confirm HTML output.
8. Repeat 3.-7. until you finish to translate.
9. Send your works to us!

Here are command lines to do the above flow. Following
sections describes details.

::

  # Please fork https://github.com/groonga/groonga on GitHub
  % git clone https://github.com/${YOUR_GITHUB_ACCOUNT}/groonga.git
  % ./autogen.sh
  % ./configure --enable-document
  % cd doc/locale/${LANGUAGE}/LC_MESSAGES # ${LANGUAGE} is language code such as 'ja'.
  % make # *.edit are updated
  % editor *.edit # translate *.edit # you can use your favorite editor
  % make # *.po are updated
  % cd ..
  % make html
  % browser html/index.html # confirm translation
  % git add LC_MESSAGES/*.po
  % git commit
  % git push

How to install Sphinx
---------------------

See the :doc:`introduction`.

How to clone Groonga repository
-------------------------------

First, please fork Groonga repository on GitHub. You
just access https://github.com/groonga/groonga and press
`Fork` button. Now you can clone your Groonga repository::

  % git clone https://github.com/${YOUR_GITHUB_ACCOUNT}/groonga.git

Then you need to configure your cloned repository::

  % cd groonga
  % ./autogen.sh
  % ./configure --enable-document

The above steps are just needed at the first setup.

If you have troubles on the above steps, you can use source
files available on https://packages.groonga.org/source/groonga/ .

How to update ``.edit`` files
-----------------------------

You can update ``.edit`` files by running ``make`` on
``doc/locale/${LANGUAGE}/LC_MESSAGES``. (Please replace
`${LANGUAGE}` with your language code such as 'ja'.)::

  % cd doc/locale/ja/LC_MESSAGES
  % make

How to edit ``.edit``
---------------------

Both of ``.edit`` files and ``.po`` files are `PO files <https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html>`_. 
``.edit`` files are for editing and ``.po`` files are for versioning.

In order to edit ``.edit`` files, there are some tools to edit.
``.edit`` files are just text, so you can use your favorite editor.

Here is a list of editors specialized for editing ``.po`` files.
You can use these editors to edit ``.edit`` files because they are actually 
``.po`` files.

Emacs's po-mode_
  It is bundled in gettext.

Poedit_
  It is a ``.po`` editor and works on many platform.

gted
  It is also a ``.po`` editor and is implemented as Eclipse plugin.

.. _po-mode: http://www.gnu.org/s/hello/manual/gettext/PO-Mode.html
.. _Poedit: http://www.poedit.net/
.. _gted: http://www.gted.org/

How to update ``.po`` files
---------------------------

After editing ``.edit`` files, you can update ``.po`` files by running ``make`` on
``doc/locale/${LANGUAGE}/LC_MESSAGES``. (Please replace
`${LANGUAGE}` with your language code such as 'ja'.)

.. code-block ::

   % cd doc/locale/ja/LC_MESSAGES
   % make

How to generate HTML files
--------------------------

You can generate HTML files with updated ``.po`` files by
running `make html` on doc/locale/${LANGUAGE}. (Please
substitute `${LANGUAGE}` with your language code such as
'ja'.)::

  % cd doc/locale/ja/
  % make html

You can also generate HTML files for all languages by
running `make html` on doc/locale::

  % cd doc/locale
  % make html

.. note::

   .mo files are updated automatically by `make html`. So
   you don't care about .mo files.

How to confirm HTML output
--------------------------

HTML files are generated in
doc/locale/${LANGUAGE}/html/. (Please substitute
`${LANGUAGE}` with your language code such as 'ja'.) You can
confirm HTML output by your favorite browser::

  % firefox doc/locale/ja/html/index.html

How to send your works
----------------------

We can receive your works via pull request on GitHub or
E-mail attachment patch or ``.po`` files themselves.

How to send pull request
++++++++++++++++++++++++

Here are command lines to send pull request::

  % git add doc/locale/ja/LC_MESSAGES/*.po
  % git commit
  % git push

Now you can send pull request on GitHub. You just access
your repository page on GitHub and press `Pull Request`
button.

.. seealso:: `Help.GitHub - Sending pull requests <http://help.github.com/pull-requests/>`_.

How to send patch
+++++++++++++++++

Here are command lines to create patch::

  % git add doc/locale/ja/LC_MESSAGES/*.po
  % git commit
  % git format-patch origin/main

You can find 000X-YYY.patch files in the current
directory. Please send those files to us!

.. seealso:: :doc:`/community` describes our contact information.

How to send ``.po`` files
+++++++++++++++++++++++++

Please archive doc/locale/${LANGUAGE}/LC_MESSAGES/ (Please
substitute `${LANGUAGE}` with your language code such as
'ja'.) and send it to us! We extract and merge them to the
Groonga repository.

.. seealso:: :doc:`/community` describes our contact information.

How to add new language
-----------------------

Here are command lines to add new translation language::

  % cd doc/locale
  % make add LOCALE=${LANGUAGE} # specify your language code such as 'de'.

Please substitute `${LANGUAGE}` with your language code such
as 'ja'.

.. seealso:: `Codes for the Representation of Names of Languages <http://www.loc.gov/standards/iso639-2/php/English_list.php>`_.