HTTP::...anguage(3pm)
π HTTP::Headers::ActionPack::AcceptLanguage π
okay so bestie, this page lives in the User Contributed Perl Documentation collection, and it's giving very specific and very useful. it's HTTP::Headers::ActionPack::AcceptLanguage and no, it's not the same thing as AcceptLanguageList even though the synopsis is gonna make you squint, we'll get there, breathe π«Ά
β¨ NAME β¨
HTTP::Headers::ActionPack::AcceptLanguage β A Priority List customized for Media Types π
πΈ VERSION πΈ
version 0.09 β¨
π¦ SYNOPSIS π¦
use HTTP::Headers::ActionPack::AcceptLanguage;
# normal constructor
my $list = HTTP::Headers::ActionPack::AcceptLanguage->new(
[ 1.0 => 'en-US' ],
[ 0.7 => 'en-GB' ],
);
# or from a string
my $list = HTTP::Headers::ActionPack::AcceptLanguageList->new_from_string(
'en-US; q=1.0, en-GB; q=0.7'
);
like. look at her. two whole ways to build the thing and she ate both times π
π DESCRIPTION π
so this class is a subclass of the HTTP::Headers::ActionPack::PriorityList class, except it comes with some language specific features layered on top. same energy as the parent, but multilingual, multilingual-ing, she's fluent π
π METHODS π
canonicalize_choiceβ you hand her a string that's holding a locale code, and she hands you back the canonical version of that code. so cute, so tidy.
but listen β this one is incomplete, fr fr. all it does is lowercase the language piece (en,zh) and uppercase the country (US,TW). that's it. that's the whole trick. it does not even attempt to canonicalize scripts or variants inside the locale code. so don't come at her expecting script-canonicalizing behavior, she never claimed that π
π AUTHOR π
Stevan Little <stevan.little@iinteractive.com> π
π CONTRIBUTORS π
- Andrew Nelson
<anelson@cpan.org> - Dave Rolsky
<autarch@urth.org> - Florian Ragwitz
<rafl@debian.org> - Jesse Luehrs
<doy@tozt.net> - Karen Etheridge
<ether@cpan.org>
look at this group chat. iconic roster, no notes, everyone showed up π
β COPYRIGHT AND LICENSE β
This software is copyright (c) 2012 by Infinity Interactive, Inc.. π
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. β¨
and that's the whole page bestie π«Ά this one's running on perl v5.34.0, dated 2022-06-14, and it's filed under the very same HTTP::...anguage(3pm) title we started with β go forth and canonicalize responsibly, mwah π
π¦ where this page comes from
- debian bookworm: libhttp-headers-actionpack-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhttp-headers-actionpack-perl 0.09-2 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms