1Locale::Po4a::Common(3pm) Po4a Tools Locale::Po4a::Common(3pm)
2
3
4
6 Locale::Po4a::Common - common parts of the po4a scripts and utils
7
9 Locale::Po4a::Common contains common parts of the po4a scripts and some
10 useful functions used along the other modules.
11
12 In order to use Locale::Po4a programatically, one may want to disable
13 the use of Text::WrapI18N, by writing something like:
14
15 use Locale::Po4a::Common qw(nowrapi18n);
16 use Locale::Po4a::Text;
17
18 instead of:
19
20 use Locale::Po4a::Text;
21
22 Ordering is important here: as most Locale::Po4a modules themselves
23 load Locale::Po4a::Common, the first time this module is loaded
24 determines whether Text::WrapI18N is used.
25
27 Showing output messages
28 · show_version($)
29
30 Shows the current version of the script, and a short copyright
31 message. It takes the name of the script as an argument.
32
33 · wrap_msg($@)
34
35 This function displays a message the same way as sprintf() does,
36 but wraps the result so that they look nice on the terminal.
37
38 · wrap_mod($$@)
39
40 This function works like wrap_msg(), but it takes a module name as
41 the first argument, and leaves a space at the left of the message.
42
43 · wrap_ref_mod($$$@)
44
45 This function works like wrap_msg(), but it takes a file:line
46 reference as the first argument, a module name as the second one,
47 and leaves a space at the left of the message.
48
49 Wrappers for other modules
50 · Locale::Gettext
51
52 When the Locale::Gettext module cannot be loaded, this module
53 provide dummy (empty) implementation of the following functions. In
54 that case, po4a messages won't get translated but the program will
55 continue to work.
56
57 If Locale::gettext is present, this wrapper also calls
58 setlocale(LC_MESSAGES, "") so callers don't depend on the POSIX
59 module either.
60
61 · bindtextdomain($$)
62
63 · textdomain($)
64
65 · gettext($)
66
67 · dgettext($$)
68
70 Jordi Vilalta <jvprat@gmail.com>
71
73 Copyright © 2005 SPI, Inc.
74
75 This program is free software; you may redistribute it and/or modify it
76 under the terms of GPL (see the COPYING file).
77
78
79
80Po4a Tools 2019-10-26 Locale::Po4a::Common(3pm)