I18N::LangTags::Detect - detect the user's language prefer- ences
use I18N::LangTags::Detect; my @user_wants = I18N::LangTags::Detect::detect();
It is a common problem to want to detect what language(s) the user would prefer output in.
This module defines one public function, "I18N::LangTags::Detect::detect()". This function is not exported (nor is even exportable), and it takes no parame- ters. In scalar context, the function returns the most preferred language tag (or undef if no preference was seen). In list context (which is usually what you want), the func- tion returns a (possibly empty) list of language tags representing (best first) what languages the user apparently would accept output in. You will probably want to pass the output of this through "I18N::LangTags::implicate_supers_tightly(...)" or "I18N::LangTags::implicate_supers(...)", like so: my @languages = I18N::LangTags::implicate_supers_tightly( I18N::LangTags::Detect::detect() );
This module looks for several environment variables, includ- ing REQUEST_METHOD, HTTP_ACCEPT_LANGUAGE, LANGUAGE, LC_ALL, LC_MESSAGES, and LANG. It will also use the Win32::Locale module, if it's installed.
I18N::LangTags, Win32::Locale, Locale::Maketext. (This module's core code started out as a routine in Locale::Maketext; but I moved it here once I realized it was more generally useful.)
Copyright (c) 1998-2004 Sean M. Burke. All rights reserved. perl v5.8.8 2005-02-05 1 I18N::LangTags::DPerltProgrammers ReferI18N::LangTags::Detect(3p) This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The programs and documentation in this dist are distributed in the hope that they will be useful, but without any war- ranty; without even the implied warranty of merchantability or fitness for a particular purpose.
Sean M. Burke "email@example.com" perl v5.8.8 2005-02-05 2
Generated on 2013-10-31 22:57:03 by $MirOS: src/scripts/roff2htm,v 1.77 2013/01/01 20:49:09 tg Exp $
These manual pages and other documentation are copyrighted by their respective writers;
their source is available at our CVSweb,
AnonCVS, and other mirrors. The rest is Copyright © 2002‒2013 The MirOS Project, Germany.
This product includes material provided by Thorsten Glaser.
This manual page’s HTML representation is supposed to be valid XHTML/1.1; if not, please send a bug report – diffs preferred.