diff --git a/book/translation.rst b/book/translation.rst index d6094a3a5d7..39fe75031de 100644 --- a/book/translation.rst +++ b/book/translation.rst @@ -68,8 +68,10 @@ enable the ``translator`` in your configuration: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -366,7 +368,8 @@ provides many loaders, including: * ``yml``: YAML file. The choice of which loader to use is entirely up to you and is a matter of -taste. For more options, see :ref:`component-translator-message-catalogs`. +taste. The recommended option is to use ``xliff`` for translations. +For more options, see :ref:`component-translator-message-catalogs`. .. note:: @@ -454,7 +457,7 @@ by the routing system using the special ``_locale`` parameter: # app/config/routing.yml contact: path: /{_locale}/contact - defaults: { _controller: AcmeDemoBundle:Contact:index } + defaults: { _controller: AppBundle:Contact:index } requirements: _locale: en|fr|de @@ -468,7 +471,7 @@ by the routing system using the special ``_locale`` parameter: http://symfony.com/schema/routing/routing-1.0.xsd"> - AcmeDemoBundle:Contact:index + AppBundle:Contact:index en|fr|de @@ -483,7 +486,7 @@ by the routing system using the special ``_locale`` parameter: $collection->add('contact', new Route( '/{_locale}/contact', array( - '_controller' => 'AcmeDemoBundle:Contact:index', + '_controller' => 'AppBundle:Contact:index', ), array( '_locale' => 'en|fr|de', @@ -524,8 +527,10 @@ the framework: + xsi:schemaLocation="http://symfony.com/schema/dic/services + http://symfony.com/schema/dic/services/services-1.0.xsd + http://symfony.com/schema/dic/symfony + http://symfony.com/schema/dic/symfony/symfony-1.0.xsd"> @@ -554,8 +559,8 @@ the error messages is easy: simply create a translation resource for the To start, suppose you've created a plain-old-PHP object that you need to use somewhere in your application:: - // src/Acme/BlogBundle/Entity/Author.php - namespace Acme\BlogBundle\Entity; + // src/AppBundle/Entity/Author.php + namespace AppBundle\Entity; class Author { @@ -568,17 +573,9 @@ not empty, add the following: .. configuration-block:: - .. code-block:: yaml - - # src/Acme/BlogBundle/Resources/config/validation.yml - Acme\BlogBundle\Entity\Author: - properties: - name: - - NotBlank: { message: "author.name.not_blank" } - .. code-block:: php-annotations - // src/Acme/BlogBundle/Entity/Author.php + // src/AppBundle/Entity/Author.php use Symfony\Component\Validator\Constraints as Assert; class Author @@ -589,15 +586,24 @@ not empty, add the following: public $name; } + .. code-block:: yaml + + # src/AppBundle/Resources/config/validation.yml + AppBundle\Entity\Author: + properties: + name: + - NotBlank: { message: "author.name.not_blank" } + .. code-block:: xml - + + xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping + http://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd"> - + @@ -608,7 +614,7 @@ not empty, add the following: .. code-block:: php - // src/Acme/BlogBundle/Entity/Author.php + // src/AppBundle/Entity/Author.php // ... use Symfony\Component\Validator\Mapping\ClassMetadata;