Parcourir la source

[DOCUMENTATION] French: sync manual

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20080 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael il y a 16 ans
Parent
commit
9d9468e0ec

+ 1 - 1
documentation/manual/fr/module_specs/Zend_Application-AvailableResources-CacheManager.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 19883 -->
+<!-- EN-Revision: 20077 -->
 <!-- Reviewed: no -->
 <sect2 id="zend.application.available-resources.cachemanager">
     <title>Zend_Application_Resource_Cachemanager</title>

+ 149 - 0
documentation/manual/fr/module_specs/Zend_Application-AvailableResources-Locale.xml

@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- EN-Revision: 20077 -->
+<!-- Reviewed: no -->
+<sect2 id="zend.application.available-resources.locale">
+    <title>Zend_Application_Resource_Locale</title>
+
+    <para>
+        <classname>Zend_Application_Resource_Locale</classname> can be used to
+        set an application-wide locale which is then used in all classes and components
+        which work with localization or internationalization.
+    </para>
+
+    <para>
+        There are basically three usecases for the Locale Resource Plugin. Each of them
+        should be used depending on the applications need.
+    </para>
+
+    <sect3 id="zend.application.available-resources.locale.auto">
+        <title>Autodetect the locale to use</title>
+
+        <para>
+            Without specifying any options for
+            <classname>Zend_Application_Resource_Locale</classname>,
+            <classname>Zend_Locale</classname> will detect the locale, which your application will
+            use, automatically.
+        </para>
+
+        <para>
+            This detection works because your client sends the wished language within his
+            <acronym>HTTP</acronym> request. Normally the clients browser sends the languages he
+            wants to see, and <classname>Zend_Locale</classname> uses this information for
+            detection.
+        </para>
+
+        <para>
+            But there are 2 problems with this approach:
+        </para>
+
+        <itemizedlist>
+            <listitem>
+                <para>
+                    The browser could be setup to send no language
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    The user could have manually set a locale which does not exist
+                </para>
+            </listitem>
+        </itemizedlist>
+
+        <para>
+            In both cases <classname>Zend_Locale</classname> will fallback to other mechanism to
+            detect the locale:
+        </para>
+
+        <itemizedlist>
+            <listitem>
+                <para>
+                    When a locale has been set which does not exist,
+                    <classname>Zend_Locale</classname> tries to downgrade this string.
+                </para>
+
+                <para>
+                    When, for example, <emphasis>en_ZZ</emphasis> is set it will automatically
+                    be degraded to <emphasis>en</emphasis>. In this case <emphasis>en</emphasis>
+                    will be used as locale for your application.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    When the locale could also not be detected by downgrading, the locale of your
+                    environment (web server) will be used. Most available environments from
+                    Web Hosters use <emphasis>en</emphasis> as locale.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    When the systems locale could not be detected <classname>Zend_Locale</classname>
+                    will use it's default locale, which is set to <emphasis>en</emphasis> per
+                    default.
+                </para>
+            </listitem>
+        </itemizedlist>
+
+        <para>
+            For more informations about locale detection take a look into <link
+                linkend="zend.locale.selection.automatic">this chapter on Zend_Locale's automatic
+                detection</link>.
+        </para>
+    </sect3>
+
+    <sect3 id="zend.application.available-resources.locale.fallback">
+        <title>Autodetect the locale and adding a own fallback</title>
+
+        <para>
+            The above autodetection could lead to problems when the locale could not be detected and
+            you want to have another default locale than <emphasis>en</emphasis>. To prevent this,
+            <classname>Zend_Application_Resource_Locale</classname> allows you to set a own locale
+            which will be used in the case that the locale could not be detected.
+        </para>
+
+        <example id="zend.application.available-resources.locale.configExampleDetectAndFallback">
+            <title>Autodetect locale and setting a fallback</title>
+
+            <para>
+                The following snippet shows how to set a own default locale which will be used when
+                the client does not send a locale himself.
+            </para>
+
+            <programlisting language="ini"><![CDATA[
+; Try to determine automatically first,
+; if unsuccessful, use nl_NL as fallback.
+resources.locale.default = "nl_NL"
+]]></programlisting>
+        </example>
+    </sect3>
+
+    <sect3 id="zend.application.available-resources.locale.forcing">
+        <title>Forcing a specific locale to use</title>
+
+        <para>
+            Sometimes it is useful to define a single locale which has to be used. This can be done
+            by using the <property>force</property> option.
+        </para>
+
+        <para>
+            In this case this single locale will be used and the automatic detection is turned
+            off.
+        </para>
+
+        <example id="zend.application.available-resources.locale.configExampleFallbackOnly">
+            <title>Defining a single locale to use</title>
+
+            <para>
+                The following snippet shows how to set a single locale for your entire application.
+            </para>
+
+            <programlisting language="ini"><![CDATA[
+; No matter what, the nl_NL locale will be used.
+resources.locale.default = "nl_NL"
+resources.locale.force = true
+]]></programlisting>
+        </example>
+    </sect3>
+</sect2>

+ 42 - 0
documentation/manual/fr/module_specs/Zend_Application-AvailableResources-Mail.xml

@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- EN-Revision: 20077 -->
+<!-- Reviewed: no -->
+<sect2 id="zend.application.available-resources.mail">
+    <title>Zend_Application_Resource_Mail</title>
+
+    <para>
+        <classname>Zend_Application_Resource_Mail</classname> peut être utilisé
+        pour instancier un transport pour <classname>Zend_Mail</classname> ou pour
+        paramétrer le nom par défaut et l'adresse, ainsi que le nom et l'adresse de
+        réponse par défaut.
+    </para>
+
+    <para>
+        Lors de l'instanciation d'un transport, il est automatiquement enregistré
+        avec <classname>Zend_Mail</classname>. Cependant en paramétrant la directive
+        <property>transport.register</property> à false, ce comportement
+        n'apparait pas.
+    </para>
+
+    <example id="zend.application.available-resources.mail.configExample">
+        <title>Exemple de configuration de la ressource Mail</title>
+
+        <para>
+            Ci-dessous, vous avez un extrait d'un fichier <acronym>INI</acronym>
+            montrant comment configurer le plugin de ressource Mail.
+        </para>
+
+        <programlisting language="ini"><![CDATA[
+resources.mail.transport.type = smtp
+resources.mail.transport.host = "smtp.example.com"
+resources.mail.transport.auth = login
+resources.mail.transport.username = myUsername
+resources.mail.transport.password = myPassword
+resources.mail.transport.register = true ; True by default
+resources.mail.defaultFrom.email = john@example.com
+resources.mail.defaultFrom.name = "John Doe"
+resources.mail.defaultReplyTo.email = Jane@example.com
+resources.mail.defaultReplyTo.name = "Jane Doe"
+]]></programlisting>
+    </example>
+</sect2>

+ 3 - 1
documentation/manual/fr/module_specs/Zend_Application-AvailableResources.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 19854 -->
+<!-- EN-Revision: 20076 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.application.available-resources" xmlns:xi="http://www.w3.org/2001/XInclude">
     <title>Plugins de ressources disponibles</title>
@@ -13,7 +13,9 @@
     <xi:include href="Zend_Application-AvailableResources-Db.xml" />
     <xi:include href="Zend_Application-AvailableResources-Frontcontroller.xml" />
     <xi:include href="Zend_Application-AvailableResources-Layout.xml" />
+    <xi:include href="Zend_Application-AvailableResources-Locale.xml" />
     <xi:include href="Zend_Application-AvailableResources-Log.xml" />
+    <xi:include href="Zend_Application-AvailableResources-Mail.xml" />
     <xi:include href="Zend_Application-AvailableResources-Modules.xml" />
     <xi:include href="Zend_Application-AvailableResources-Navigation.xml" />
     <xi:include href="Zend_Application-AvailableResources-Router.xml" />

+ 60 - 24
documentation/manual/fr/module_specs/Zend_Controller-Router-Route-Rest.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 19753 -->
+<!-- EN-Revision: 20078 -->
 <!-- Reviewed: no -->
 <sect3 id="zend.controller.router.routes.rest">
     <title>Zend_Rest_Route</title>
@@ -71,50 +71,86 @@
         </tgroup>
     </table>
 
-    <para>
-        Pour activer <classname>Zend_Rest_Route</classname> pour une application entière,
-        construisez en un objet sans paramètre spécifique et ajoutez le comme route par défaut dans
-        le contrôleur frontal:
-    </para>
+    <sect4 id="zend.rest.route_usage">
+        <title>Utilisation de Zend_Rest_Route</title>
 
-    <programlisting language="php"><![CDATA[
+        <para>
+            Pour activer <classname>Zend_Rest_Route</classname> pour une application entière,
+            construisez en un objet sans paramètre spécifique et ajoutez le comme route par défaut dans
+            le contrôleur frontal:
+        </para>
+
+        <programlisting language="php"><![CDATA[
 $front     = Zend_Controller_Front::getInstance();
 $restRoute = new Zend_Rest_Route($front);
 $front->getRouter()->addRoute('default', $restRoute);
 ]]></programlisting>
 
-    <note>
+        <note>
+            <para>
+                Si <classname>Zend_Rest_Route</classname> ne trouve aucun module, contrôleur, action
+                valides, il retournera <constant>FALSE</constant> et la route suivante sera alors
+                analysée par le routeur.
+            </para>
+        </note>
+
         <para>
-            Si <classname>Zend_Rest_Route</classname> ne trouve aucun module, contrôleur, action
-            valides, il retournera <constant>FALSE</constant> et la route suivante sera alors
-            analysée par le routeur.
+            Pour activer <classname>Zend_Rest_Route</classname> pour des modules spécifiques,
+            construisez l'objet avec comme troisième paramètre, un tableau de noms de modules&#160;:
         </para>
-    </note>
-
-    <para>
-        Pour activer <classname>Zend_Rest_Route</classname> pour des modules spécifiques,
-        construisez l'objet avec comme troisième paramètre, un tableau de noms de modules&#160;:
-    </para>
 
-    <programlisting language="php"><![CDATA[
+        <programlisting language="php"><![CDATA[
 $front     = Zend_Controller_Front::getInstance();
 $restRoute = new Zend_Rest_Route($front, array(), array('product'));
 $front->getRouter()->addRoute('rest', $restRoute);
 ]]></programlisting>
 
-    <para>
-        Pour activer <classname>Zend_Rest_Route</classname> pour des contrôleurs spécifiques,
-        construisez l'objet avec comme troisième paramètre, un tableau de noms de contrôleurs
-        en correspondance avec des noms de modules.
-    </para>
+        <para>
+            Pour activer <classname>Zend_Rest_Route</classname> pour des contrôleurs spécifiques,
+            construisez l'objet avec comme troisième paramètre, un tableau de noms de contrôleurs
+            en correspondance avec des noms de modules.
+        </para>
 
-    <programlisting language="php"><![CDATA[
+        <programlisting language="php"><![CDATA[
 $front     = Zend_Controller_Front::getInstance();
 $restRoute = new Zend_Rest_Route($front, array(), array(
     'product' => array('ratings')
 ));
 $front->getRouter()->addRoute('rest', $restRoute);
 ]]></programlisting>
+    </sect4>
+
+    <sect4 id="zend.rest.route_config">
+        <title>Zend_Rest_Route avec Zend_Config_Ini</title>
+
+        <para>
+            To use Zend_Rest_Route from an INI config file, use a route type
+            parameter and set the config options:
+        </para>
+
+        <programlisting language="ini"><![CDATA[
+routes.rest.type = Zend_Rest_Route
+routes.rest.defaults.controller = object
+routes.rest.mod = project,user
+]]></programlisting>
+
+        <para>
+            The 'type' option designates the RESTful routing config type.
+            The 'defaults' option is used to specify custom default
+            module, controller, and/or actions for the route. All other options
+            in the config group are treated as RESTful module names, and their
+            values are RESTful controller names. The example config defines
+            Mod_ProjectController and Mod_UserController as RESTful controllers.
+        </para>
+
+        <para>Then use the addConfig() method of the Rewrite router object:</para>
+
+        <programlisting language="php"><![CDATA[
+$config = new Zend_Config_Ini('path/to/routes.ini');
+$router = new Zend_Controller_Router_Rewrite();
+$router->addConfig($config, 'routes');
+]]></programlisting>
+    </sect4>
 
     <sect4 id="zend.rest.controller">
         <title>Zend_Rest_Controller</title>

+ 1 - 1
documentation/manual/fr/module_specs/Zend_Db_Table_Row.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 18151 -->
+<!-- EN-Revision: 19484 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.db.table.row">
     <title>Zend_Db_Table_Row</title>

+ 55 - 0
documentation/manual/fr/module_specs/Zend_Filter-PregReplace.xml

@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- EN-Revision: 19419 -->
+<!-- Reviewed: no -->
+<sect2 id="zend.filter.set.pregreplace">
+    <title>PregReplace</title>
+
+    <para>
+        <classname>Zend_Filter_PregReplace</classname> performs a search using regular expressions
+        and replaces all found elements.
+    </para>
+
+    <para>
+        The option <property>match</property> has to be given to set the pattern which will be
+        searched for. It can be a string for a single pattern, or an array of strings for multiple
+        pattern.
+    </para>
+
+    <para>
+        To set the pattern which will be used as replacement the option <property>replace</property>
+        has to be used. It can be a string for a single pattern, or an array of strings for multiple
+        pattern.
+    </para>
+
+    <programlisting language="php"><![CDATA[
+$filter = new Zend_Filter_PregReplace(array('match' => 'bob',
+                                            'replace' => 'john'));
+$input  = 'Hy bob!";
+
+$filter->filter($input);
+// returns 'Hy john!'
+]]></programlisting>
+
+    <para>
+        You can use <methodname>getMatchPattern()</methodname> and
+        <methodname>setMatchPattern()</methodname> to set the matching pattern afterwards. To set
+        the replacement pattern you can use <methodname>getReplacement()</methodname> and
+        <methodname>setReplacement()</methodname>.
+    </para>
+
+    <programlisting language="php"><![CDATA[
+$filter = new Zend_Filter_PregReplace();
+$filter->setMatchPattern(array('bob', 'Hy'))
+       ->setReplacement(array('john', 'Bye'));
+$input  = 'Hy bob!";
+
+$filter->filter($input);
+// returns 'Bye john!'
+]]></programlisting>
+
+    <para>
+        For a more complex usage take a look into <acronym>PHP</acronym>'s <ulink
+            url="http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php">PCRE
+            Pattern Chapter</ulink>.
+    </para>
+</sect2>

+ 20 - 59
documentation/manual/fr/module_specs/Zend_Filter-Set.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17175 -->
+<!-- EN-Revision: 19380 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.filter.set" xmlns:xi="http://www.w3.org/2001/XInclude">
     <title>Classes de filtre standards</title>
@@ -47,17 +47,9 @@
         </para>
     </sect2>
 
-    <xi:include href="Zend_Filter-Callback.xml">
-        <xi:fallback>
-            <xi:include href="../../en/module_specs/Zend_Filter-Callback.xml" />
-        </xi:fallback>
-    </xi:include>
-
-    <xi:include href="Zend_Filter-Decryption.xml">
-        <xi:fallback>
-            <xi:include href="../../en/module_specs/Zend_Filter-Decryption.xml" />
-        </xi:fallback>
-    </xi:include>
+    <xi:include href="Zend_Filter-Callback.xml" />
+    <xi:include href="Zend_Filter-Compress.xml" />
+    <xi:include href="Zend_Filter-Decryption.xml" />
 
     <sect2 id="zend.filter.set.digits">
         <title>Digits</title>
@@ -74,11 +66,7 @@
         <para>Retourne la partie correspondant au nom de dossier dans le chemin spécifié.</para>
     </sect2>
 
-    <xi:include href="Zend_Filter-Encryption.xml">
-        <xi:fallback>
-            <xi:include href="../../en/module_specs/Zend_Filter-Encryption.xml" />
-        </xi:fallback>
-    </xi:include>
+    <xi:include href="Zend_Filter-Encryption.xml" />
 
     <sect2 id="zend.filter.set.htmlentities">
         <title>HtmlEntities</title>
@@ -95,57 +83,30 @@
         <para>Retourne la valeur <code>(int) $value</code>.</para>
     </sect2>
 
-    <xi:include href="Zend_Filter-LocalizedToNormalized.xml">
-        <xi:fallback>
-            <xi:include href="../../en/module_specs/Zend_Filter-LocalizedToNormalized.xml" />
-        </xi:fallback>
-    </xi:include>
-
-    <xi:include href="Zend_Filter-NormalizedToLocalized.xml">
-        <xi:fallback>
-            <xi:include href="../../en/module_specs/Zend_Filter-NormalizedToLocalized.xml" />
-        </xi:fallback>
-    </xi:include>
-
-    <sect2 id="zend.filter.set.stripnewlines">
-        <title>Int</title>
-
-        <para>
-            Retourne la valeur <varname>$value</varname> en enlevant les caractères représentant une
-            nouvelle ligne.
-        </para>
-    </sect2>
-
-    <xi:include href="Zend_Filter-RealPath.xml">
-        <xi:fallback>
-            <xi:include href="../../en/module_specs/Zend_Filter-RealPath.xml" />
-        </xi:fallback>
-    </xi:include>
-
-    <sect2 id="zend.filter.set.stringtolower">
-        <title>StringToLower</title>
+    <xi:include href="Zend_Filter-LocalizedToNormalized.xml" />
+    <xi:include href="Zend_Filter-NormalizedToLocalized.xml"/>
+    <xi:include href="Zend_Filter-Null.xml"/>
 
-        <para>
-            Retourne la chaîne <varname>$value</varname>, en convertissant les caractères
-            alphabétiques en minuscules si nécessaire.
-        </para>
-    </sect2>
+    <xi:include href="Zend_Filter-PregReplace.xml"/>
+    <xi:include href="Zend_Filter-RealPath.xml"/>
+    <xi:include href="Zend_Filter-StringToLower.xml" />
+    <xi:include href="Zend_Filter-StringToUpper.xml" />
 
-    <sect2 id="zend.filter.set.stringtoupper">
-        <title>StringToUpper</title>
+    <sect2 id="zend.filter.set.stringtrim">
+        <title>StringTrim</title>
 
         <para>
-            Retourne la chaîne <varname>$value</varname>, en convertissant les caractères
-            alphabétiques en majuscules si nécessaire.
+            Retourne la chaîne <varname>$value</varname> en supprimant les caractères vides en début
+            et fin de chaîne.
         </para>
     </sect2>
 
-    <sect2 id="zend.filter.set.stringtrim">
-        <title>StringTrim</title>
+    <sect2 id="zend.filter.set.stripnewlines">
+        <title>Int</title>
 
         <para>
-            Retourne la chaîne <varname>$value</varname> en supprimant les caractères vides en début
-            et fin de chaîne.
+            Retourne la valeur <varname>$value</varname> en enlevant les caractères représentant une
+            nouvelle ligne.
         </para>
     </sect2>
 

+ 4 - 2
documentation/manual/fr/module_specs/Zend_Filter.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17208 -->
+<!-- EN-Revision: 19419 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.filter.introduction">
     <title>Introduction</title>
@@ -81,7 +81,9 @@ echo Zend_Filter::get('&', 'HtmlEntities');
             Vous pouvez aussi fournir un tableau de paramètres destinés au constructeur de la
             classe, s'ils sont nécessaires pour votre classe de filtre. <programlisting
             role="php"><![CDATA[
-echo Zend_Filter::get('"', 'HtmlEntities', array(ENT_QUOTES));
+echo Zend_Filter::filterStatic('"',
+                               'HtmlEntities',
+                               array('quotestyle' => ENT_QUOTES));
 ]]></programlisting></para>
 
         <para>

+ 45 - 1
documentation/manual/fr/module_specs/Zend_Filter_Input.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17178 -->
+<!-- EN-Revision: 18840 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.filter.input">
     <title>Zend_Filter_Input</title>
@@ -366,6 +366,27 @@ $input->setOptions($options);
 ]]></programlisting>
 
             <para>
+                And you can also add a translator which gives you the ability to provide multiple
+                languages for the messages which are returned by
+                <classname>Zend_Filter_Input</classname>.
+            </para>
+
+            <programlisting language="php"><![CDATA[
+$translate = new Zend_Translate_Adapter_Array(array(
+    Zend_Filter_Input::MISSING_MESSAGE => "Where is the field?"
+);
+
+$input = new Zend_Filter_Input($filters, $validators, $data);
+$input->setTranslator($translate);
+]]></programlisting>
+
+            <para>
+                When you are using an application wide translator, then it will also be used by
+                <classname>Zend_Filter_Input</classname>. In this case you will not have to set the
+                translator manually.
+            </para>
+
+            <para>
                 Le résultat de la méthode <methodname>getUnknown()</methodname> est un tableau associatif
                 dont les clés sont des noms de champs et les valeurs sont les valeurs de champs
                 correspondants. Les noms de champs sont dans ce cas les clés du tableau au lieu des
@@ -406,6 +427,29 @@ $m = $input->getUnescaped('month'); // donnée non échappée
                 </para>
             </note>
 
+            <warning>
+                <title>Escaping unvalidated fields</title>
+
+                <para>
+                    As mentioned before <methodname>getEscaped()</methodname> returns only validated
+                    fields. Fields which do not have an associated validator can not be received
+                    this way. Still, there is a possible way. You can add a empty validator for all
+                    fields.
+                </para>
+
+            <programlisting language="php"><![CDATA[
+$validators = array('*' => array());
+
+$input = new Zend_Filter_Input($filters, $validators, $data, $options);
+]]></programlisting>
+
+                <para>
+                    But be warned that using this notation introduces a security leak which could
+                    be used for cross-site scripting attacks. Therefor you should always set
+                    individual validators for each field.
+                </para>
+            </warning>
+
             <para>
                 Il est possible de définir un autre filtre comme filtre par défaut pour
                 récupération des champs. Ceci se fait via le constructeur :