| 1 | package Wikibase::Datatype::Print::Texts; | ||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 52 | ▶ | use base qw(Exporter); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 52 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 52 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 52 | ▶ | use Readonly; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | 52 | ▶ | use Unicode::UTF8 qw(decode_utf8); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 52 | Readonly::Array our @EXPORT_OK => qw(text_keys texts); | |||||||||||||||||||||||||||
| 11 | 52 | Readonly::Hash our %TEXTS => ( | |||||||||||||||||||||||||||
| 12 | 'cs' => { | ||||||||||||||||||||||||||||
| 13 | 'aliases' => 'Aliasy', | ||||||||||||||||||||||||||||
| 14 | 'data_type' => decode_utf8('Datový typ'), | ||||||||||||||||||||||||||||
| 15 | 'date_of_modification' => decode_utf8('Datum změny'), | ||||||||||||||||||||||||||||
| 16 | 'description' => 'Popis', | ||||||||||||||||||||||||||||
| 17 | 'forms' => 'Tvary', | ||||||||||||||||||||||||||||
| 18 | 'glosses' => 'Glosy', | ||||||||||||||||||||||||||||
| 19 | 'grammatical_features' => decode_utf8('Gramatické vlastnosti'), | ||||||||||||||||||||||||||||
| 20 | 'id' => 'Id', | ||||||||||||||||||||||||||||
| 21 | 'label' => decode_utf8('Štítek'), | ||||||||||||||||||||||||||||
| 22 | 'language' => 'Jazyk', | ||||||||||||||||||||||||||||
| 23 | 'last_revision_id' => decode_utf8('Id poslední revize'), | ||||||||||||||||||||||||||||
| 24 | 'lemmas' => 'Lemmy', | ||||||||||||||||||||||||||||
| 25 | 'lexical_category' => decode_utf8('Mluvnická kategorie'), | ||||||||||||||||||||||||||||
| 26 | 'ns' => 'NS', | ||||||||||||||||||||||||||||
| 27 | 'page_id' => decode_utf8('Id stránky'), | ||||||||||||||||||||||||||||
| 28 | 'rank_deprecated' => decode_utf8('zavržené'), | ||||||||||||||||||||||||||||
| 29 | 'rank_normal' => decode_utf8('normální'), | ||||||||||||||||||||||||||||
| 30 | 'rank_preferred' => decode_utf8('preferované'), | ||||||||||||||||||||||||||||
| 31 | 'references' => 'Reference', | ||||||||||||||||||||||||||||
| 32 | 'representation' => 'Reprezentace', | ||||||||||||||||||||||||||||
| 33 | 'senses' => decode_utf8('Významy'), | ||||||||||||||||||||||||||||
| 34 | 'sitelinks' => 'Odkazy', | ||||||||||||||||||||||||||||
| 35 | 'statements' => decode_utf8('Výroky'), | ||||||||||||||||||||||||||||
| 36 | 'title' => 'Titul', | ||||||||||||||||||||||||||||
| 37 | 'value_no' => 'bez hodnoty', | ||||||||||||||||||||||||||||
| 38 | 'value_unknown' => decode_utf8('neznámá hodnota'), | ||||||||||||||||||||||||||||
| 39 | }, | ||||||||||||||||||||||||||||
| 40 | 'en' => { | ||||||||||||||||||||||||||||
| 41 | 'aliases' => 'Aliases', | ||||||||||||||||||||||||||||
| 42 | 'data_type' => 'Data type', | ||||||||||||||||||||||||||||
| 43 | 'date_of_modification' => 'Date of modification', | ||||||||||||||||||||||||||||
| 44 | 'description' => 'Description', | ||||||||||||||||||||||||||||
| 45 | 'forms' => 'Forms', | ||||||||||||||||||||||||||||
| 46 | 'glosses' => 'Glosses', | ||||||||||||||||||||||||||||
| 47 | 'grammatical_features' => 'Grammatical features', | ||||||||||||||||||||||||||||
| 48 | 'id' => 'Id', | ||||||||||||||||||||||||||||
| 49 | 'label' => 'Label', | ||||||||||||||||||||||||||||
| 50 | 'language' => 'Language', | ||||||||||||||||||||||||||||
| 51 | 'last_revision_id' => 'Last revision id', | ||||||||||||||||||||||||||||
| 52 | 'lemmas' => 'Lemmas', | ||||||||||||||||||||||||||||
| 53 | 'lexical_category' => 'Lexical category', | ||||||||||||||||||||||||||||
| 54 | 'ns' => 'NS', | ||||||||||||||||||||||||||||
| 55 | 'page_id' => 'Page id', | ||||||||||||||||||||||||||||
| 56 | 'rank_deprecated' => 'deprecated', | ||||||||||||||||||||||||||||
| 57 | 'rank_normal' => 'normal', | ||||||||||||||||||||||||||||
| 58 | 'rank_preferred' => 'preferred', | ||||||||||||||||||||||||||||
| 59 | 'references' => 'References', | ||||||||||||||||||||||||||||
| 60 | 'representation' => 'Representation', | ||||||||||||||||||||||||||||
| 61 | 'senses' => 'Senses', | ||||||||||||||||||||||||||||
| 62 | 'sitelinks' => 'Sitelinks', | ||||||||||||||||||||||||||||
| 63 | 'statements' => 'Statements', | ||||||||||||||||||||||||||||
| 64 | 'title' => 'Title', | ||||||||||||||||||||||||||||
| 65 | 'value_no' => 'no value', | ||||||||||||||||||||||||||||
| 66 | 'value_unknown' => 'unknown value', | ||||||||||||||||||||||||||||
| 67 | }, | ||||||||||||||||||||||||||||
| 68 | ); | ||||||||||||||||||||||||||||
| 69 | |||||||||||||||||||||||||||||
| 70 | 52 | our $VERSION = 0.21; | |||||||||||||||||||||||||||
| 71 | |||||||||||||||||||||||||||||
| 72 | 113 | ▶ | sub text_keys { | ||||||||||||||||||||||||||
|
Subroutine
text_keys: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 73 | 113 | return sort keys %{$TEXTS{'en'}}; | |||||||||||||||||||||||||||
| 74 | } | ||||||||||||||||||||||||||||
| 75 | |||||||||||||||||||||||||||||
| 76 | 61 | ▶ | sub texts { | ||||||||||||||||||||||||||
|
Subroutine
texts: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 77 | 61 | my $lang = shift; | |||||||||||||||||||||||||||
| 78 | |||||||||||||||||||||||||||||
| 79 | 61 | ▶ | if (! defined $lang | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
defined $lang and exists $Wikibase::Datatype::Print::Texts::TEXTS{$lang}
MC/DC50%1/2
defined $lang and exists $Wikibase::Datatype::Print::Texts::TEXTS{$lang}
defined $lang
exists $Wikibase::Datatype::Print::Texts::TEXTS{$lang}
Truth table66%2/3
A and B
A= defined $langB= exists $Wikibase::Datatype::Print::Texts::TEXTS{$lang}
| |||||||||||||||||||||||||||||
| 80 | || ! exists $TEXTS{$lang}) { | ||||||||||||||||||||||||||||
| 81 | |||||||||||||||||||||||||||||
| 82 | 24 | $lang = 'en'; | |||||||||||||||||||||||||||
| 83 | } | ||||||||||||||||||||||||||||
| 84 | |||||||||||||||||||||||||||||
| 85 | 61 | return $TEXTS{$lang}; | |||||||||||||||||||||||||||
| 86 | } | ||||||||||||||||||||||||||||
| 87 | |||||||||||||||||||||||||||||
| 88 | 52 | 1; | |||||||||||||||||||||||||||