@@ -101,8 +101,39 @@ See the section below for multilanguage support.
101
101
Multi-language support
102
102
----------------------
103
103
104
- @todo: Explain how multilang works now, in particular the use of ``->addLocaleFormat `` on
105
- the ``Page `` document.
104
+ Setting ``addLocalePattern `` to true in the ``Symfony\Cmf\Bundle\SimpleCmsBundle\Doctrine\Phpcr\Page ``
105
+ document will result in prefixing the associated route with ``/{_locale} ``. Using the native
106
+ translation capabilities of PHPCR ODM it is now possible to create different versions of the document
107
+ for each language that should be available on the website:
108
+
109
+ $page = new Page();
110
+
111
+ $page->setPosition($parent, 'hello-world');
112
+ $page->setTitle('Hello World!');
113
+ $page->setBody('Really interesting stuff...');
114
+ $page->setLabel('Hello World');
115
+ $dm->persist($page);
116
+ $dm->bindTranslation($page, 'en');
117
+
118
+ $page->setTitle('Hallo Welt!');
119
+ $page->setBody('Super interessante Sachen...');
120
+ $page->setLabel('Hallo Welt!');
121
+ $dm->bindTranslation($page, 'de');
122
+
123
+ $dm->flush();
124
+
125
+ .. note ::
126
+
127
+ Since SimpleCmsBundle only provides a single tree structure, all nodes
128
+ will have the same node name for all languages. So a url
129
+ ``http://foo.com/en/hello-world `` for english content will look like
130
+ ``http://foo.com/de/hello-world `` for german content. At times it might be most
131
+ feasible to use integers as the node names and simple append the title of
132
+ the node in the given locale as an anchor. So for example
133
+ ``http://foo.com/de/1#my title `` and ``http://foo.com/de/1#mein title ``.
134
+ If you need language specific URLs, you want to use the CMF routing bundle
135
+ and content bundle directly to have a separate route document per
136
+ language.
106
137
107
138
Rendering
108
139
---------
0 commit comments