| 1 | package Locale::TextDomain::OO::Plugin::Expand::BabelFish::Loc; ## no critic (TidyCode) | ||||||||||||||||||
| 2 | |||||||||||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 5 | 2 | ▶ | use Locale::Utils::PlaceholderBabelFish; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 6 | 2 | ▶ | use Moo::Role; | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 7 | |||||||||||||||||||
| 8 | 2 | our $VERSION = '1.027'; | |||||||||||||||||
| 9 | |||||||||||||||||||
| 10 | 2 | requires qw( | |||||||||||||||||
| 11 | translate | ||||||||||||||||||
| 12 | filter | ||||||||||||||||||
| 13 | run_filter | ||||||||||||||||||
| 14 | ); | ||||||||||||||||||
| 15 | |||||||||||||||||||
| 16 | has expand_babel_fish_loc => ( | ||||||||||||||||||
| 17 | is => 'rw', | ||||||||||||||||||
| 18 | 1 | ▶ | default => sub { | ||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 19 | 1 | return Locale::Utils::PlaceholderBabelFish->new; | |||||||||||||||||
| 20 | }, | ||||||||||||||||||
| 21 | 2 | ); | |||||||||||||||||
| 22 | |||||||||||||||||||
| 23 | 4 | ▶ | sub loc_b { | ||||||||||||||||
|
Subroutine
loc_b: called CC=5 SCAR=16.2
Pod
documented
| |||||||||||||||||||
| 24 | 4 | my ($self, $msgid, @args) = @_; | |||||||||||||||||
| 25 | |||||||||||||||||||
| 26 | my $translation = $self->translate( | ||||||||||||||||||
| 27 | undef, | ||||||||||||||||||
| 28 | $msgid, | ||||||||||||||||||
| 29 | undef, | ||||||||||||||||||
| 30 | undef, | ||||||||||||||||||
| 31 | undef, | ||||||||||||||||||
| 32 | 4 | ▶ | sub { $self->expand_babel_fish_loc->plural_code(shift) }, | ||||||||||||||||
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 33 | 4 | ); | |||||||||||||||||
| 34 | @args and $translation = $self->expand_babel_fish_loc->expand_babel_fish( | ||||||||||||||||||
| 35 | $translation, | ||||||||||||||||||
| 36 | @args == 1 | ||||||||||||||||||
| 37 | 4 | ▶ | ? ( ref $args[0] eq 'HASH' ? %{ $args[0] } : $args[0] ) | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 38 | : @args, | ||||||||||||||||||
| 39 | ); | ||||||||||||||||||
| 40 | 4 | ▶ | $self->filter | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 41 | and $self->run_filter(\$translation); | ||||||||||||||||||
| 42 | |||||||||||||||||||
| 43 | 4 | return $translation; | |||||||||||||||||
| 44 | } | ||||||||||||||||||
| 45 | |||||||||||||||||||
| 46 | 0 | ▶ | sub loc_bp { | ||||||||||||||||
|
Subroutine
loc_bp: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||||||||
| 47 | 0 | my ($self, $msgctxt, $msgid, @args) = @_; | |||||||||||||||||
| 48 | |||||||||||||||||||
| 49 | my $translation = $self->translate( | ||||||||||||||||||
| 50 | $msgctxt, | ||||||||||||||||||
| 51 | $msgid, | ||||||||||||||||||
| 52 | undef, | ||||||||||||||||||
| 53 | undef, | ||||||||||||||||||
| 54 | undef, | ||||||||||||||||||
| 55 | 0 | ▶ | sub { $self->expand_babel_fish_loc->plural_code(shift) }, | ||||||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||||||
| 56 | 0 | ); | |||||||||||||||||
| 57 | @args and $translation = $self->expand_babel_fish_loc->expand_babel_fish( | ||||||||||||||||||
| 58 | $translation, | ||||||||||||||||||
| 59 | @args == 1 | ||||||||||||||||||
| 60 | 0 | ▶ | ? ( ref $args[0] eq 'HASH' ? %{ $args[0] } : $args[0] ) | ||||||||||||||||
|
Branch: 3 branches
| |||||||||||||||||||
| 61 | : @args, | ||||||||||||||||||
| 62 | ); | ||||||||||||||||||
| 63 | 0 | ▶ | $self->filter | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 64 | and $self->run_filter(\$translation); | ||||||||||||||||||
| 65 | |||||||||||||||||||
| 66 | 0 | return $translation; | |||||||||||||||||
| 67 | } | ||||||||||||||||||
| 68 | |||||||||||||||||||
| 69 | 2 | ▶ | BEGIN { | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.6
| |||||||||||||||||||
| 70 | # Dummy methods for string marking. | ||||||||||||||||||
| 71 | 0 | ▶ | my $dummy = sub { | ||||||||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||||||||
| 72 | 0 | my (undef, @more) = @_; | |||||||||||||||||
| 73 | 0 | ▶ | return wantarray ? @more : $more[0]; | ||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||
| 74 | 2 | }; | |||||||||||||||||
| 75 | 2 | ▶ | no warnings qw(redefine); ## no critic (NoWarnings) | ||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||
| 76 | 2 | *Nloc_b = $dummy; | |||||||||||||||||
| 77 | 2 | *Nloc_bp = $dummy; | |||||||||||||||||
| 78 | } | ||||||||||||||||||
| 79 | |||||||||||||||||||
| 80 | 2 | 1; | |||||||||||||||||
| 81 | |||||||||||||||||||
| 82 | __END__ | ||||||||||||||||||