Mercurial > babel > old > mirror
comparison doc/setup.txt @ 183:e927dffc9ab4
The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
author | cmlenz |
---|---|
date | Thu, 28 Jun 2007 10:28:25 +0000 |
parents | 6138ea7ef7a8 |
children | b5e58a22ebd2 |
comparison
equal
deleted
inserted
replaced
181:5c85c0ec4ef8 | 183:e927dffc9ab4 |
---|---|
19 | 19 |
20 setup( | 20 setup( |
21 ... | 21 ... |
22 cmd_class = {'compile_catalog': babel.compile_catalog, | 22 cmd_class = {'compile_catalog': babel.compile_catalog, |
23 'extract_messages': babel.extract_messages, | 23 'extract_messages': babel.extract_messages, |
24 'new_catalog': babel.new_catalog} | 24 'init_catalog': babel.init_catalog} |
25 ) | 25 ) |
26 | 26 |
27 | 27 |
28 .. contents:: Contents | 28 .. contents:: Contents |
29 :depth: 2 | 29 :depth: 2 |
212 | 212 |
213 Any path names are interpreted relative to the location of the ``setup.py`` | 213 Any path names are interpreted relative to the location of the ``setup.py`` |
214 file. For boolean options, use "true" or "false" values. | 214 file. For boolean options, use "true" or "false" values. |
215 | 215 |
216 | 216 |
217 new_catalog | 217 init_catalog |
218 =========== | 218 ============ |
219 | 219 |
220 The ``new_catalog`` command is basically equivalent to the GNU ``msginit`` | 220 The ``init_catalog`` command is basically equivalent to the GNU ``msginit`` |
221 program: it creates a new translation catalog based on a PO template file (POT). | 221 program: it creates a new translation catalog based on a PO template file (POT). |
222 | 222 |
223 If the command has been correctly installed or registered, a project's | 223 If the command has been correctly installed or registered, a project's |
224 ``setup.py`` script should allow you to use the command:: | 224 ``setup.py`` script should allow you to use the command:: |
225 | 225 |
226 $ ./setup.py new_catalog --help | 226 $ ./setup.py init_catalog --help |
227 Global options: | 227 Global options: |
228 --verbose (-v) run verbosely (default) | 228 --verbose (-v) run verbosely (default) |
229 --quiet (-q) run quietly (turns verbosity off) | 229 --quiet (-q) run quietly (turns verbosity off) |
230 --dry-run (-n) don't actually do anything | 230 --dry-run (-n) don't actually do anything |
231 --help (-h) show detailed help message | 231 --help (-h) show detailed help message |
232 | 232 |
233 Options for 'new_catalog' command: | 233 Options for 'init_catalog' command: |
234 ... | 234 ... |
235 | 235 |
236 Running the command will produce a PO file:: | 236 Running the command will produce a PO file:: |
237 | 237 |
238 $ ./setup.py new_catalog -l fr -i foobar/locales/messages.pot \ | 238 $ ./setup.py init_catalog -l fr -i foobar/locales/messages.pot \ |
239 -o foobar/locales/fr/messages.po | 239 -o foobar/locales/fr/messages.po |
240 running new_catalog | 240 running init_catalog |
241 creating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot' | 241 creating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot' |
242 | 242 |
243 | 243 |
244 Options | 244 Options |
245 ------- | 245 ------- |
246 | 246 |
247 The ``new_catalog`` command accepts the following options: | 247 The ``init_catalog`` command accepts the following options: |
248 | 248 |
249 +-----------------------------+----------------------------------------------+ | 249 +-----------------------------+----------------------------------------------+ |
250 | Option | Description | | 250 | Option | Description | |
251 +=============================+==============================================+ | 251 +=============================+==============================================+ |
252 | ``--domain`` | domain of the PO file (defaults to | | 252 | ``--domain`` | domain of the PO file (defaults to | |
272 | 272 |
273 <output_dir>/<locale>/LC_MESSAGES/<domain>.po | 273 <output_dir>/<locale>/LC_MESSAGES/<domain>.po |
274 | 274 |
275 These options can either be specified on the command-line, or in the | 275 These options can either be specified on the command-line, or in the |
276 ``setup.cfg`` file. | 276 ``setup.cfg`` file. |
277 | |
278 | |
279 update_catalog | |
280 ============== | |
281 | |
282 The ``update_catalog`` command is basically equivalent to the GNU ``msgmerge`` | |
283 program: it updates an existing translations catalog based on a PO template | |
284 file (POT). | |
285 | |
286 If the command has been correctly installed or registered, a project's | |
287 ``setup.py`` script should allow you to use the command:: | |
288 | |
289 $ ./setup.py update_catalog --help | |
290 Global options: | |
291 --verbose (-v) run verbosely (default) | |
292 --quiet (-q) run quietly (turns verbosity off) | |
293 --dry-run (-n) don't actually do anything | |
294 --help (-h) show detailed help message | |
295 | |
296 Options for 'update_catalog' command: | |
297 ... | |
298 | |
299 Running the command will update a PO file:: | |
300 | |
301 $ ./setup.py update_catalog -l fr -i foobar/locales/messages.pot \ | |
302 -o foobar/locales/fr/messages.po | |
303 running update_catalog | |
304 updating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot' | |
305 | |
306 | |
307 Options | |
308 ------- | |
309 | |
310 The ``update_catalog`` command accepts the following options: | |
311 | |
312 +-----------------------------+----------------------------------------------+ | |
313 | Option | Description | | |
314 +=============================+==============================================+ | |
315 | ``--domain`` | domain of the PO file (defaults to | | |
316 | | lower-cased project name) | | |
317 +-----------------------------+----------------------------------------------+ | |
318 | ``--input-file`` (``-i``) | name of the input file | | |
319 +-----------------------------+----------------------------------------------+ | |
320 | ``--output-dir`` (``-d``) | name of the output directory | | |
321 +-----------------------------+----------------------------------------------+ | |
322 | ``--output-file`` (``-o``) | name of the output file | | |
323 +-----------------------------+----------------------------------------------+ | |
324 | ``--locale`` | locale for the new localized string | | |
325 +-----------------------------+----------------------------------------------+ | |
326 | |
327 If ``output-dir`` is specified, but ``output-file`` is not, the default filename | |
328 of the output file will be:: | |
329 | |
330 <output_dir>/<locale>/LC_MESSAGES/<domain>.po | |
331 | |
332 If neither the ``input_file`` nor the ``locale`` option is set, this command | |
333 looks for all catalog files in the base directory that match the given domain, | |
334 and updates each of them. | |
335 | |
336 These options can either be specified on the command-line, or in the | |
337 ``setup.cfg`` file. |