line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package MooX::Locale::Passthrough; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
36203
|
use strict; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
78
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings FATAL => 'all'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
98
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.001"; |
7
|
|
|
|
|
|
|
|
8
|
2
|
|
|
2
|
|
13
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
121
|
|
9
|
|
|
|
|
|
|
|
10
|
2
|
|
|
2
|
|
389
|
use Moo::Role; |
|
2
|
|
|
|
|
6820
|
|
|
2
|
|
|
|
|
12
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=head1 NAME |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
MooX::Locale::Passthrough - provide API used in translator modules without translating |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
=head1 SYNOPSIS |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
{ package WonderBar; |
19
|
|
|
|
|
|
|
use Moo; |
20
|
|
|
|
|
|
|
with "MooX::Locale::Passthrough"; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
sub tell_me { my $self = shift; $self->__("Hello world"); } |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
WonderBar->new->tell_me; |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=head1 DESCRIPTION |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
C is made to allow CPAN modules use translator API |
30
|
|
|
|
|
|
|
without adding heavy dependencies (external software) or requirements (operating |
31
|
|
|
|
|
|
|
resulting solution). |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
This software is released together with L, which |
34
|
|
|
|
|
|
|
allowes then to plugin any desired translation. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
=head1 METHODS |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
=head2 __ MSGID |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
returns MSGID |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
## no critic (Subroutines::RequireArgUnpacking) |
45
|
1
|
|
|
1
|
|
10962
|
sub __ { $_[1] } |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 __n MSGID, MSGID_PLURAL, COUNT |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
returns MSGID when count is equal 1, MSGID_PLURAL otherwise |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=cut |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
sub __n |
54
|
|
|
|
|
|
|
{ |
55
|
2
|
|
|
2
|
|
6
|
my (undef, $s, $p, $v) = @_; |
56
|
2
|
100
|
66
|
|
|
17
|
defined $v and int($v) == 1 and return $s; |
57
|
1
|
|
|
|
|
7
|
$p; |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 __p MSGCTX, MSGID |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
returns MSGID |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=cut |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
sub __p |
67
|
|
|
|
|
|
|
{ |
68
|
1
|
|
|
1
|
|
4
|
my (undef, $ctx, $m) = @_; |
69
|
1
|
|
|
|
|
4
|
$m; |
70
|
|
|
|
|
|
|
} |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 AUTHOR |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
Jens Rehsack, C<< >> |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=head1 BUGS |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Please report any bugs or feature requests to |
79
|
|
|
|
|
|
|
C, or through the web interface at |
80
|
|
|
|
|
|
|
L. |
81
|
|
|
|
|
|
|
I will be notified, and then you'll automatically be notified of progress |
82
|
|
|
|
|
|
|
on your bug as I make changes. |
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
=head1 SUPPORT |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
You can find documentation for this module with the perldoc command. |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
perldoc MooX::Locale::Passthrough |
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
You can also look for information at: |
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=over 4 |
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=item * RT: CPAN's request tracker |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
L |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
L |
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
=item * CPAN Ratings |
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
L |
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
=item * Search CPAN |
107
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
L |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=back |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
=head1 LICENSE AND COPYRIGHT |
113
|
|
|
|
|
|
|
|
114
|
|
|
|
|
|
|
Copyright 2017 Jens Rehsack. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it |
117
|
|
|
|
|
|
|
under the terms of either: the GNU General Public License as published |
118
|
|
|
|
|
|
|
by the Free Software Foundation; or the Artistic License. |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
See http://dev.perl.org/licenses/ for more information. |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=cut |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
1; |