View on
MetaCPAN is shutting down
For details read Perl NOC. After June 25th this page will redirect to
Jörn Reder > CIPP > cipp-l10n


Annotate this POD


New  1
Open  0
View/Report Bugs


cipp-l10n - do various l10n tasks with CIPP source files





These options control the main operation mode of the program. Currently most of them are valid only in new.spirit mode and it's allowed to combined them. Only --xgettext doesn't require new.spirit mode.

--xgettext | -x

Extract gettext messages from source files. Valid options are -o and -d. More input files may be given at the command line.

--genconf | -c

Creates CIPP textdomain config file. Valid only with --newspirit.

--updatepo | -u

Update a .po file merging new messages from a .pot file into it. Valid only with --newspirit.

--install | -i

Compile a binary .mo file from a .po file. Valid options are -o. Valid only with --newspirit.

--all | -a

Execute all commands listed above in a row: --genconf --xgettext --updatepo --install. Valid only with --newspirit.


--newspirit | -n

new.spirit mode. It's assumed that the directory passed with -d is a subdirectory of a new.spirit project root folder or the root folder itself.

With --genconf all directories in the new.spirit project are scanned for textdomain definitions and .-po files. A summary of this information is stored in the project's ROOT/prod/l10n/domains.conf file.

In --xgettext all source files are scanned for text messages and the corrsponding .pot files are saved as ROOT/tmp/l10n/DOMAIN.pot.

If the -d directory is a new.spirit project subdirectory, --xgettext will extract messages only from the textdomain this subdirectory belongs to. As well --genconf is disabled automatically (if set), because generating a config file with a subset of the project's domains wouldn't make sende.

In --updatepo mode all po files are merged with the .pot files generated during a prior --xgettext run.

In --msgfmt mode all .po files are compiled to .mo format and installed as ROOT/prod/l10n/LANG/LC_MESSAGES/

--output | -o filename

Write output to the specified file. Invalid in --newspirit mode.

--directory | -d directory

Search for CIPP source files in this directory. Only valid with --xgettext or --newspirit.

--verbose | -v

Print progress information to STDERR.


Print a brief help message.


Show the full manpage.


cipp-xgettext extracts gettext strings from CIPP sources and generates a corresponding .po file for them.


This section shows some typical examples of cipp-l10n usage:

Extract all messages from a new.spirit project

This command extracts all messages from a new.spirit project and generates a .pot file for each textdomain. Additionally the prod/l10n/domains.conf file is created:

  % cd some/newspirit/project/root
  % cipp-l10n -v -n -d . --xgettext --genconf

Just update .po files in a new.spirit subdirectory

This command updates all .po files for the textdomain of the custom/ subdirectory in a new.spirit project:

  % cd some/newspirit/project/root
  % cd src/custom
  % cipp-l10n -v -n -d . --updatepo

This presumes that a domains.conf file exists already, otherwise you would have to do a --geconf run first.

Install all .mo files in a new.spirit project

This command runs msgfmt for all textdomains resp .po files in a new.spirit directory and installs the resulting .mo files in the prod/l10n/ directory:

  % cd some/newspirit/project/root
  % cipp-l10n -v -n -d . --install

Do all tasks above in one run

This executes all tasks: message extraction / .pot file generation, domains.conf generation, .po updating and .mo installation:

  % cd some/newspirit/project/root
  % cipp-l10n -v -n -d . --all

Simply extract messages of a CIPP source tree

This command is for non new.spirit projects and just extracts messages from CIPP sources and generates a corresponding .pot file:

  % cipp-l10n -v -d some/cipp/src --xgettext --output some.pot
syntax highlighting: