Locale...Keyword(3pm)
π¦ NAME π¦
Locale::XGettext::Util::Keyword β a Keyword used by xgettext, bestie π
β¨ SYNOPSIS β¨
use Locale::XGettext::Util::Keyword;
$keyword = Locale::XGettext::Keyword->new('npcgettext',
'1c', 2, 3,
'"Plural form"');
$keyword = Locale::XGettext::Keyword->newFromString('npcgettext:1c,2,3,"Plural form"');
Flags are not yet supported. π ik ik, we're waiting on it too.
π DESCRIPTION π
Okay so this module wraps up a keyword specification for xgettext-style string extractors. It's giving "very specific niche tool", and honestly? It only really matters if you're an author of extractors built on top of Locale::XGettext. Everyone else can keep scrolling, no cap. π«Ά
π CONSTRUCTORS π
new FUNCTION[, ARGSPEC ...]
Spawns a brand new keyword for the function FUNCTION β¨ If you don't hand it an ARGSPEC, it just assumes the singular form is living in the first argument. Simple. Iconic.
ARGSPEC can be one of these lil guys:
Nβ an integer N greater than 0. The first one you hit sets the position of the singular form, and the second one sets the position of the plural form. Two for one, we love a multitasker πNcβ an integer N greater than 0, followed by the character"c". That N is the position of the message context argument. the c stands for context, iykyk π§"COMMENT"β every PO entry for this keyword gets the automatic comment COMMENT. > β οΈ Heads up bestie: the surrounding"double quotes"are required! Not optional, not negotiable. π
newFromString COMMAND_LINE_ARG
COMMAND_LINE_ARG has the exact same semantics as the argument you'd pass to --keyword of xgettext(1). Same energy, different entry point π
πΈ METHODS πΈ
functionβ get the function name of the keyword. The whole identity, fr fr πsingularβ get the position of the argument for the singular form. one (1) thing. that's it. πpluralβ get the position of the argument for the plural form, or0if there is no plural form. Zero means nope, no plural here πcontextβ get the position of the argument for the plural form, or0if there is no plural form.
π bestie i am literally just reading the page to you. yes, it says plural form here too. i don't make the rules, i just deliver them with love. π
commentβ the automatic comment for this keyword, or the undefined value. mystery box behavior β¨dumpβ dump the keyword definition into a string suitable for an argument to the xgettext option'--keyword'. it's giving "turn this object back into a lil text blob" π
π COPYRIGHT π
Copyright (C) 2016-2017 Guido Flohr <guido.flohr@cantanea.com>, all rights reserved. π«Ά
π SEE ALSO π
Locale::XGettextxgettext(1)perl(1)
go read those too, they're the main characters of this little universe β
and that's the whole page bestie!! this was perl v5.36.0, dated 2023-02-05, and it's the Locale...Keyword(3pm) page from the User Contributed Perl Documentation. slay, mwah πβ¨π
π¦ where this page comes from
- debian bookworm: liblocale-xgettext-perl 0.7-2 Β· LGPL-3.0-or-later
- debian trixie: liblocale-xgettext-perl 0.7-2 Β· LGPL-3.0-or-later
- ubuntu noble: liblocale-xgettext-perl 0.7-2 Β· LGPL-3.0-or-later
- ubuntu resolute: liblocale-xgettext-perl 0.7-2 Β· LGPL-3.0-or-later
- ubuntu stonking: liblocale-xgettext-perl 0.7-2 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms