[prev in list] [next in list] [prev in thread] [next in thread]
List: pear-doc
Subject: [PEAR-DOC] cvs: peardoc /en/package/http/http negotiatelanguage.xml
From: "Martin Jansen" <mj () php ! net>
Date: 2003-11-25 21:59:15
[Download RAW message or body]
mj Tue Nov 25 16:59:15 2003 EDT
Modified files:
/peardoc/en/package/http/http negotiatelanguage.xml
Log:
* Another example
Index: peardoc/en/package/http/http/negotiatelanguage.xml
diff -u peardoc/en/package/http/http/negotiatelanguage.xml:1.4 \
peardoc/en/package/http/http/negotiatelanguage.xml:1.5
--- peardoc/en/package/http/http/negotiatelanguage.xml:1.4 Wed Aug 13 12:01:04 2003
+++ peardoc/en/package/http/http/negotiatelanguage.xml Tue Nov 25 16:59:14 2003
@@ -1,4 +1,4 @@
-<!-- $Revision: 1.4 $ -->
+<!-- $Revision: 1.5 $ -->
<refentry id="package.http.http.negotiatelanguage">
<refnamediv>
<refname>HTTP::negotiateLanguage</refname>
@@ -36,6 +36,36 @@
</programlisting>
</para>
</refsect1>
+ <refsect1 id="package.http.http.negotiatelanguage.example">
+ &title.example;
+ <para>
+ <example>
+ <title>Usage example</title>
+ <programlisting role="php">
+require_once "HTTP.php";
+
+$supported = array("de" => true, "en-US" => true);
+
+echo HTTP::negotiateLanguage($supported);
+ </programlisting>
+ </example>
+ </para>
+ <para>
+ This example negotiates with the user agent if any of the
+ languages, which are specified in <varname>supported</varname>,
+ are supported on the user's system. If the negotiation has a
+ positive result, the language code of the most preferred language
+ is printed. Otherwise the default language code (en-US) is
+ printed.
+ </para>
+ <para>
+ Being able to perform language negotiation is a big help when
+ developing internationalized website with pages, that are available
+ in more than one language. Using negotiation, the user will always
+ get pages in the language which he prefers. (Assuming that their
+ user agent is configured properly.)
+ </para>
+ </refsect1>
<refsect1 id="package.http.http.negotiatelanguage.parameter">
&title.param;
<para>
--
PEAR Documentation List Mailing List (http://pear.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic