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 🌟

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