NAME
cipp-l10n - do various l10n tasks with CIPP source files
SYNOPSIS
cipp-l10n [COMMAND OPTIONS] [OPTIONS] [INPUTFILE]...
OPTIONS
COMMAND OPTIONS
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.
ADDITIONAL OPTIONS
- --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/DOMAIN.mo.
- --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.
- --help
-
Print a brief help message.
- --man
-
Show the full manpage.
DESCRIPTION
cipp-xgettext extracts gettext strings from CIPP sources and generates a corresponding .po file for them.
EXAMPLES
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