|<B>?B>||Include addendum_path if this file does exist, otherwise do nothing.|
|<B>@B>||addendum_path is not a regular addendum but a file containg a list of addenda, one by line. Each addendum may be preceded by modifiers.|
|<B>!B>||addendum_path is discarded, it is not loaded and will not be loaded by any further addendum specification.|
[type: pod] script $lang:doc/$lang/script.1 \
If all the languages had addenda with similar paths, you could also write something like:
[type: pod] script $lang:doc/$lang/script.1 \
<B>po4aB> accepts options that will be passed to the module. These options are module specific and are specified with the <B>-oB> switch.
If you need a specific option for one of the document you want to translate, you can also specify it in the configuration file. Options are introduced by the <B>optB> keyword. The argument of the <B>optB> keyword must be quoted with double quotes if it contains a space (e.g. if you specify multiple options, or an option with an argument). You can also specify options that will only apply to a specific language by using the <B>opt_B>lang keyword.
Here is an example:
[type:man] data-05/test2_man.1 $lang:tmp/test2_man.$lang.1 \
opt:-k 75 opt_it:-L UTF-8 opt_fr:-v
Arguments may contain spaces if you use single quotes or escaped double quotes:
[po4a_alias:man] man opt:-o \mdoc=NAME,SEE ALSO\ -k 20
You can also set options for all the documents specified in the configuration file:
[options] opt:... opt_fr:...
If you must specify the same options for multiple files, you may be interested in defining a module alias. This can be done this way:
[po4a_alias:test] man opt:"-k 21" opt_es:"-o debug=splitargs"
This module alias can then be use like a regular module:
[type:test] data-05/test2_man.1 $lang:tmp/test2_man.$lang.1 \ opt_it:"-L UTF-8" opt_fr:-v
Note that you can specify additional options on a per file basis.
The split mode is used when <B>B>$master<B>B> is used in the <B>[po4a_paths]B> line.
When the split mode is used, a temporary big POT and temporary big POs are used. This permits to share the translations between all the POs.
If two POs have different translations for the same string, <B>po4aB> will mark this string as fuzzy and will submit both translations in all the POs which contain this string. Then, when a translator updates the translation and removes the fuzzy tag in one PO, the translation of this string will be updated in every POs automatically.
If there are name conflicts because several files have the same filename, the name of the master file can be specified by adding a master:file=name option:
[po4a_langs] de fr ja [po4a_paths] l10n/po/$master.pot $lang:l10n/po/$master.$lang.po [type: xml] foo/gui.xml $lang:foo/gui.$lang.xml master:file=foo-gui [type: xml] bar/gui.xml $lang:bar/gui.$lang.xml master:file=bar-gui
<B>-kB>, <B>--keepB> Minimal threshold for translation percentage to keep (i.e. write) the resulting file (default: 80). I.e. by default, files have to be translated at at least 80% to get written. <B>-hB>, <B>--helpB> Show a short help message. <B>-MB>, <B>--master-charsetB> Charset of the files containing the documents to translate. Note that all master documents must use the same charset for now. This is a known limitation, and we are working on solving this. <B>-LB>, <B>--localized-charsetB> Charset of the files containing the localized documents. Note that all translated documents will use the same charset for now. This is a known limitation, and we are working on solving this. <B>-AB>, <B>--addendum-charsetB> Charset of the addenda. Note that all the addenda should be in the same charset. <B>-VB>, <B>--versionB> Display the version of the script and exit. <B>-vB>, <B>--verboseB> Increase the verbosity of the program. <B>-qB>, <B>--quietB> Decrease the verbosity of the program. <B>-dB>, <B>--debugB> Output some debugging information. <B>-oB>, <B>--optionB> Extra option(s) to pass to the format plugin. Specify each option in the name<B>=B>value format. See the documentation of each plugin for more information about the valid options and their meanings. <B>-fB>, <B>--forceB> Always generate the POT and PO files, even if <B>po4aB> considers it is not necessary.
If the POT file already exists, it is regenerated if a master document or the configuration file is more recent. The POT file is also written in a temporary document and <B>po4aB> verifies that the changes are really needed.
Also, a translation is regenerated only if its master document, the PO file, one of its addenda or the configuration file is more recent. To avoid trying to regenerate translations which do not pass the threshold test (see <B>--keepB>), a file with the .po4a-stamp extension can be created (see <B>--stampB>).
<B>--stampB> Tells <B>po4aB> to create stamp files when a translation is not generated because it does not reach the threshold. These stamp files are named according to the expected translated document, with the .po4a-stamp extension.
Note: This only activates the creation of the .po4a-stamp files. The stamp files are always used if they exist, and they are removed with <B>--rm-translationsB> or when the file is finally translated.
<B>--no-translationsB> Do not generate the translated documents, only update the POT and PO files. <B>--rm-translationsB> Remove the translated files (implies <B>--no-translationsB>). <B>--no-backupsB> This flag does nothing since 0.41, and may be removed in later releases. <B>--rm-backupsB> This flag does nothing since 0.41, and may be removed in later releases. <B>--translate-onlyB> translated-file Translate only the specified file. It may be useful to speed up processing if a configuration file contains a lot of files. Note that this option does not update PO and POT files. This option can be used multiple times. <B>--variableB> var<B>=B>value Define a variable that will be expanded in the <B>po4aB> configuration file. Every occurrence of $(var) will be replaced by value. This option can be used multiple times. <B>--srcdirB> SRCDIR Set the base directory for all input documents specified in the <B>po4aB> configuration file. <B>--destdirB> DESTDIR Set the base directory for all the output documents specified in the <B>po4aB> configuration file.
<B>porefsB> type[,<B>wrapB>|<B>nowrapB>] Specify the reference format. Argument type can be one of <B>noneB> to not produce any reference, <B>nolineB> to not specify the line number (more accurately all line numbers are replaced by 1), <B>counterB> to replace line number by an increasing counter, and <B>fullB> to include complete references.
Argument can be followed by a comma and either <B>wrapB> or <B>nowrapB> keyword. References are written by default on a single line. The <B>wrapB> option wraps references on several lines, to mimic <B>gettextB> tools (<B>xgettextB> and <B>msgmergeB>). This option will become the default in a future release, because it is more sensible. The <B>nowrapB> option is available so that users who want to keep the old behavior can do so.
<B>--msgid-bugs-addressB> email@address Set the report address for msgid bugs. By default, the created POT files have no Report-Msgid-Bugs-To fields. <B>--copyright-holderB> string Set the copyright holder in the POT header. The default value is Free Software Foundation, Inc. <B>--package-nameB> string Set the package name for the POT header. The default is PACKAGE. <B>--package-versionB> string Set the package version for the POT header. The default is VERSION.
<B>--msgmerge-optB> options Extra options for <B>msgmergeB>. <B>--no-previousB> This option removes <B>--previousB> from the options passed to <B>msgmergeB>. This permits to support versions of <B>gettextB> earlier than 0.16. <B>--previousB> This option adds <B>--previousB> to the options passed to <B>msgmergeB>. It requires <B>gettextB> 0.16 or later, and is activated by default.
Lets assume you maintain a program named <B>fooB> which has a man page man/foo.1 which naturally is maintained in English only. Now you as the upstream or downstream maintainer want to create and maintain the translation. First you need to create the POT file necessary to send to translators using po4a-gettextize(1).
So for our case we would call
cd man && po4a-gettextize -f man -m foo.1 -p foo.pot
You would then send this file to the appropriate language lists or offer it for download somewhere on your website.
Now lets assume you received three translations before your next release: de.po (including an addendum de.add), sv.po and pt.po. Since you dont want to change your Makefile(s) whenever a new translation arrives you can use <B>po4aB> with an appropriate configuration file in your Makefile. Lets call it po4a.cfg. In our example it would look like the following:
[po_directory] man/po4a/po/ [type: man] man/foo.1 $lang:man/translated/$lang/foo.1 \ add_$lang:?man/po4a/add_$lang/$lang.add opt:"-k 80"
In this example we assume that your generated man pages (and all PO and addenda files) should be stored in man/translated/$lang/ (respectively in man/po4a/po/ and man/po4a/add_$lang/) below the current directory. In our example the man/po4a/po/ directory would include de.po, pt.po and sv.po, and the man/po4a/add_de/ directory would include de.add.
Once this is set up you dont need to touch the Makefile when a new translation arrives, i.e. if the French team sends you fr.po and fr.add then you simply drop them respectively in man/po4a/po/ and man/po4a/add_fr/ and the next time the programm is build the French translation is automatically build as well in man/translated/fr/.
Note that you still need an appropriate target to install localized manual pages with English ones.
po4a-build(1), po4a-gettextize(1), po4a-normalize(1), po4a-translate(1), po4a-updatepo(1), po4a-build.conf(5), po4a(7)
Denis Barbier <email@example.com> Nicolas François <firstname.lastname@example.org> Martin Quinson (mquinson#debian.org)
Copyright 2002-2012 by SPI, inc.
This program is free software; you may redistribute it and/or modify it under the terms of GPL (see the COPYING file).
|Po4a Tools||PO4A (1p)||2016-04-03|