Mercurial > babel > old > mirror
diff doc/setup.txt @ 183:e927dffc9ab4
The frontends now provide ways to update existing translations catalogs from a template. Closes #22.
author | cmlenz |
---|---|
date | Thu, 28 Jun 2007 10:28:25 +0000 |
parents | 6138ea7ef7a8 |
children | b5e58a22ebd2 |
line wrap: on
line diff
--- a/doc/setup.txt +++ b/doc/setup.txt @@ -21,7 +21,7 @@ ... cmd_class = {'compile_catalog': babel.compile_catalog, 'extract_messages': babel.extract_messages, - 'new_catalog': babel.new_catalog} + 'init_catalog': babel.init_catalog} ) @@ -214,37 +214,37 @@ file. For boolean options, use "true" or "false" values. -new_catalog -=========== +init_catalog +============ -The ``new_catalog`` command is basically equivalent to the GNU ``msginit`` +The ``init_catalog`` command is basically equivalent to the GNU ``msginit`` program: it creates a new translation catalog based on a PO template file (POT). If the command has been correctly installed or registered, a project's ``setup.py`` script should allow you to use the command:: - $ ./setup.py new_catalog --help + $ ./setup.py init_catalog --help Global options: --verbose (-v) run verbosely (default) --quiet (-q) run quietly (turns verbosity off) --dry-run (-n) don't actually do anything --help (-h) show detailed help message - Options for 'new_catalog' command: + Options for 'init_catalog' command: ... Running the command will produce a PO file:: - $ ./setup.py new_catalog -l fr -i foobar/locales/messages.pot \ + $ ./setup.py init_catalog -l fr -i foobar/locales/messages.pot \ -o foobar/locales/fr/messages.po - running new_catalog + running init_catalog creating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot' Options ------- -The ``new_catalog`` command accepts the following options: +The ``init_catalog`` command accepts the following options: +-----------------------------+----------------------------------------------+ | Option | Description | @@ -274,3 +274,64 @@ These options can either be specified on the command-line, or in the ``setup.cfg`` file. + + +update_catalog +============== + +The ``update_catalog`` command is basically equivalent to the GNU ``msgmerge`` +program: it updates an existing translations catalog based on a PO template +file (POT). + +If the command has been correctly installed or registered, a project's +``setup.py`` script should allow you to use the command:: + + $ ./setup.py update_catalog --help + Global options: + --verbose (-v) run verbosely (default) + --quiet (-q) run quietly (turns verbosity off) + --dry-run (-n) don't actually do anything + --help (-h) show detailed help message + + Options for 'update_catalog' command: + ... + +Running the command will update a PO file:: + + $ ./setup.py update_catalog -l fr -i foobar/locales/messages.pot \ + -o foobar/locales/fr/messages.po + running update_catalog + updating catalog 'foobar/locales/fr/messages.po' based on 'foobar/locales/messages.pot' + + +Options +------- + +The ``update_catalog`` command accepts the following options: + + +-----------------------------+----------------------------------------------+ + | Option | Description | + +=============================+==============================================+ + | ``--domain`` | domain of the PO file (defaults to | + | | lower-cased project name) | + +-----------------------------+----------------------------------------------+ + | ``--input-file`` (``-i``) | name of the input file | + +-----------------------------+----------------------------------------------+ + | ``--output-dir`` (``-d``) | name of the output directory | + +-----------------------------+----------------------------------------------+ + | ``--output-file`` (``-o``) | name of the output file | + +-----------------------------+----------------------------------------------+ + | ``--locale`` | locale for the new localized string | + +-----------------------------+----------------------------------------------+ + +If ``output-dir`` is specified, but ``output-file`` is not, the default filename +of the output file will be:: + + <output_dir>/<locale>/LC_MESSAGES/<domain>.po + +If neither the ``input_file`` nor the ``locale`` option is set, this command +looks for all catalog files in the base directory that match the given domain, +and updates each of them. + +These options can either be specified on the command-line, or in the +``setup.cfg`` file.