Mercurial > babel > mirror
annotate doc/cmdline.txt @ 177:beb8a9eabe6d trunk
* 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.
* The `--use-fuzzy` option works again from the command-line.
author | cmlenz |
---|---|
date | Wed, 27 Jun 2007 14:29:17 +0000 |
parents | 116e34b8cefa |
children | 8a762ce37bf7 |
rev | line source |
---|---|
2 | 1 .. -*- mode: rst; encoding: utf-8 -*- |
2 | |
3 ====================== | |
4 Command-Line Interface | |
5 ====================== | |
6 | |
7 Babel includes a command-line interface for working with message catalogs, | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
8 similar to the various GNU ``gettext`` tools commonly available on Linux/Unix |
2 | 9 systems. |
10 | |
11 | |
12 .. contents:: Contents | |
13 :depth: 2 | |
14 .. sectnum:: | |
15 | |
16 | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
17 When properly installed, Babel provides a script called ``babel``:: |
2 | 18 |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
19 $ babel --help |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
20 usage: babel subcommand [options] [args] |
2 | 21 |
22 options: | |
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:
80
diff
changeset
|
23 --version show program's version number and exit |
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:
80
diff
changeset
|
24 -h, --help show this help message and exit |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
25 |
73 | 26 subcommands: |
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:
80
diff
changeset
|
27 compile compile message catalogs to MO files |
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:
80
diff
changeset
|
28 extract extract messages from source files and generate a POT file |
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:
80
diff
changeset
|
29 init create new message catalogs from a template |
73 | 30 |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
31 The ``babel`` script provides a number of sub-commands that do the actual work. |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
32 Those sub-commands are described below. |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
33 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
34 |
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:
80
diff
changeset
|
35 compile |
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:
80
diff
changeset
|
36 ======= |
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:
80
diff
changeset
|
37 |
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:
80
diff
changeset
|
38 The ``compile`` sub-command can be used to compile translation catalogs into |
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:
80
diff
changeset
|
39 binary MO files:: |
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:
80
diff
changeset
|
40 |
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:
80
diff
changeset
|
41 $ babel compile --help |
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:
80
diff
changeset
|
42 usage: babel compile [options] |
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:
80
diff
changeset
|
43 |
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:
80
diff
changeset
|
44 compile message catalogs to MO files |
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:
80
diff
changeset
|
45 |
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:
80
diff
changeset
|
46 options: |
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:
80
diff
changeset
|
47 -h, --help show this help message and exit |
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:
80
diff
changeset
|
48 -D DOMAIN, --domain=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:
80
diff
changeset
|
49 domain of MO and PO files (default 'messages') |
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:
80
diff
changeset
|
50 -d DIR, --directory=DIR |
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:
80
diff
changeset
|
51 base directory of catalog files |
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:
80
diff
changeset
|
52 -l LOCALE, --locale=LOCALE |
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:
80
diff
changeset
|
53 locale of the catalog |
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:
80
diff
changeset
|
54 -i FILE, --input-file=FILE |
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:
80
diff
changeset
|
55 name of the input file |
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:
80
diff
changeset
|
56 -o FILE, --output-file=FILE |
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:
80
diff
changeset
|
57 name of the output file (default |
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:
80
diff
changeset
|
58 '<output_dir>/<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:
80
diff
changeset
|
59 -f, --use-fuzzy also include fuzzy translations (default False) |
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:
80
diff
changeset
|
60 |
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:
80
diff
changeset
|
61 If ``directory`` is specified, but ``output-file`` is not, the default filename |
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:
80
diff
changeset
|
62 of the output file will be:: |
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:
80
diff
changeset
|
63 |
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:
80
diff
changeset
|
64 <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:
80
diff
changeset
|
65 |
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:
80
diff
changeset
|
66 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:
80
diff
changeset
|
67 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:
80
diff
changeset
|
68 and compiles each of them to MO files in the same directory. |
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:
80
diff
changeset
|
69 |
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:
80
diff
changeset
|
70 |
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:
80
diff
changeset
|
71 |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
72 extract |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
73 ======= |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
74 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
75 The ``extract`` sub-command can be used to extract localizable messages from |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
76 a collection of source files:: |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
77 |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
78 $ babel extract --help |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
79 usage: babel extract [options] dir1 <dir2> ... |
77 | 80 |
81 extract messages from source files and generate a POT file | |
82 | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
83 options: |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
84 -h, --help show this help message and exit |
2 | 85 --charset=CHARSET charset to use in the output |
86 -k KEYWORDS, --keyword=KEYWORDS | |
87 keywords to look for in addition to the defaults. You | |
88 can specify multiple -k flags on the command line. | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
89 --no-default-keywords |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
90 do not include the default keywords |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
91 -F MAPPING_FILE, --mapping=MAPPING_FILE |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
92 path to the extraction mapping file |
2 | 93 --no-location do not include location comments with filename and |
94 line number | |
95 --omit-header do not include msgid "" entry in header | |
96 -o OUTPUT, --output=OUTPUT | |
97 path to the output POT file | |
52
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
98 -w WIDTH, --width=WIDTH |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
99 set output line width (default 76) |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
100 --no-wrap do not break long message lines, longer than the |
6b9c32893007
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
101 output line width, into several lines |
77 | 102 --sort-output generate sorted output (default False) |
103 --sort-by-file sort output by file location (default False) | |
78
d0d8d6cd8601
Fixed the plurals header on `Catalog` which should only be written if it's not a catalog template.
palgarvio
parents:
77
diff
changeset
|
104 --msgid-bugs-address=EMAIL@ADDRESS |
d0d8d6cd8601
Fixed the plurals header on `Catalog` which should only be written if it's not a catalog template.
palgarvio
parents:
77
diff
changeset
|
105 set report address for msgid |
79
450ac2291ca5
Implemented item 4 from #12. Set the copyright holder in the output.
palgarvio
parents:
78
diff
changeset
|
106 --copyright-holder=COPYRIGHT_HOLDER |
450ac2291ca5
Implemented item 4 from #12. Set the copyright holder in the output.
palgarvio
parents:
78
diff
changeset
|
107 set copyright holder in output |
80
116e34b8cefa
Added support for translator comments at the API and frontends levels.(See #12, item 1). Updated docs and tests accordingly.
palgarvio
parents:
79
diff
changeset
|
108 -c TAG, --add-comments=TAG |
116e34b8cefa
Added support for translator comments at the API and frontends levels.(See #12, item 1). Updated docs and tests accordingly.
palgarvio
parents:
79
diff
changeset
|
109 place comment block with TAG (or those preceding |
116e34b8cefa
Added support for translator comments at the API and frontends levels.(See #12, item 1). Updated docs and tests accordingly.
palgarvio
parents:
79
diff
changeset
|
110 keyword lines) in output file. One TAG per argument |
116e34b8cefa
Added support for translator comments at the API and frontends levels.(See #12, item 1). Updated docs and tests accordingly.
palgarvio
parents:
79
diff
changeset
|
111 call |
73 | 112 |
113 | |
114 init | |
115 ==== | |
116 | |
117 The `init` sub-command creates a new translations catalog based on a PO | |
118 template file:: | |
119 | |
120 $ babel init --help | |
121 usage: babel init [options] | |
122 | |
123 create new message catalogs from a template | |
124 | |
125 options: | |
126 -h, --help show this help message and exit | |
127 -D DOMAIN, --domain=DOMAIN | |
128 domain of PO file (defaults to lower-cased project | |
129 name) | |
130 -i INPUT_FILE, --input-file=INPUT_FILE | |
131 name of the input file | |
132 -d OUTPUT_DIR, --output-dir=OUTPUT_DIR | |
133 path to output directory | |
134 -o OUTPUT_FILE, --output-file=OUTPUT_FILE | |
135 name of the output file (default | |
136 '<output_dir>/<locale>/<domain>.po') | |
137 -l LOCALE, --locale=LOCALE | |
138 locale for the new localized catalog | |
139 --first-author=FIRST_AUTHOR_NAME | |
140 name of first author | |
141 --first-author-email=FIRST_AUTHOR_EMAIL | |
142 email of first author | |
143 --project-name=NAME the project name | |
144 --project-version=VERSION | |
145 the project version |