瀏覽代碼

[DOCUMENTATION] French: sync manual

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@20094 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 16 年之前
父節點
當前提交
0ed7286efd

+ 29 - 6
documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Bootstrapping.xml

@@ -8,7 +8,7 @@
         Comme noté dans <link linkend="zend.test.phpunit.loginexample">l'exemple de
         login</link>, tous les tests <acronym>MVC</acronym> doivent étendre
         <classname>Zend_Test_PHPUnit_ControllerTestCase</classname>. Cette classe étend elle-même
-        <code>PHPUnit_Framework_TestCase</code>, et vous fournit donc toute la structure et les
+        <classname>PHPUnit_Framework_TestCase</classname>, et vous fournit donc toute la structure et les
         assertions que vous attendez de PHPUnit - ainsi que quelques échafaudages et assertions
         spécifiques à l'implémentation <acronym>MVC</acronym> de Zend Framework.
     </para>
@@ -19,8 +19,31 @@
         autour de la propriété publique <varname>$bootstrap</varname>.
     </para>
 
+     <para>
+        Premièrement, et probablement le plus simple, créez simplement une instance de
+        <classname>Zend_Application</classname> comme vous la souhaitez dans votre fichier
+        <filename>index.php</filename>, et assignez la à la propriété <varname>$bootstrap</varname>.
+        Typiquement, vous réaliserez ceci dans votre méthode <methodname>setUp()</methodname>&#160;;
+        vous devrez ensuite <methodname>parent::setUp()</methodname>&#160;:
+    </para>
+
+    <programlisting language="php"><![CDATA[
+class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
+{
+    public function setUp()
+    {
+        // Assign and instantiate in one step:
+        $this->bootstrap = new Zend_Application(
+            'testing', 
+            APPLICATION_PATH . '/configs/application.ini'
+        );
+        parent::setUp();
+    }
+}
+]]></programlisting>
+
     <para>
-        Premièrement, vous pouvez paramétrer cette propriété pour qu'elle pointe vers un
+        Deuxièmement, vous pouvez paramétrer cette propriété pour qu'elle pointe vers un
         fichier. Si vous faîtes ceci, le fichier ne doit pas distribuer le contrôleur frontal, mais
         seulement paramétrer celui-ci et faire tout réglage spécifique à votre application.
     </para>
@@ -35,7 +58,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
 ]]></programlisting>
 
     <para>
-        Deuxièmement, vous pouvez fournir un callback <acronym>PHP</acronym> qui doit être exécuter pour amorcer
+        Troisièmement, vous pouvez fournir un callback <acronym>PHP</acronym> qui doit être exécuter pour amorcer
         votre application. Cet exemple est montré dans <link
         linkend="zend.test.phpunit.loginexample">l'exemple de login</link>. Si le callback est une
         fonction ou une méthode statique, ceci peut être paramétrer au niveau de la classe :
@@ -70,7 +93,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
 
     <para>
         Notez l'appel de <methodname>parent::setUp()</methodname>; ceci est nécessaire puisque la méthode
-        <methodname>setUp()</methodname> de <classname>Zend_Test_PHPUnit_Controller_TestCase</classname>
+        <methodname>setUp()</methodname> de <classname>Zend_Test_PHPUnit_ControllerTestCase</classname>
         exécutera le reste du processus d'amorçage (incluant l'appel du callback).
     </para>
 
@@ -79,7 +102,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
         premier processus inclue le nettoyage de l'environnement pour rendre un état de requête
         propre, va réinitialiser tout plugins ou aides, va réinitialiser l'instance du contrôleur
         frontal, et créer de nouveaux objets de requête et de réponse. Une fois ceci fait, la
-        méthode va faire un <code>include</code> du fichier spécifié dans <varname>$bootstrap</varname>,
+        méthode va faire un <methodname>include()</methodname> du fichier spécifié dans <varname>$bootstrap</varname>,
         ou appeler le callback spécifié.
     </para>
 
@@ -93,7 +116,7 @@ class UserControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
             <para>
                 Ne fournissez pas d'implémentations alternatives des objets "Request" et
                 "Response" ; ils ne seront pas utilisés.
-                <classname>Zend_Test_PHPUnit_Controller_TestCase</classname> utilise des objets de
+                <classname>Zend_Test_PHPUnit_ControllerTestCase</classname> utilise des objets de
                 requête et de réponse personnalisés, respectivement
                 <classname>Zend_Controller_Request_HttpTestCase</classname> et
                 <classname>Zend_Controller_Response_HttpTestCase</classname>. Ces objets fournissent

+ 4 - 2
documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Db-Adapter.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17985 -->
+<!-- EN-Revision: 19418 -->
 <!-- Reviewed: no -->
 <sect2 id="zend.test.phpunit.db.adapter">
     <title>Utiliser l'adaptateur de tests</title>
@@ -84,6 +84,8 @@ echo $qp->getQuerY(); // SELECT * FROM bugs
     <para>
         L'adaptateur de tests définit aussi les méthodes
         <methodname>listTables()</methodname>, <methodname>describeTables()</methodname> et
-        <methodname>lastInsertId()</methodname>.
+        <methodname>lastInsertId()</methodname>. De plus en utilisant
+        <methodname>setQuoteIdentifierSymbol()</methodname> vous pouvez spécifier quel symbole
+        utilisé pour l'échappement, par défaut aucun n'est utilisé.
     </para>
 </sect2>

+ 51 - 3
documentation/manual/fr/module_specs/Zend_Test-PHPUnit-Testing.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17175 -->
+<!-- EN-Revision: 19418 -->
 <!-- Reviewed: no -->
 <sect2 id="zend.test.phpunit.testing">
     <title>Tester vos contrôleurs et vos applications MVC</title>
@@ -16,7 +16,7 @@
     </para>
 
     <programlisting language="php"><![CDATA[
-class IndexControllerTest extends Zend_Test_PHPUnit_Controller_TestCase
+class IndexControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
 {
     // ...
 
@@ -35,7 +35,7 @@ class IndexControllerTest extends Zend_Test_PHPUnit_Controller_TestCase
     </para>
 
     <programlisting language="php"><![CDATA[
-class FooControllerTest extends Zend_Test_PHPUnit_Controller_TestCase
+class FooControllerTest extends Zend_Test_PHPUnit_ControllerTestCase
 {
     // ...
 
@@ -76,4 +76,52 @@ class FooControllerTest extends Zend_Test_PHPUnit_Controller_TestCase
 ]]></programlisting>
 
     <para>Maintenant que la requête est construite, il est temps de créer des assertions.</para>
+
+    <sect3 id="zend.test.phpunit.testing.redirector">
+        <title>Controller Tests and the Redirector Action Helper</title>
+
+        <important>
+            <para>
+                The redirect action helper issues an <methodname>exit()</methodname> statement
+                when using the method <methodname>gotoAndExit()</methodname>
+                and will then obviously also stops a test running for this method.
+                For testability of your application dont use that method on the
+                redirector!
+            </para>
+        </important>
+
+        <para>
+            Due to its nature the redirector action helper plugin issues a redirect
+            and exists after this. Because you cannot test parts of an application
+            that issue exit calls <classname>Zend_Test_PHPUnit_ControllerTestCase</classname>
+            automatically disables the exit part of the redirector which can cause
+            different behaviours in tests and the real application. To make sure
+            redirect work correctly you should it them in the following way:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+class MyController extends Zend_Controller_Action
+{
+    public function indexAction()
+    {
+        if($someCondition == true) {
+            return $this->_redirect(...);
+        } else if($anotherCondition == true) {
+            $this->_redirector->gotoSimple("foo");
+            return;
+        }
+
+        // do some stuff here
+    }
+}
+]]></programlisting>
+
+        <important>
+            <para>
+                Depending on your application this is not enough as additional action, <methodname>preDispatch()</methodname> or
+                <methodname>postDispatch()</methodname> logic might be executed. This cannot be handled in a good way with
+                Zend Test currently.
+            </para>
+        </important>
+    </sect3>
 </sect2>

+ 71 - 22
documentation/manual/fr/module_specs/Zend_Translate-Plurals.xml

@@ -1,8 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17110 -->
+<!-- EN-Revision: 19669 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.translate.plurals">
-
     <title>Notation des pluriels pour Translation</title>
 
     <para>
@@ -29,7 +28,6 @@
     </para>
 
     <sect2 id="zend.translate.plurals.traditional">
-
         <title>Méthode traditionnelle</title>
 
         <para>
@@ -38,7 +36,6 @@
         </para>
 
         <example id="zend.translate.plurals.traditional.example1">
-
             <title>Exemple avec la méthode traditionnelle</title>
 
             <para>
@@ -55,13 +52,10 @@
 $translate = new Zend_Translate('gettext', '/path/to/german.mo', 'de');
 $translate->plural('Car', 'Cars', $number);
 ]]></programlisting>
-
         </example>
-
     </sect2>
 
     <sect2 id="zend.translate.plurals.modern">
-
         <title>Méthode moderne de traduction du pluriel</title>
 
         <para>
@@ -75,7 +69,6 @@ $translate->plural('Car', 'Cars', $number);
         </para>
 
         <example id="zend.translate.plurals.modern.example1">
-
             <title>Exemple de la méthode moderne de traduction du pluriel</title>
 
             <para>
@@ -86,7 +79,6 @@ $translate->plural('Car', 'Cars', $number);
 $translate = new Zend_Translate('gettext', '/path/to/german.mo', 'de');
 $translate->translate(array('Car', 'Cars', $number));
 ]]></programlisting>
-
         </example>
 
         <para>
@@ -94,7 +86,6 @@ $translate->translate(array('Car', 'Cars', $number));
         </para>
 
         <example id="zend.translate.plurals.modern.example2">
-
             <title>Exemple de la méthode moderne de traduction du pluriel utilisant un langage source différent</title>
 
             <para>
@@ -109,7 +100,6 @@ $translate->translate(array('Car',
                             $number,
                             'ru'));
 ]]></programlisting>
-
         </example>
 
         <para>
@@ -120,11 +110,9 @@ $translate->translate(array('Car',
         <para>
             Si vous omettez la langue, l'anglais sera utilisé et tout pluriel superflu sera ignoré.
         </para>
-
     </sect2>
 
     <sect2 id="zend.translate.plurals.source">
-
         <title>Fichiers sources de pluriels</title>
 
         <para>
@@ -186,7 +174,6 @@ $translate->translate(array('Car',
         </para>
 
         <sect3 id="zend.translate.plurals.source.array">
-
             <title>Source tableau contenant des pluriels</title>
 
             <para>
@@ -225,11 +212,9 @@ array(
                 Si votre langue supporte plusieurs pluriels, ajoutez les simplement dans le tableau à la
                 suite du premier pluriel.
             </para>
-
         </sect3>
 
         <sect3 id="zend.translate.plurals.source.csv">
-
             <title>Csv et pluriels</title>
 
             <para>
@@ -246,11 +231,9 @@ array(
                 tout les pluriels suivants doivent être ajoutés après, mais sans traduction.
                 Notez que le délimiteur est nécessaire pour les pluriels vides.
             </para>
-
         </sect3>
 
         <sect3 id="zend.translate.plurals.source.gettext">
-
             <title>Gettext et pluriels</title>
 
             <para>
@@ -259,18 +242,84 @@ array(
             </para>
 
             <note>
-
                 <para>
                     Notez que gettext ne gère pas les langues à plusieurs pluriels, utilisez
                     un autre adaptateur dans ce cas là.
                 </para>
-
             </note>
-
         </sect3>
-
     </sect2>
 
+    <sect2 id="zend.translate.plurals.customrules">
+        <title>Custom plural rules</title>
+
+        <para>
+            In rare cases it could be useful to be able to define own plural rules. See chinese for
+            example. This language defines two plural rules. Per default it does not use plurals.
+            But in rare cases it uses a rule like <emphasis>(number == 1) ? 0 : 1</emphasis>.
+        </para>
+
+        <para>
+            Also when you want to use a language which has no known plural rules, and would want to
+            define your own rules.
+        </para>
+
+        <para>
+            This can be done by using <methodname>Zend_Translate_Plural::setRule()</methodname>.
+            The method expects two parameters which must be given. A rule, which is simply a
+            callback to a self defined method. And a locale for which the rule will be used.
+        </para>
+
+        <para>
+            Your rule could look like this:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+public function MyRule($number) {
+    return ($number == 10) ? 0 : 1;
+}
+]]></programlisting>
+
+        <para>
+            As you see, your rule must accept one parameter. It is the number which you will use to
+            return which plural the translation has to use. In our example we defined that when we
+            get a '10' the plural definition 0 has to be used, in all other cases we're using 1.
+        </para>
+
+        <para>
+            Your rules can be as simple or as complicated as you want. You must only return an
+            integer value. The plural definition 0 stands for singular translation, and 1 stands for
+            the first plural rule.
+        </para>
+
+        <para>
+            To activate your rule, and to link it to the wished locale, you have to call it like
+            this:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+Zend_Translate_Plural::setPlural('MyPlural', 'zh');
+]]></programlisting>
+
+        <para>
+            Now we linked our plural definition to the chinese language.
+        </para>
+
+        <para>
+            You can define one plural rule for every language. But you should be aware that you set
+            the plural rules before you are doing translations.
+        </para>
+
+        <note>
+            <title>Define custom plurals only when needed</title>
+
+            <para>
+                <classname>Zend_Translate</classname> defines plurals for most known languages.
+                You should not define own plurals when you are not in need. The default rules work
+                most of time.
+            </para>
+        </note>
+    </sect2>
 </sect1>
 <!--
 vim:se ts=4 sw=4 et:

+ 1 - 1
documentation/manual/fr/module_specs/Zend_Validate-Messages.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17904 -->
+<!-- EN-Revision: 18942 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.validate.messages">
 

+ 1 - 1
documentation/manual/fr/module_specs/Zend_View-Abstract.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 17822 -->
+<!-- EN-Revision: 18822 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.view.abstract">
     <title>Zend_View_Abstract</title>

+ 86 - 1
documentation/manual/fr/ref/migration-110.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 18833 -->
+<!-- EN-Revision: 19819 -->
 <!-- Reviewed: no -->
 <sect1 id="migration.110">
     <title>Zend Framework 1.10</title>
@@ -9,6 +9,68 @@
         vous devriez prendre note de ce qui suit.
     </para>
 
+    <sect2 id="migration.110.zend.feed.reader">
+        <title>Zend_Feed_Reader</title>
+
+        <para>
+            With the introduction of Zend Framework 1.10, <classname>Zend_Feed_Reader</classname>'s
+            handling of retrieving Authors and Contributors was changed, introducing
+            a break in backwards compatibility. This change was an effort to harmonise
+            the treatment of such data across the RSS and Atom classes of the component
+            and enable the return of Author and Contributor data in more accessible,
+            usable and detailed form. It also rectifies an error in that it was assumed
+            any author element referred to a name. In RSS this is incorrect as an
+            author element is actually only required to provide an email address.
+            In addition, the original implementation applied its RSS limits to Atom
+            feeds significantly reducing the usefulness of the parser with that format.
+        </para>
+
+        <para>
+            The change means that methods like <methodname>getAuthors()</methodname>
+            and <methodname>getContributors</methodname> no longer return a simple array
+            of strings parsed from the relevant RSS and Atom elements. Instead, the return
+            value is an <classname>ArrayObject</classname> subclass called
+            <classname>Zend_Feed_Reader_Collection_Author</classname> which simulates
+            an iterable multidimensional array of Authors. Each member of this object
+            will be a simple array with three potential keys (as the source data permits).
+            These include: name, email and uri.
+        </para>
+
+        <para>
+            The original behaviour of such methods would have returned a simple
+            array of strings, each string attempting to present a single name, but
+            in reality this was unreliable since there is no rule governing the format
+            of RSS Author strings.
+        </para>
+
+        <para>
+            The simplest method of simulating the original behaviour of these
+            methods is to use the <classname>Zend_Feed_Reader_Collection_Author</classname>'s
+            <methodname>getValues()</methodname> which also returns a simple array of strings
+            representing the "most relevant data", for authors presumed to be their name.
+            Each value in the resulting array is derived from the "name" value
+            attached to each Author (if present). In most cases this simple change is
+            easy to apply as demonstrated below.
+        </para>
+
+        <programlisting language="php"><![CDATA[
+/**
+ * Before 1.10
+ */
+
+$feed = Zend_Feed_Reader::import('http://example.com/feed');
+$authors = $feed->getAuthors();
+
+/**
+ * With 1.10
+ */
+$feed = Zend_Feed_Reader::import('http://example.com/feed');
+$authors = $feed->getAuthors()->getValues();
+
+
+]]></programlisting>
+    </sect2>
+
     <sect2 id="migration.110.zend.file.transfer">
         <title>Zend_File_Transfer</title>
         <sect3 id="migration.110.zend.file.transfer.count">
@@ -58,6 +120,29 @@
         </sect3>
     </sect2>
 
+    <sect2 id="migration.110.zend.translate">
+        <title>Zend_Translate</title>
+
+        <sect3 id="migration.110.zend.translate.xliff">
+            <title>Xliff adapter</title>
+
+            <para>
+                In past the Xliff adapter used the source string as message Id. According to the
+                Xliff standard the trans-unit Id should be used. This behaviour was corrected with
+                Zend Framework 1.10. Now the trans-unit Id is used as message Id per default.
+            </para>
+
+            <para>
+                But you can still get the incorrect and old behaviour by setting the
+                <property>useId</property> option to <constant>FALSE</constant>.
+            </para>
+
+            <programlisting language="php"><![CDATA[
+$trans = new Zend_Translate('xliff', '/path/to/source', $locale, array('useId' => false));
+]]></programlisting>
+        </sect3>
+    </sect2>
+
     <sect2 id="migration.110.zend.validate">
         <title>Zend_Validate</title>