Locale::Maketext::Extract::Plugin::YAML3pm
Yaml format parser
Usage
$plugin = Locale::Maketext::Extract::Plugin::YAML->new($lexicon # A Locale::Maketext::Extract object@file_types # Optionally specify a list of recognised file types)$plugin->extract($filename,$filecontents);
Version
version 1.00
Overview
Extracts strings to localise from YAML files.
Short plugin name
yaml
Valid formats
Valid formats are:
- •
-
key: _"string"
- •
-
key: _'string'
- •
-
key: _'string with embedded 'quotes''
- •
-
key: |-_'my foldedstringto translate'Note, the left hand side of the folded string must line up with the
"_", otherwise YAML adds spaces at the beginning of each line.
- •
-
key: |-_'my blockstringto translate'Note, you must use the trailing C<-> so that YAMl doesn't add a carriagereturn after your final quote.
Known file types
- .yaml
- .yml
- .conf
Requires
YAML
Notes
The docs for the YAML module describes it as alpha code. It is not as tolerant of errors as YAML::Syck. However, because it is pure Perl, it is easy to hook into.
I have seen it enter endless loops, so if xgettext.pl hangs, try running it again with "--verbose --verbose" (twice) enabled, so that you can see if the fault lies with YAML. If it does, either correct the YAML source file, or use the file_types to exclude that file.
Copyright and license
This software is Copyright (c) 2014 by Audrey Tang.
This is free software, licensed under:
The MIT (X11) License
Releases
9 releases since Debian 6.0 (Squeeze); the text changed 5 times.