Просмотр исходного кода

[DOCUMENTATION] French: sync manual

git-svn-id: http://framework.zend.com/svn/framework/standard/trunk@21742 44c647ce-9c0f-0410-b52a-842ac1e357ba
mikaelkael 16 лет назад
Родитель
Сommit
10c71302fd

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

@@ -74,7 +74,6 @@
             clés / valeurs à enregistrer dans le contrôleur frontal.
         </para></listitem>
 
-
         <listitem>
             <para>
                 <emphasis><property>returnresponse</property></emphasis>&#160;: active ou non le

+ 2 - 2
documentation/manual/fr/module_specs/Zend_Controller-Exceptions.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- EN-Revision: 20765 -->
+<!-- EN-Revision: 21684 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.controller.exceptions">
     <title>Exceptions avec MVC</title>
@@ -287,7 +287,7 @@ class My_Controller_PreDispatchPlugin
         $front      = Zend_Controller_Front::getInstance();
         $dispatcher = $front->getDispatcher();
         $class      = $dispatcher->getControllerClass($request);
-        if (!$controller) {
+        if (!$class) {
             $class = $dispatcher->getDefaultControllerClass($request);
         }
 

+ 193 - 1
documentation/manual/fr/module_specs/Zend_Controller-Router-Route.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<!-- EN-Revision: 20765 -->
+<!-- EN-Revision: 21661 -->
 <!-- Reviewed: no -->
 <sect3 id="zend.controller.router.routes.standard">
     <title>Zend_Controller_Router_Route</title>
@@ -188,6 +188,198 @@ $router->addRoute('archive', $route);
             ne sera pas captée (matchée) par cette route, et le contrôle sera passé à la route
             suivante, etc.
         </para>
+    </sect4>
+
+    <sect4 id="zend.controller.router.routes.standard.translated-segments">
+        <title>Translated segments</title>
+
+        <para>
+            The standard route supports translated segments. To use this
+            feature, you have to define at least a translator (an instance
+            of <classname>Zend_Translate</classname>) via one of the following ways:
+        </para>
+
+        <itemizedlist>
+            <listitem>
+                <para>
+                    Put it into the registry with the key <classname>Zend_Translate</classname>.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    Set it via the static method
+                    <methodname>Zend_Controller_Router_Route::setDefaultTranslator()</methodname>.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    Pass it as fourth parameter to the constructor.
+                </para>
+            </listitem>
+        </itemizedlist>
+
+        <para>
+            By default, the locale specified in the <classname>Zend_Translate</classname>
+            instance will be used. To override it, you set it
+            (an instance of <classname>Zend_Locale</classname> or a locale string) in one
+            of the following ways:
+        </para>
+
+        <itemizedlist>
+            <listitem>
+                <para>
+                    Put it into the registry with the key <classname>Zend_Locale</classname>.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    Set it via the static method
+                    <methodname>Zend_Controller_Router_Route::setDefaultLocale()</methodname>.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    Pass it as fifth parameter to the constructor.
+                </para>
+            </listitem>
+
+            <listitem>
+                <para>
+                    Pass it as <command>@locale</command> parameter to the assemble
+                    method.
+                </para>
+            </listitem>
+        </itemizedlist>
+
+        <para>
+            Translated segments are separated into two parts. Fixed segments
+            are prefixed by a single <emphasis>@</emphasis>-sign, and will be
+            translated to the current locale when assembling and reverted
+            to the message ID when matching again. Dynamic segments
+            are prefixed by <command>:@</command>. When assembling, the given
+            parameter will be translated and inserted into the parameter
+            position. When matching, the translated parameter from the
+            <acronym>URL</acronym> will be reverted to the message ID again.
+        </para>
+
+        <note>
+            <title>Message IDs and separate language file</title>
 
+            <para>
+                Occasionally a message ID which you want to use in one
+                of your routes is already used in a view script or somewhere
+                else. To have full control over safe <acronym>URL</acronym>s, you should use
+                a separate language file for the messages used in the route.
+            </para>
+        </note>
+
+        <para>
+            The following is the simplest way to prepare the standard route for
+            translated segment usage:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+// Prepare the translator
+$translator = new Zend_Translate(
+    array(
+        'adapter' => 'array',
+        'content' => array(),
+        'locale'  => 'en'
+    )
+);
+$translator->addTranslation(
+    array(
+        'content' =>
+            array(
+                'archive' => 'archiv',
+                'year'    => 'jahr',
+                'month'   => 'monat',
+                'index'   => 'uebersicht'
+            ),
+        'locale'  => 'de'
+    )
+);
+
+// Set the current locale for the translator
+$translator->setLocale('en');
+
+// Set it as default translator for routes
+Zend_Controller_Router_Route::setDefaultTranslator($translator);
+]]></programlisting>
+
+        <para>
+            This example demonstrates the usage of static segments:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+// Create the route
+$route = new Zend_Controller_Router_Route(
+    '@archive',
+    array(
+        'controller' => 'archive',
+        'action'     => 'index'
+    )
+);
+$router->addRoute('archive', $route);
+
+// Assemble the URL in default locale: archive
+$route->assemble(array());
+
+// Assemble the URL in german: archiv
+$route->assemble(array());
+]]></programlisting>
+
+        <para>
+            You can use the dynamic segments to create a module-route like
+            translated version:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+// Create the route
+$route = new Zend_Controller_Router_Route(
+    ':@controller/:@action/*',
+    array(
+        'controller' => 'index',
+        'action'     => 'index'
+    )
+);
+$router->addRoute('archive', $route);
+
+// Assemble the URL in default locale: archive/index/foo/bar
+$route->assemble(array('controller' => 'archive', 'foo' => 'bar'));
+
+// Assemble the URL in german: archiv/uebersicht/foo/bar
+$route->assemble(array('controller' => 'archive', 'foo' => 'bar'));
+]]></programlisting>
+
+        <para>
+            You can also mix static and dynamic segments:
+        </para>
+
+        <programlisting language="php"><![CDATA[
+// Create the route
+$route = new Zend_Controller_Router_Route(
+    '@archive/:@mode/:value',
+    array(
+        'mode'       => 'year'
+        'value'      => 2005,
+        'controller' => 'archive',
+        'action'     => 'show'
+    ),
+    array('mode'  => '(month|year)'
+          'value' => '\d+')
+);
+$router->addRoute('archive', $route);
+
+// Assemble the URL in default locale: archive/month/5
+$route->assemble(array('mode' => 'month', 'value' => '5'));
+
+// Assemble the URL in german: archiv/monat/5
+$route->assemble(array('mode' => 'month', 'value' => '5', '@locale' => 'de'));
+]]></programlisting>
     </sect4>
 </sect3>

+ 7 - 7
documentation/manual/fr/module_specs/Zend_Currency-Exchange.xml

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 20102 -->
+<!-- EN-Revision: 21646 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.currency.exchange">
     <title>Echanger (convertir) des monnaies</title>
@@ -30,7 +30,7 @@ class SimpleExchange implements Zend_Currency_CurrencyInterface
 
         switch ($to) {
             case 'EUR':
-                return 0.5;
+                return 2;
             case 'JPE':
                 return 0.7;
        }
@@ -66,7 +66,7 @@ class SimpleExchange implements Zend_Currency_CurrencyInterface
 $currency = new Zend_Currency(
     array(
         'value'    => 1000,
-        'currency' => 'USD',
+        'currency' => 'EUR',
     )
 );
 
@@ -75,10 +75,10 @@ $service  = new SimpleExchange();
 // attachons le service de change
 $currency->setService($service);
 
-$currency_2 = new Zend_Currency(
+$currency2 = new Zend_Currency(
     array(
         'value'    => 1000,
-        'currency' => 'EUR',
+        'currency' => 'USD',
     )
 );
 
@@ -86,8 +86,8 @@ print $currency->add($currency2);
 ]]></programlisting>
 
     <para>
-        L'exemple ci-dessus retournera '$ 3.000' car 1.000 <acronym>EUR</acronym> seront convertis avec
-        un taux de 2 vers 2.000 <acronym>USD</acronym>.
+        L'exemple ci-dessus retournera '$ 3.000' car 1.000 <acronym>USD</acronym> seront convertis avec
+        un taux de 2 vers 2.000 <acronym>EUR</acronym>.
     </para>
 
     <note>

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

@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<!-- EN-Revision: 21358 -->
+<!-- EN-Revision: 21740 -->
 <!-- Reviewed: no -->
 <sect1 id="zend.db.adapter">
     <title>Zend_Db_Adapter</title>

+ 5 - 1
documentation/manual/fr/module_specs/Zend_Service_Twitter.xml

@@ -718,7 +718,11 @@ $response2 = $twitter->block->blocking(2, true);
             </listitem>
         </itemizedlist>
     </sect2>
-    <xi:include href="Zend_Service_Twitter_Search.xml" />
+    <xi:include href="Zend_Service_Twitter_Search.xml">
+        <xi:fallback>
+            <xi:include href="../../en/module_specs/Zend_Service_Twitter_Search.xml" />
+        </xi:fallback>
+    </xi:include>
 </sect1>
 <!--
 vim:se ts=4 sw=4 et: