2
2
eval 'exec perl -S $0 ${1+"$@"}'
3
3
if $running_under_some_shell;
5
# pod-updatepo -- Update the po translation of POD data.
5
# pod-updatepo -- update the PO translation of POD data.
7
7
# Copyright 2002-2010 by SPI, inc.
26
The po4a (po for anything) project goal is to ease translations (and more
26
The po4a (PO for anything) project goal is to ease translations (and more
27
27
interestingly, the maintenance of translations) using gettext tools on
28
28
areas where they were not expected like documentation.
30
The C<po4a-updatepo> script is in charge of updating po files to make
30
The C<po4a-updatepo> script is in charge of updating PO files to make
31
31
them reflect the changes made to the original documentation file. For that,
32
it converts the documentation file to a pot file, and call L<msgmerge(1)>
33
on this new pot and on the provided po files.
32
it converts the documentation file to a POT file, and call L<msgmerge(1)>
33
on this new POT and on the provided PO files.
35
It is possible to give more than one po file (if you want to update several
35
It is possible to give more than one PO file (if you want to update several
36
36
languages at once), and several documentation files (if you want to store
37
the translations of several documents in the same po file).
37
the translations of several documents in the same PO file).
39
If the master document has non-ascii characters, it will convert the po files
40
to utf-8 (if they weren't already), in order to allow non-standard characters
39
If the master document has non-ASCII characters, it will convert the PO files
40
to UTF-8 (if they weren't already), in order to allow non-standard characters
41
41
in a culture independent way.
43
=head1 COMMAND-LINE OPTIONS
226
226
my ($doc)=Locale::Po4a::Chooser::new($format,%options);
228
228
map { -e $_ || die wrap_msg(gettext("File %s does not exist."), $_) } @masterfiles;
229
map { die wrap_msg(gettext("po4a-updatepo can't take the input po from stdin."))
229
map { die wrap_msg(gettext("po4a-updatepo can't take the input PO from stdin."))
230
230
if $_ eq '-' && !-e '-'} @pofiles;
232
232
my ($pot_filename);
235
235
SUFFIX => ".pot",
238
or die wrap_msg(gettext("Can't create a temporary pot file: %s"), $!);
238
or die wrap_msg(gettext("Can't create a temporary POT file: %s"), $!);
241
241
print STDERR wrap_msg(gettext("Parse input files... ")) if $verbose;
264
264
print STDERR wrap_msg(gettext("Creating %s:"), $po_filename)
266
266
system ("cp",$pot_filename,$po_filename) == 0
267
or die wrap_msg(gettext("Error while copying the po file: %s"), $!);
267
or die wrap_msg(gettext("Error while copying the PO file: %s"), $!);