Locale::Maketext::Extract::Plugin::YAML(3pm)

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 folded
         string
         to 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 block
         string
         to translate
         '
Note, you must use the trailing C<-> so that YAMl doesn't add a carriage
return 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.

Releases

9 releases since Debian 6.0 (Squeeze); the text changed 5 times.

  1. 6.0
  2. 7
  3. 8–10
  4. 11
  5. 12–13
  6. Arch

Authors

Clinton Gormley <[email protected]>

Authors

•

Clinton Gormley <[email protected]>

•

Audrey Tang <[email protected]>

From perl-locale-maketext-lexicon 1.00-5 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.