فهرست منبع

merged branch clemens-tolboom/2.0 (PR #3725)

Commits
-------

e4f3fd9 Fixed example code.

Discussion
----------

[Translation] example code did not work.

The example code for Translation did not compile. And the trans() result was void.
Fabien Potencier 13 سال پیش
والد
کامیت
d12e398cbe
1فایلهای تغییر یافته به همراه2 افزوده شده و 2 حذف شده
  1. 2 2
      src/Symfony/Component/Translation/README.md

+ 2 - 2
src/Symfony/Component/Translation/README.md

@@ -10,12 +10,12 @@ translated strings from these including support for pluralization.
 
     $translator = new Translator('fr_FR', new MessageSelector());
     $translator->setFallbackLocale('fr');
-    $translator->addLoader('array', return new ArrayLoader());
+    $translator->addLoader('array', new ArrayLoader());
     $translator->addResource('array', array(
         'Hello World!' => 'Bonjour',
     ), 'fr');
 
-    $translator->trans('Hello World!');
+    echo $translator->trans('Hello World!') . "\n";
 
 Resources
 ---------