Locale:...in::YAML(3)
πΈ NAME πΈ
Locale::Maketext::Extract::Plugin::YAML β YAML format parser, straight from the User Contributed Perl Documentation, bestie π
π¦ VERSION π¦
version 1.00 β¨
β¨ SYNOPSIS β¨
$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);
π DESCRIPTION π
Extracts strings to localise from YAML files. Thatβs the whole vibe π«Ά
π SHORT PLUGIN NAME π
yaml β iconic, short, slays β¨
π VALID FORMATS π
Valid formats are, and yes bestie weβre listing every single one:
- the classic double-quote moment:
key: _"string"
- single quotes, also valid, also cute:
key: _'string'
- embedded quotes? she contains multitudes:
key: _'string with embedded 'quotes''
- folded string energy:
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. lineup matters, bestie π
- block string with the trailing dash:
key: |-
_'my block
string
to translate
'
Note, you must use the trailing-(the original text literally saysC<->, bestie) so that YAMl doesnβt add a carriage return after your final quote. yes, YAMl, thatβs not a typo from me π
ποΈ KNOWN FILE TYPES ποΈ
.yaml.yml.conf
π§Έ REQUIRES π§Έ
YAML β thatβs the dependency, no cap π«‘
π 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.
lowkey important: if itβs looping, do not just sit there staring at the terminal like itβs gonna fix itself π use the verbose verbose combo and check YAML first.
π SEE ALSO π
xgettext.plβ for extracting translatable strings from common template systems and perl source files.YAMLLocale::Maketext::LexiconLocale::Maketext::Extract::Plugin::BaseLocale::Maketext::Extract::Plugin::FormFuLocale::Maketext::Extract::Plugin::PerlLocale::Maketext::Extract::Plugin::TT2Locale::Maketext::Extract::Plugin::MasonLocale::Maketext::Extract::Plugin::TextTemplateLocale::Maketext::Extract::Plugin::Generic
π AUTHORS π
Clinton Gormley <clint@traveljury.com>
π COPYRIGHT π
Copyright 2002-2013 by Audrey Tang <cpan@audreyt.org>.
This software is released under the MIT license cited below.
π§ The "MIT" License π§
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
π AUTHORS π
- Clinton Gormley <drtech@cpan.org>
- Audrey Tang <cpan@audreyt.org>
π COPYRIGHT AND LICENSE π
This software is Copyright (c) 2014 by Audrey Tang.
This is free software, licensed under:
The MIT (X11) License
okay bestie, thatβs the whole page β sourced from perl v5.40.2, dated 2025-01-03, and itβs the Locale:...in::YAML(3) manpage. mwah πβ¨
π¦ where this page comes from
- alpine 3.22: perl-locale-maketext-lexicon-doc 1.00-r6 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms