Debian Codegraph @

bin/xgettext-txt

raw
1 #! /usr/bin/env perl
2
3 # Copyright (C) 2016-2017 Guido Flohr <[email protected]>,
4 # all rights reserved.
5
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
10
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
15
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 use strict;
20
21 use Getopt::Long;
22 use Locale::Messages qw(setlocale LC_MESSAGES);
23 use Locale::TextDomain qw('Locale-XGettext');
24
25 use Locale::XGettext::Text;
26
27 Locale::Messages::setlocale(LC_MESSAGES, "");
28
29 Locale::XGettext::Text->newFromArgv(\@ARGV)->run->output;
30
31 =head1 NAME
32
33 xgettext-txt - Create PO files from text files
34
35 =head1 USAGE
36
37 xgettext-txt [OPTIONS] TEXTFILE[, TEXTFILE]
38 xgettext-txt [OPTIONS] --files-from="filelist"
39 xgettext-txt --help
40
41 =head1 DESCRIPTION
42
43 Reads one or more text files and turns every paragraph into a
44 translatable string in a PO, resp. .pot file.
45
46 See the
47 L<online documentation for Locale::XGettext|http://search.cpan.org/~guido/Locale-XGettext/lib/Locale/XGettext.pm>
48 or the command output "perldoc Locale::XGettext" for a complete list
49 of options.
50
51 =head1 BUGS
52
53 It should be possible to specify alternative delimiters and not just
54 paragraphs.
55
56 =head1 AUTHOR
57
58 Written by Guido Flohr (http://www.guido-flohr.net/).
59
60 =head1 COPYRIGHT
61
62 Copyright (C) 2016-2017 Guido Flohr (http://www.guido-flohr.net/).
63 License LGPLv1.1+: L<GNU General Public License version 2.1 or later|http://gnu.org/licenses/lgpl.html>
64 This is free software: you are free to change and redistribute it.
65 There is NO WARRANTY, to the extent permitted by law.
66
67 =head1 SEE ALSO
68
69 L<Locale::XGettext>, L<perl>, L<xgettext(1)>