1Locale::TextDomain::OO:U:sSeirngCloenttorni:bL:uoLtceeaxdliecP:oe:nrT(le3x)DtoDcoummaeinnt:a:tOiOo:n:Singleton::Lexicon(3)
2
3
4

NAME

6       Locale::TextDomain::OO::Singleton::Lexicon - Provides singleton lexicon
7       access
8
9       $Id: Lexicon.pm 698 2017-09-28 05:21:05Z steffenw $
10
11       $HeadURL:
12       svn+ssh://steffenw@svn.code.sf.net/p/perl-gettext-oo/code/module/trunk/lib/Locale/TextDomain/OO/Singleton/Lexicon.pm
13       $
14

VERSION

16       1.031
17

DESCRIPTION

19       This module provides the singleton lexicon access for
20       Locale::TextDomain:OO.
21

SYNOPSIS

23           use Locale::TextDomain::OO::Singleton::Lexicon;
24
25           $lexicon_data = Locale::TextDomain::OO::Singleton::Lexicon->instance->data;
26

SUBROUTINES/METHODS

28   method new
29       exists but makes no sense
30
31   method instance
32       see SYNOPSIS
33
34       exists but makes no sense
35
36   method data
37       Get back the lexicon hash reference to fill the lexicon or to read from
38       lexicon.
39
40           $lexicon_data = Locale::TextDomain::OO::Singleton::Lexicon->instance->data;
41
42   method merge_lexicon
43       Merge ist mostly used to join data of a language to create data for a
44       region with some region different data.
45
46       The example means: Take 'de::' and overwrite with specials of 'de-at::'
47       and store as 'de-at::'.
48
49           $instance->merge_lexicon('de::', 'de-at::', 'de-at::');
50
51       Maybe more clear writing:
52
53           $instance->merge_lexicon('de::', 'de-at::' => 'de-at::');
54
55   method copy_lexicon
56       Copy a lexicon is a special case.  It is like merge without the 2nd
57       parameter.
58
59           $instance->copy_lexicon('i-default::', 'i-default:LC_MESSAGES:domain');
60
61       Maybe more clear writing:
62
63           $instance->copy_lexicon('i-default::' => 'i-default:LC_MESSAGES:domain');
64
65   method move_lexicon
66       Move is typical used to move the "i-default::" lexicon into your domain
67       and category.  Using a lexicon without messages you are able to
68       translate because the header with plural forms is set.  With no lexicon
69       you would get a missing "plural forms"-error during translation.
70
71           $instance->move_lexicon('i-default::', 'i-default:LC_MESSAGES:domain');
72
73       Maybe more clear writing:
74
75           $instance->move_lexicon('i-default::' => 'i-default:LC_MESSAGES:domain');
76
77   method delete_lexicon
78       Delete a lexicon from data.
79
80           $deleted_lexicon = $instance->delete_lexicon('de::');
81
82   method logger
83       Set the logger and get back them
84
85           $lexicon_hash->logger(
86               sub {
87                   my ($message, $arg_ref) = @_;
88                   my $type = $arg_ref->{type};
89                   $log->$type($message);
90                   return;
91               },
92           );
93           $logger = $lexicon_hash->logger;
94
95       $arg_ref contains
96
97           object => $lexicon_hash, # the object itself
98           type   => 'debug',
99           event  => 'lexicon,merge', # or 'lexicon,copy'
100                                      # or 'lexicon,move'
101                                      # or 'lexicon,delete'
102

EXAMPLE

104       Inside of this distribution is a directory named example.  Run this
105       *.pl files.
106

DIAGNOSTICS

108       confess
109

CONFIGURATION AND ENVIRONMENT

111       none
112

DEPENDENCIES

114       Carp
115
116       Moo
117
118       MooX::StrictConstructor
119
120       namespace::autoclean
121
122       Locale::TextDomain::OO::Role::Logger
123
124       MooX::Singleton
125

INCOMPATIBILITIES

127       not known
128

BUGS AND LIMITATIONS

130       none
131

SEE ALSO

133       Locale::TextDoamin::OO
134

AUTHOR

136       Steffen Winkler
137
139       Copyright (c) 2013 - 2017, Steffen Winkler "<steffenw at cpan.org>".
140       All rights reserved.
141
142       This module is free software; you can redistribute it and/or modify it
143       under the same terms as Perl itself.
144
145
146
147perl v5.32.0                     L2o0c2a0l-e0:7:-T2e8xtDomain::OO::Singleton::Lexicon(3)
Impressum