Install Perl 5.8.8
[msysgit.git] / mingw / html / lib / I18N / LangTags / Detect.html
blobd12d8e554c2c70f0ce953b74810e0226120e5f73
1 <?xml version="1.0" ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5 <title>I18N::LangTags::Detect - detect the user's language preferences</title>
6 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
7 <link rev="made" href="mailto:" />
8 </head>
10 <body style="background-color: white">
11 <table border="0" width="100%" cellspacing="0" cellpadding="3">
12 <tr><td class="block" style="background-color: #cccccc" valign="middle">
13 <big><strong><span class="block">&nbsp;I18N::LangTags::Detect - detect the user's language preferences</span></strong></big>
14 </td></tr>
15 </table>
17 <p><a name="__index__"></a></p>
18 <!-- INDEX BEGIN -->
20 <ul>
22 <li><a href="#name">NAME</a></li>
23 <li><a href="#synopsis">SYNOPSIS</a></li>
24 <li><a href="#description">DESCRIPTION</a></li>
25 <li><a href="#functions">FUNCTIONS</a></li>
26 <li><a href="#environment">ENVIRONMENT</a></li>
27 <li><a href="#see_also">SEE ALSO</a></li>
28 <li><a href="#copyright">COPYRIGHT</a></li>
29 <li><a href="#author">AUTHOR</a></li>
30 </ul>
31 <!-- INDEX END -->
33 <hr />
34 <p>
35 </p>
36 <h1><a name="name">NAME</a></h1>
37 <p>I18N::LangTags::Detect - detect the user's language preferences</p>
38 <p>
39 </p>
40 <hr />
41 <h1><a name="synopsis">SYNOPSIS</a></h1>
42 <pre>
43 use I18N::LangTags::Detect;
44 my @user_wants = I18N::LangTags::Detect::detect();</pre>
45 <p>
46 </p>
47 <hr />
48 <h1><a name="description">DESCRIPTION</a></h1>
49 <p>It is a common problem to want to detect what <code>language(s)</code> the user would
50 prefer output in.</p>
51 <p>
52 </p>
53 <hr />
54 <h1><a name="functions">FUNCTIONS</a></h1>
55 <p>This module defines one public function,
56 <code>I18N::LangTags::Detect::detect()</code>. This function is not exported
57 (nor is even exportable), and it takes no parameters.</p>
58 <p>In scalar context, the function returns the most preferred language
59 tag (or undef if no preference was seen).</p>
60 <p>In list context (which is usually what you want),
61 the function returns a
62 (possibly empty) list of language tags representing (best first) what
63 languages the user apparently would accept output in. You will
64 probably want to pass the output of this through
65 <code>I18N::LangTags::implicate_supers_tightly(...)</code>
67 <code>I18N::LangTags::implicate_supers(...)</code>, like so:</p>
68 <pre>
69 my @languages =
70 I18N::LangTags::implicate_supers_tightly(
71 I18N::LangTags::Detect::detect()
72 );</pre>
73 <p>
74 </p>
75 <hr />
76 <h1><a name="environment">ENVIRONMENT</a></h1>
77 <p>This module looks for several environment variables, including
78 REQUEST_METHOD, HTTP_ACCEPT_LANGUAGE,
79 LANGUAGE, LC_ALL, LC_MESSAGES, and LANG.</p>
80 <p>It will also use the <a href="file://C|\msysgit\mingw\html/Win32/Locale.html">the Win32::Locale manpage</a> module, if it's installed.</p>
81 <p>
82 </p>
83 <hr />
84 <h1><a name="see_also">SEE ALSO</a></h1>
85 <p><a href="file://C|\msysgit\mingw\html/lib/I18N/LangTags.html">the I18N::LangTags manpage</a>, <a href="file://C|\msysgit\mingw\html/Win32/Locale.html">the Win32::Locale manpage</a>, <a href="file://C|\msysgit\mingw\html/lib/Locale/Maketext.html">the Locale::Maketext manpage</a>.</p>
86 <p>(This module's core code started out as a routine in Locale::Maketext;
87 but I moved it here once I realized it was more generally useful.)</p>
88 <p>
89 </p>
90 <hr />
91 <h1><a name="copyright">COPYRIGHT</a></h1>
92 <p>Copyright (c) 1998-2004 Sean M. Burke. All rights reserved.</p>
93 <p>This library is free software; you can redistribute it and/or
94 modify it under the same terms as Perl itself.</p>
95 <p>The programs and documentation in this dist are distributed in
96 the hope that they will be useful, but without any warranty; without
97 even the implied warranty of merchantability or fitness for a
98 particular purpose.</p>
99 <p>
100 </p>
101 <hr />
102 <h1><a name="author">AUTHOR</a></h1>
103 <p>Sean M. Burke <code>sburke@cpan.org</code></p>
104 <table border="0" width="100%" cellspacing="0" cellpadding="3">
105 <tr><td class="block" style="background-color: #cccccc" valign="middle">
106 <big><strong><span class="block">&nbsp;I18N::LangTags::Detect - detect the user's language preferences</span></strong></big>
107 </td></tr>
108 </table>
110 </body>
112 </html>