annotate doc/setup.txt @ 146:24b5de939850

Some doc fixes.
author cmlenz
date Wed, 20 Jun 2007 15:04:48 +0000
parents c84f629da9de
children 661cb602781d
rev   line source
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
1 .. -*- mode: rst; encoding: utf-8 -*-
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
2
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
3 ================================
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
4 Distutils/Setuptools Integration
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
5 ================================
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
6
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
7 Babel provides commands for integration into ``setup.py`` scripts, based on
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
8 either the ``distutils`` package that is part of the Python standard library,
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
9 or the third-party ``setuptools`` package.
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
10
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
11 These commands are available by default when Babel has been properly installed,
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
12 and ``setup.py`` is using ``setuptools``. For projects that use plain old
42
cf94e70a77f3 Syntax highlighting for the docs.
cmlenz
parents: 4
diff changeset
13 ``distutils``, the commands need to be registered explicitly, for example:
cf94e70a77f3 Syntax highlighting for the docs.
cmlenz
parents: 4
diff changeset
14
cf94e70a77f3 Syntax highlighting for the docs.
cmlenz
parents: 4
diff changeset
15 .. code-block:: python
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
16
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
17 from distutils.core import setup
56
27d55a07c897 Rename the `babel.catalog` package to `babel.messages` for consistency with the other package names.
cmlenz
parents: 53
diff changeset
18 from babel.messages import frontend as babel
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
19
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
20 setup(
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
21 ...
92
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
22 cmd_class = {'extract_messages': babel.extract_messages,
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
23 'new_catalog': babel.new_catalog}
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
24 )
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
25
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
26
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
27 .. contents:: Contents
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
28 :depth: 2
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
29 .. sectnum::
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
30
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
31
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
32 extract_messages
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
33 ================
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
34
92
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
35 The ``extract_messages`` command is comparable to the GNU ``xgettext`` program:
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
36 it can extract localizable messages from a variety of difference source files,
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
37 and generate a PO (portable object) template file from the collected messages.
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
38
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
39 If the command has been correctly installed or registered, another project's
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
40 ``setup.py`` script should allow you to use the command::
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
41
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
42 $ ./setup.py extract_messages --help
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
43 Global options:
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
44 --verbose (-v) run verbosely (default)
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
45 --quiet (-q) run quietly (turns verbosity off)
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
46 --dry-run (-n) don't actually do anything
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
47 --help (-h) show detailed help message
79
7cf16a49e8b2 Updated frontend screens for added sorting features.
cmlenz
parents: 64
diff changeset
48
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
49 Options for 'extract_messages' command:
92
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
50 ...
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
51
53
52dbebdd3789 Fixed a bug regarding plural msgid's handling when writing the `.pot` file.
palgarvio
parents: 51
diff changeset
52 Running the command will produce a PO template file::
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
53
51
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
54 $ ./setup.py extract_messages --output-file foobar/locale/messages.pot
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
55 running extract_messages
51
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
56 extracting messages from foobar/__init__.py
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
57 extracting messages from foobar/core.py
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
58 ...
53
52dbebdd3789 Fixed a bug regarding plural msgid's handling when writing the `.pot` file.
palgarvio
parents: 51
diff changeset
59 writing PO template file to foobar/locale/messages.pot
51
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
60
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
61
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
62 Method Mapping
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
63 --------------
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
64
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
65 The mapping of file patterns to extraction methods (and options) can be
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
66 specified using a configuration file that is pointed to using the
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
67 ``--mapping-file`` option shown above. Alternatively, you can configure the
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
68 mapping directly in ``setup.py`` using a keyword argument to the ``setup()``
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
69 function:
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
70
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
71 .. code-block:: python
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
72
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
73 setup(...
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
74
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
75 message_extractors = {
64
7eb6fea17864 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 56
diff changeset
76 'foobar': [
119
c84f629da9de Made new frontend tests more ''unit-y'', i.e. calling the APIs directly instead of launching the scripts.
cmlenz
parents: 92
diff changeset
77 ('**.py', 'python', None),
c84f629da9de Made new frontend tests more ''unit-y'', i.e. calling the APIs directly instead of launching the scripts.
cmlenz
parents: 92
diff changeset
78 ('**/templates/**.html', 'genshi', None),
c84f629da9de Made new frontend tests more ''unit-y'', i.e. calling the APIs directly instead of launching the scripts.
cmlenz
parents: 92
diff changeset
79 ('**/templates/**.txt', 'genshi', {
146
24b5de939850 Some doc fixes.
cmlenz
parents: 119
diff changeset
80 'template_class': 'genshi.template:TextTemplate'
64
7eb6fea17864 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 56
diff changeset
81 })
7eb6fea17864 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 56
diff changeset
82 ],
51
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
83 },
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
84
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
85 ...
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
86 )
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
87
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
88
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
89 Options
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
90 -------
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
91
92
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
92 The ``extract_messages`` command accepts the following options:
4
2cada72b40ae Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
93
51
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
94 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
95 | Option | Description |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
96 +=============================+==============================================+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
97 | ``--charset`` | charset to use in the output file |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
98 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
99 | ``--keywords`` (``-k``) | space-separated list of keywords to look for |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
100 | | in addition to the defaults |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
101 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
102 | ``--no-default-keywords`` | do not include the default keywords |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
103 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
104 | ``--mapping-file`` (``-F``) | path to the mapping configuration file |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
105 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
106 | ``--no-location`` | do not include location comments with |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
107 | | filename and line number |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
108 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
109 | ``--omit-header`` | do not include msgid "" entry in header |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
110 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
111 | ``--output-file`` (``-o``) | name of the output file |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
112 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
113 | ``--width`` (``-w``) | set output line width (default 76) |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
114 +-----------------------------+----------------------------------------------+
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
115 | ``--no-wrap`` | do not break long message lines, longer than |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
116 | | the output line width, into several lines |
3664c93860f1 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 42
diff changeset
117 +-----------------------------+----------------------------------------------+
64
7eb6fea17864 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 56
diff changeset
118 | ``--input-dirs`` | directories that should be scanned for |
7eb6fea17864 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 56
diff changeset
119 | | messages |
7eb6fea17864 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 56
diff changeset
120 +-----------------------------+----------------------------------------------+
92
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
121 | ``--sort-output`` | generate sorted output (default False) |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
122 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
123 | ``--sort-by-file`` | sort output by file location (default False) |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
124 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
125 | ``--msgid-bugs-address`` | set email address for message bug reports |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
126 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
127 | ``--copyright-holder`` | set copyright holder in output |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
128 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
129 | ``--add-comments (-c)`` | place comment block with TAG (or those |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
130 | | preceding keyword lines) in output file. |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
131 | | Separate multiple TAGs with commas(,) |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
132 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
133
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
134 These options can either be specified on the command-line, or in the
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
135 ``setup.cfg`` file. In the latter case, the options above become entries of the
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
136 section ``[extract_messages]``, and the option names are changed to use
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
137 underscore characters instead of dashes, for example:
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
138
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
139 .. code-block:: ini
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
140
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
141 [extract_messages]
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
142 keywords = _, gettext, ngettext
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
143 mapping_file = babel.cfg
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
144 width = 80
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
145
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
146 This would be equivalent to invoking the command from the command-line as
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
147 follows::
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
148
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
149 $ setup.py extract_messages -k _ -k gettext -k ngettext -F mapping.cfg -w 80
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
150
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
151 Any path names are interpreted relative to the location of the ``setup.py``
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
152 file. For boolean options, use "true" or "false" values.
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
153
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
154
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
155 new_catalog
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
156 ===========
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
157
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
158 The ``new_catalog`` command is basically equivalent to the GNU ``msginit``
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
159 program: it creates a new translation catalog based on a PO template file (POT).
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
160
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
161 If the command has been correctly installed or registered, another project's
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
162 ``setup.py`` script should allow you to use the command::
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
163
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
164 $ ./setup.py new_catalog --help
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
165 Global options:
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
166 --verbose (-v) run verbosely (default)
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
167 --quiet (-q) run quietly (turns verbosity off)
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
168 --dry-run (-n) don't actually do anything
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
169 --help (-h) show detailed help message
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
170
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
171 Options for 'new_catalog' command:
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
172 ...
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
173
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
174 Running the command will produce a PO file::
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
175
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
176 $ ./setup.py new_catalog -l fr -i foobar/locales/messages.pot \
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
177 -o foobar/locales/fr/messages.po
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
178 running new_catalog
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
179 creating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot'
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
180
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
181
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
182 Options
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
183 -------
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
184
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
185 The ``new_catalog`` command accepts the following options:
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
186
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
187 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
188 | Option | Description |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
189 +=============================+==============================================+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
190 | ``--domain`` | domain of the PO file (defaults to |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
191 | | lower-cased project name) |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
192 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
193 | ``--input-file`` (``-i``) | name of the input file |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
194 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
195 | ``--output-dir`` (``-d``) | name of the output directory |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
196 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
197 | ``--output-file`` (``-o``) | name of the output file |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
198 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
199 | ``--locale`` | locale for the new localized string |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
200 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
201 | ``--omit-header`` | do not include msgid "" entry in header |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
202 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
203 | ``--first-author`` | name of the first author |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
204 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
205 | ``--first-author-email`` | email address of the first author |
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
206 +-----------------------------+----------------------------------------------+
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
207
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
208 If ``output-dir`` is specified, but ``output-file`` is not, the default filename
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
209 of the output file will be::
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
210
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
211 <output_dir>/<locale>/LC_MESSAGES/<domain>.po
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
212
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
213 These options can either be specified on the command-line, or in the
6d1a7777003e Some doc improvements on distutils integration.
cmlenz
parents: 82
diff changeset
214 ``setup.cfg`` file.
Copyright (C) 2012-2017 Edgewall Software