Skip to content

Commit

Permalink
[Doc] PHPCR #3
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicolas Bastien committed Mar 6, 2014
1 parent 840a3ef commit b37f809
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Resources/doc/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ This bundle adds a locale switcher block in your edit forms.
**Currently supported :**

* **ORM** : integrates Doctrine ORM entities with Gedmo extensions

`Currently working on PHPCR integration`
* **PHPCR**: integrates Doctrine PHPCR ODM

Reference Guide
---------------
Expand All @@ -19,4 +18,5 @@ Reference Guide
:numbered:

reference/installation
reference/orm
reference/orm
reference/phpcr
30 changes: 30 additions & 0 deletions Resources/doc/reference/phpcr.rst
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.

0 comments on commit b37f809

Please sign in to comment.