1Locale::Maketext::ExtraUcste:r:PCloungtirni:b:uYtAeLMdoLc(Pa3el)rel::DMoackuemteenxtta:t:iEoxntract::Plugin::YAML(3)
2
3
4
6 Locale::Maketext::Extract::Plugin::YAML - YAML format parser
7
9 version 1.00
10
12 $plugin = Locale::Maketext::Extract::Plugin::YAML->new(
13 $lexicon # A Locale::Maketext::Extract object
14 @file_types # Optionally specify a list of recognised file types
15 )
16
17 $plugin->extract($filename,$filecontents);
18
20 Extracts strings to localise from YAML files.
21
23 yaml
24
26 Valid formats are:
27
28 •
29
30
31 key: _"string"
32
33 •
34
35
36 key: _'string'
37
38 •
39
40
41 key: _'string with embedded 'quotes''
42
43 •
44
45
46 key: |-
47 _'my folded
48 string
49 to translate'
50
51 Note, the left hand side of the folded string must line up with the
52 "_", otherwise YAML adds spaces at the beginning of each line.
53
54 •
55
56
57 key: |-
58 _'my block
59 string
60 to translate
61 '
62 Note, you must use the trailing C<-> so that YAMl doesn't add a carriage
63 return after your final quote.
64
66 .yaml
67 .yml
68 .conf
69
71 YAML
72
74 The docs for the YAML module describes it as alpha code. It is not as
75 tolerant of errors as YAML::Syck. However, because it is pure Perl, it
76 is easy to hook into.
77
78 I have seen it enter endless loops, so if xgettext.pl hangs, try
79 running it again with "--verbose --verbose" (twice) enabled, so that
80 you can see if the fault lies with YAML. If it does, either correct
81 the YAML source file, or use the file_types to exclude that file.
82
84 xgettext.pl
85 for extracting translatable strings from common template systems
86 and perl source files.
87
88 YAML
89 Locale::Maketext::Lexicon
90 Locale::Maketext::Extract::Plugin::Base
91 Locale::Maketext::Extract::Plugin::FormFu
92 Locale::Maketext::Extract::Plugin::Perl
93 Locale::Maketext::Extract::Plugin::TT2
94 Locale::Maketext::Extract::Plugin::Mason
95 Locale::Maketext::Extract::Plugin::TextTemplate
96 Locale::Maketext::Extract::Plugin::Generic
97
99 Clinton Gormley <clint@traveljury.com>
100
102 Copyright 2002-2013 by Audrey Tang <cpan@audreyt.org>.
103
104 This software is released under the MIT license cited below.
105
106 The "MIT" License
107 Permission is hereby granted, free of charge, to any person obtaining a
108 copy of this software and associated documentation files (the
109 "Software"), to deal in the Software without restriction, including
110 without limitation the rights to use, copy, modify, merge, publish,
111 distribute, sublicense, and/or sell copies of the Software, and to
112 permit persons to whom the Software is furnished to do so, subject to
113 the following conditions:
114
115 The above copyright notice and this permission notice shall be included
116 in all copies or substantial portions of the Software.
117
118 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
119 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
120 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
121 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
122 CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
123 TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
124 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
125
127 • Clinton Gormley <drtech@cpan.org>
128
129 • Audrey Tang <cpan@audreyt.org>
130
132 This software is Copyright (c) 2014 by Audrey Tang.
133
134 This is free software, licensed under:
135
136 The MIT (X11) License
137
138
139
140perl v5.34.0 202L2o-c0a1l-e2:1:Maketext::Extract::Plugin::YAML(3)