Mercurial > babel > old > babel-test
annotate doc/cmdline.txt @ 114:5ec3364f250a
Added some minor distutils frontend tests, corrected and moved mapping.cfg to the appropriate place.
author | palgarvio |
---|---|
date | Thu, 14 Jun 2007 21:55:18 +0000 |
parents | 9c84b9fa5d30 |
children | a7766f92f944 0e82db0c5018 |
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
1e724c305460
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
1e724c305460
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
1e724c305460
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 |
1e724c305460
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: | |
23 --version show program's version number and exit | |
24 -h, --help show this help message and exit | |
52
1e724c305460
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: |
27 extract extract messages from source files and generate a POT file | |
28 init create new message catalogs from a template | |
29 | |
52
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
30 The ``babel`` script provides a number of sub-commands that do the actual work. |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
31 Those sub-commands are described below. |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
32 |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
33 |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
34 extract |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
35 ======= |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
36 |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
37 The ``extract`` sub-command can be used to extract localizable messages from |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
38 a collection of source files:: |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
39 |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
40 $ babel extract --help |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
41 usage: babel extract [options] dir1 <dir2> ... |
77 | 42 |
43 extract messages from source files and generate a POT file | |
44 | |
52
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
45 options: |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
46 -h, --help show this help message and exit |
2 | 47 --charset=CHARSET charset to use in the output |
48 -k KEYWORDS, --keyword=KEYWORDS | |
49 keywords to look for in addition to the defaults. You | |
50 can specify multiple -k flags on the command line. | |
52
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
51 --no-default-keywords |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
52 do not include the default keywords |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
53 -F MAPPING_FILE, --mapping=MAPPING_FILE |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
54 path to the extraction mapping file |
2 | 55 --no-location do not include location comments with filename and |
56 line number | |
57 --omit-header do not include msgid "" entry in header | |
58 -o OUTPUT, --output=OUTPUT | |
59 path to the output POT file | |
52
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
60 -w WIDTH, --width=WIDTH |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
61 set output line width (default 76) |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
62 --no-wrap do not break long message lines, longer than the |
1e724c305460
Support sub-commands in command-line interface, and renamed the generated script wrapper to `babel`. See #9.
cmlenz
parents:
2
diff
changeset
|
63 output line width, into several lines |
77 | 64 --sort-output generate sorted output (default False) |
65 --sort-by-file sort output by file location (default False) | |
78
ee043bb666f0
Fixed the plurals header on `Catalog` which should only be written if it's not a catalog template.
palgarvio
parents:
77
diff
changeset
|
66 --msgid-bugs-address=EMAIL@ADDRESS |
ee043bb666f0
Fixed the plurals header on `Catalog` which should only be written if it's not a catalog template.
palgarvio
parents:
77
diff
changeset
|
67 set report address for msgid |
79
9a05230571f8
Implemented item 4 from #12. Set the copyright holder in the output.
palgarvio
parents:
78
diff
changeset
|
68 --copyright-holder=COPYRIGHT_HOLDER |
9a05230571f8
Implemented item 4 from #12. Set the copyright holder in the output.
palgarvio
parents:
78
diff
changeset
|
69 set copyright holder in output |
80
9c84b9fa5d30
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
|
70 -c TAG, --add-comments=TAG |
9c84b9fa5d30
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
|
71 place comment block with TAG (or those preceding |
9c84b9fa5d30
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
|
72 keyword lines) in output file. One TAG per argument |
9c84b9fa5d30
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
|
73 call |
73 | 74 |
75 | |
76 init | |
77 ==== | |
78 | |
79 The `init` sub-command creates a new translations catalog based on a PO | |
80 template file:: | |
81 | |
82 $ babel init --help | |
83 usage: babel init [options] | |
84 | |
85 create new message catalogs from a template | |
86 | |
87 options: | |
88 -h, --help show this help message and exit | |
89 -D DOMAIN, --domain=DOMAIN | |
90 domain of PO file (defaults to lower-cased project | |
91 name) | |
92 -i INPUT_FILE, --input-file=INPUT_FILE | |
93 name of the input file | |
94 -d OUTPUT_DIR, --output-dir=OUTPUT_DIR | |
95 path to output directory | |
96 -o OUTPUT_FILE, --output-file=OUTPUT_FILE | |
97 name of the output file (default | |
98 '<output_dir>/<locale>/<domain>.po') | |
99 -l LOCALE, --locale=LOCALE | |
100 locale for the new localized catalog | |
101 --first-author=FIRST_AUTHOR_NAME | |
102 name of first author | |
103 --first-author-email=FIRST_AUTHOR_EMAIL | |
104 email of first author | |
105 --project-name=NAME the project name | |
106 --project-version=VERSION | |
107 the project version |