annotate doc/setup.txt @ 190:5041d90edf0c trunk

Correctly write out obsolete messages spanning multiple lines. Fixes #33.
author cmlenz
date Sun, 01 Jul 2007 17:45:27 +0000
parents 8a762ce37bf7
children c171a0041ad2
rev   line source
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
1 .. -*- mode: rst; encoding: utf-8 -*-
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
3 ================================
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
4 Distutils/Setuptools Integration
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
5 ================================
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
6
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
7 Babel provides commands for integration into ``setup.py`` scripts, based on
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
8 either the ``distutils`` package that is part of the Python standard library,
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
9 or the third-party ``setuptools`` package.
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
10
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
11 These commands are available by default when Babel has been properly installed,
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
12 and ``setup.py`` is using ``setuptools``. For projects that use plain old
40
0739bc8e7210 Syntax highlighting for the docs.
cmlenz
parents: 2
diff changeset
13 ``distutils``, the commands need to be registered explicitly, for example:
0739bc8e7210 Syntax highlighting for the docs.
cmlenz
parents: 2
diff changeset
14
0739bc8e7210 Syntax highlighting for the docs.
cmlenz
parents: 2
diff changeset
15 .. code-block:: python
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
16
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
17 from distutils.core import setup
54
7dbcbc3f07e0 Rename the `babel.catalog` package to `babel.messages` for consistency with the other package names.
cmlenz
parents: 51
diff changeset
18 from babel.messages import frontend as babel
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
19
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
20 setup(
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
21 ...
160
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
22 cmd_class = {'compile_catalog': babel.compile_catalog,
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
23 'extract_messages': babel.extract_messages,
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
24 'init_catalog': babel.init_catalog}
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
25 )
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
26
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
27
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
28 .. contents:: Contents
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
29 :depth: 2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
30 .. sectnum::
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
31
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
32
160
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
33 compile_catalog
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
34 ===============
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
35
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
36 The ``compile_catalog`` command is similar to the GNU ``msgfmt`` tool, in that
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
37 it takes a message catalog from a PO file and compiles it to a binary MO file.
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
38
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
39 If the command has been correctly installed or registered, a project's
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
40 ``setup.py`` script should allow you to use the command::
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
41
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
42 $ ./setup.py compile_catalog --help
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
43 Global options:
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
44 --verbose (-v) run verbosely (default)
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
45 --quiet (-q) run quietly (turns verbosity off)
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
46 --dry-run (-n) don't actually do anything
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
47 --help (-h) show detailed help message
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
48
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
49 Options for 'compile_catalog' command:
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
50 ...
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
51
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
52 Running the command will produce a PO template file::
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
53
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
54 $ ./setup.py compile_catalog --directory foobar/locale --locale pt_BR
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
55 running compile_catalog
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
56 compiling catalog to to foobar/locale/pt_BR/LC_MESSAGES/messages.mo
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
57
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
58
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
59 Options
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
60 -------
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
61
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
62 The ``compile_catalog`` command accepts the following options:
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
63
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
64 +-----------------------------+----------------------------------------------+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
65 | Option | Description |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
66 +=============================+==============================================+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
67 | ``--domain`` | domain of the PO file (defaults to |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
68 | | lower-cased project name) |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
69 +-----------------------------+----------------------------------------------+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
70 | ``--directory`` (``-d``) | name of the base directory |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
71 +-----------------------------+----------------------------------------------+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
72 | ``--input-file`` (``-i``) | name of the input file |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
73 +-----------------------------+----------------------------------------------+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
74 | ``--output-file`` (``-o``) | name of the output file |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
75 +-----------------------------+----------------------------------------------+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
76 | ``--locale`` | locale for the new localized string |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
77 +-----------------------------+----------------------------------------------+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
78 | ``--use-fuzzy`` | also include "fuzzy" translations |
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
79 +-----------------------------+----------------------------------------------+
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
80
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
81 If ``directory`` is specified, but ``output-file`` is not, the default filename
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
82 of the output file will be::
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
83
177
beb8a9eabe6d * Instead of an extra `compile-all` option on the `compile` (or `compile_catalog`) command, compilation of all catalogs is performed when neither an `input_file` nor a `locale` is specified.
cmlenz
parents: 160
diff changeset
84 <directory>/<locale>/LC_MESSAGES/<domain>.mo
beb8a9eabe6d * Instead of an extra `compile-all` option on the `compile` (or `compile_catalog`) command, compilation of all catalogs is performed when neither an `input_file` nor a `locale` is specified.
cmlenz
parents: 160
diff changeset
85
beb8a9eabe6d * Instead of an extra `compile-all` option on the `compile` (or `compile_catalog`) command, compilation of all catalogs is performed when neither an `input_file` nor a `locale` is specified.
cmlenz
parents: 160
diff changeset
86 If neither the ``input_file`` nor the ``locale`` option is set, this command
beb8a9eabe6d * Instead of an extra `compile-all` option on the `compile` (or `compile_catalog`) command, compilation of all catalogs is performed when neither an `input_file` nor a `locale` is specified.
cmlenz
parents: 160
diff changeset
87 looks for all catalog files in the base directory that match the given domain,
beb8a9eabe6d * Instead of an extra `compile-all` option on the `compile` (or `compile_catalog`) command, compilation of all catalogs is performed when neither an `input_file` nor a `locale` is specified.
cmlenz
parents: 160
diff changeset
88 and compiles each of them to MO files in the same directory.
160
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
89
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
90 These options can either be specified on the command-line, or in the
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
91 ``setup.cfg`` file.
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
92
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
93
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
94 extract_messages
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
95 ================
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
96
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
97 The ``extract_messages`` command is comparable to the GNU ``xgettext`` program:
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
98 it can extract localizable messages from a variety of difference source files,
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
99 and generate a PO (portable object) template file from the collected messages.
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
100
160
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
101 If the command has been correctly installed or registered, a project's
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
102 ``setup.py`` script should allow you to use the command::
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
103
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
104 $ ./setup.py extract_messages --help
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
105 Global options:
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
106 --verbose (-v) run verbosely (default)
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
107 --quiet (-q) run quietly (turns verbosity off)
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
108 --dry-run (-n) don't actually do anything
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
109 --help (-h) show detailed help message
77
c75fa55a65b9 Updated frontend screens for added sorting features.
cmlenz
parents: 62
diff changeset
110
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
111 Options for 'extract_messages' command:
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
112 ...
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
113
51
d484eb9a70d5 Fixed a bug regarding plural msgid's handling when writing the `.pot` file.
palgarvio
parents: 49
diff changeset
114 Running the command will produce a PO template file::
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
115
49
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
116 $ ./setup.py extract_messages --output-file foobar/locale/messages.pot
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
117 running extract_messages
49
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
118 extracting messages from foobar/__init__.py
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
119 extracting messages from foobar/core.py
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
120 ...
51
d484eb9a70d5 Fixed a bug regarding plural msgid's handling when writing the `.pot` file.
palgarvio
parents: 49
diff changeset
121 writing PO template file to foobar/locale/messages.pot
49
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
122
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
123
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
124 Method Mapping
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
125 --------------
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
126
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
127 The mapping of file patterns to extraction methods (and options) can be
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
128 specified using a configuration file that is pointed to using the
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
129 ``--mapping-file`` option shown above. Alternatively, you can configure the
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
130 mapping directly in ``setup.py`` using a keyword argument to the ``setup()``
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
131 function:
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
132
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
133 .. code-block:: python
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
134
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
135 setup(...
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
136
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
137 message_extractors = {
62
2df27f49c320 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 54
diff changeset
138 'foobar': [
117
e1dffa3423a0 Made new frontend tests more ''unit-y'', i.e. calling the APIs directly instead of launching the scripts.
cmlenz
parents: 90
diff changeset
139 ('**.py', 'python', None),
e1dffa3423a0 Made new frontend tests more ''unit-y'', i.e. calling the APIs directly instead of launching the scripts.
cmlenz
parents: 90
diff changeset
140 ('**/templates/**.html', 'genshi', None),
e1dffa3423a0 Made new frontend tests more ''unit-y'', i.e. calling the APIs directly instead of launching the scripts.
cmlenz
parents: 90
diff changeset
141 ('**/templates/**.txt', 'genshi', {
144
14fe2a8fb842 Some doc fixes.
cmlenz
parents: 117
diff changeset
142 'template_class': 'genshi.template:TextTemplate'
62
2df27f49c320 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 54
diff changeset
143 })
2df27f49c320 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 54
diff changeset
144 ],
49
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
145 },
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
146
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
147 ...
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
148 )
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
149
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
150
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
151 Options
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
152 -------
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
153
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
154 The ``extract_messages`` command accepts the following options:
2
20896f1e91c6 Forgot to check in the doc directory.
cmlenz
parents:
diff changeset
155
49
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
156 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
157 | Option | Description |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
158 +=============================+==============================================+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
159 | ``--charset`` | charset to use in the output file |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
160 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
161 | ``--keywords`` (``-k``) | space-separated list of keywords to look for |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
162 | | in addition to the defaults |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
163 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
164 | ``--no-default-keywords`` | do not include the default keywords |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
165 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
166 | ``--mapping-file`` (``-F``) | path to the mapping configuration file |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
167 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
168 | ``--no-location`` | do not include location comments with |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
169 | | filename and line number |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
170 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
171 | ``--omit-header`` | do not include msgid "" entry in header |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
172 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
173 | ``--output-file`` (``-o``) | name of the output file |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
174 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
175 | ``--width`` (``-w``) | set output line width (default 76) |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
176 +-----------------------------+----------------------------------------------+
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
177 | ``--no-wrap`` | do not break long message lines, longer than |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
178 | | the output line width, into several lines |
37bd476dafe4 Support a `message_extractors` keyword argument directly in `setup()`. Closes #4.
cmlenz
parents: 40
diff changeset
179 +-----------------------------+----------------------------------------------+
62
2df27f49c320 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 54
diff changeset
180 | ``--input-dirs`` | directories that should be scanned for |
2df27f49c320 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 54
diff changeset
181 | | messages |
2df27f49c320 The order of extraction methods is now preserved (see #10).
cmlenz
parents: 54
diff changeset
182 +-----------------------------+----------------------------------------------+
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
183 | ``--sort-output`` | generate sorted output (default False) |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
184 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
185 | ``--sort-by-file`` | sort output by file location (default False) |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
186 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
187 | ``--msgid-bugs-address`` | set email address for message bug reports |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
188 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
189 | ``--copyright-holder`` | set copyright holder in output |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
190 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
191 | ``--add-comments (-c)`` | place comment block with TAG (or those |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
192 | | preceding keyword lines) in output file. |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
193 | | Separate multiple TAGs with commas(,) |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
194 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
195
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
196 These options can either be specified on the command-line, or in the
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
197 ``setup.cfg`` file. In the latter case, the options above become entries of the
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
198 section ``[extract_messages]``, and the option names are changed to use
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
199 underscore characters instead of dashes, for example:
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
200
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
201 .. code-block:: ini
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
202
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
203 [extract_messages]
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
204 keywords = _, gettext, ngettext
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
205 mapping_file = babel.cfg
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
206 width = 80
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
207
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
208 This would be equivalent to invoking the command from the command-line as
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
209 follows::
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
210
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
211 $ setup.py extract_messages -k _ -k gettext -k ngettext -F mapping.cfg -w 80
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
212
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
213 Any path names are interpreted relative to the location of the ``setup.py``
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
214 file. For boolean options, use "true" or "false" values.
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
215
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
216
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
217 init_catalog
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
218 ============
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
219
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
220 The ``init_catalog`` command is basically equivalent to the GNU ``msginit``
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
221 program: it creates a new translation catalog based on a PO template file (POT).
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
222
160
23005b4efc99 Add MO file generation. Closes #21.
cmlenz
parents: 144
diff changeset
223 If the command has been correctly installed or registered, a project's
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
224 ``setup.py`` script should allow you to use the command::
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
225
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
226 $ ./setup.py init_catalog --help
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
227 Global options:
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
228 --verbose (-v) run verbosely (default)
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
229 --quiet (-q) run quietly (turns verbosity off)
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
230 --dry-run (-n) don't actually do anything
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
231 --help (-h) show detailed help message
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
232
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
233 Options for 'init_catalog' command:
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
234 ...
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
235
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
236 Running the command will produce a PO file::
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
237
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
238 $ ./setup.py init_catalog -l fr -i foobar/locales/messages.pot \
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
239 -o foobar/locales/fr/messages.po
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
240 running init_catalog
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
241 creating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot'
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
242
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
243
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
244 Options
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
245 -------
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
246
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
247 The ``init_catalog`` command accepts the following options:
90
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
248
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
249 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
250 | Option | Description |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
251 +=============================+==============================================+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
252 | ``--domain`` | domain of the PO file (defaults to |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
253 | | lower-cased project name) |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
254 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
255 | ``--input-file`` (``-i``) | name of the input file |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
256 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
257 | ``--output-dir`` (``-d``) | name of the output directory |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
258 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
259 | ``--output-file`` (``-o``) | name of the output file |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
260 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
261 | ``--locale`` | locale for the new localized string |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
262 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
263 | ``--omit-header`` | do not include msgid "" entry in header |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
264 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
265 | ``--first-author`` | name of the first author |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
266 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
267 | ``--first-author-email`` | email address of the first author |
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
268 +-----------------------------+----------------------------------------------+
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
269
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
270 If ``output-dir`` is specified, but ``output-file`` is not, the default filename
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
271 of the output file will be::
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
272
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
273 <output_dir>/<locale>/LC_MESSAGES/<domain>.po
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
274
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
275 These options can either be specified on the command-line, or in the
21e3f63ee8a5 Some doc improvements on distutils integration.
cmlenz
parents: 80
diff changeset
276 ``setup.cfg`` file.
181
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
277
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
278
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
279 update_catalog
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
280 ==============
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
281
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
282 The ``update_catalog`` command is basically equivalent to the GNU ``msgmerge``
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
283 program: it updates an existing translations catalog based on a PO template
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
284 file (POT).
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
285
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
286 If the command has been correctly installed or registered, a project's
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
287 ``setup.py`` script should allow you to use the command::
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
288
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
289 $ ./setup.py update_catalog --help
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
290 Global options:
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
291 --verbose (-v) run verbosely (default)
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
292 --quiet (-q) run quietly (turns verbosity off)
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
293 --dry-run (-n) don't actually do anything
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
294 --help (-h) show detailed help message
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
295
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
296 Options for 'update_catalog' command:
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
297 ...
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
298
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
299 Running the command will update a PO file::
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
300
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
301 $ ./setup.py update_catalog -l fr -i foobar/locales/messages.pot \
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
302 -o foobar/locales/fr/messages.po
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
303 running update_catalog
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
304 updating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot'
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
305
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
306
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
307 Options
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
308 -------
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
309
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
310 The ``update_catalog`` command accepts the following options:
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
311
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
312 +-----------------------------+----------------------------------------------+
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
313 | Option | Description |
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
314 +=============================+==============================================+
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
315 | ``--domain`` | domain of the PO file (defaults to |
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
316 | | lower-cased project name) |
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
317 +-----------------------------+----------------------------------------------+
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
318 | ``--input-file`` (``-i``) | name of the input file |
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
319 +-----------------------------+----------------------------------------------+
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
320 | ``--output-dir`` (``-d``) | name of the output directory |
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
321 +-----------------------------+----------------------------------------------+
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
322 | ``--output-file`` (``-o``) | name of the output file |
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
323 +-----------------------------+----------------------------------------------+
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
324 | ``--locale`` | locale for the new localized string |
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
325 +-----------------------------+----------------------------------------------+
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
326
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
327 If ``output-dir`` is specified, but ``output-file`` is not, the default filename
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
328 of the output file will be::
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
329
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
330 <output_dir>/<locale>/LC_MESSAGES/<domain>.po
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
331
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
332 If neither the ``input_file`` nor the ``locale`` option is set, this command
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
333 looks for all catalog files in the base directory that match the given domain,
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
334 and updates each of them.
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
335
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
336 These options can either be specified on the command-line, or in the
8a762ce37bf7 The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
cmlenz
parents: 177
diff changeset
337 ``setup.cfg`` file.
Copyright (C) 2012-2017 Edgewall Software