Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Director Rul and Translatable Module


Go to End


811 Views

Avatar
khalid

Community Member, 1 Post

18 July 2013 at 4:23am

Edited: 18/07/2013 4:28am

I am developing a Project using Silverstripe 3.1 beta 3. It is Multilingual, only two languages (de_DE, en_US).
For Implementing Multilingual functionality on the site I installed the Translatable Module. It is working properly on the Pages but not on DataObjects. For that purpose I tried to solve it in a way to make more fields for each Language since I have only 3 fields to be translated. It is all working properly in CMS and Frontend. To show the DataObjects in Frontend I am using the Director rules in mysite/_config/config.yml file:
Director:
rules:
'referenzen/projekte/$Kat/$RefID/$LeistungID': 'ReferenzDetailPage_Controller'
'references/projects/$Kat/$RefID/$LeistungID': 'ReferenzDetailPage_Controller'

Problem:
My problem is that in the Controller and its viewer Template I have no access on the Locale Variable to show the right Language Fields accordingly. I tried to save the Locale value on a session variable and use it to differentiate between languages but it is overwritten and shows me always the default set Language which is (de_DE).

Using Uncle Cheese Module for DataObject Translation having the same problem.

Can anyone Help please? Am I on the right path? I am relatively new to Silverstirpe. Thanks!