-
-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Nicolas Bastien
committed
Mar 6, 2014
1 parent
840a3ef
commit b37f809
Showing
2 changed files
with
33 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
Translate PHPCR models | ||
====================== | ||
|
||
|
||
Doctrine PHPCR ODM handles translations natively so you don't need to install anything else. | ||
|
||
|
||
1. Models | ||
--------- | ||
|
||
First step is to defined which fields you want to translate. | ||
|
||
Please refer to the `Doctrine PHPCR ODM documentation <http://doctrine-phpcr-odm.readthedocs.org/en/latest/reference/multilang.html>`_ | ||
|
||
Then your model should just implement `Sonata\TranslationBundle\Model\Phpcr\TranslatableInterface`. | ||
This can be done easily by using `Sonata\TranslationBundle\Traits\Translatable`. | ||
|
||
2. Configuration | ||
---------------- | ||
|
||
If you already followed Installation Step 3, you just have to pay attention to PHPCR fallback configuration. | ||
|
||
So if you configured SonataTranslation like this : | ||
|
||
.. code-block:: yaml | ||
sonata_translation: | ||
locales: [fr, en, it, nl, es] | ||
Then you should configure `doctrine_phpcr.odm.locales` for the same list. |