I added the Translatable extension to SiteTree and a DataObject, 'DOStaffMember'.
Using a default locale of en_US, i translated a page to another language, and when i open a DataObject from a ComplexTableField, the popup believes it is an en_US locale, not the current locale (it_IT or whatever). this is running silverstripe 2.4.5 release codebase.
Through debugging, i see that the class ComplexTableField_Popup doesnt know what locale it is, while ComplexTableField does.
anyone have any ideas where this is breaking? i can get the current locale through the controller in the ComplexTableField Class, but i'm not sure where the disconnect is.
If I select a different language from the Dropdown, I would expect that editing Dataobjects on the right side would give me the Sitetree for the selected language. But instead it always gives me the default language set.
I can force it by setting Translatable::set_current_language() to the desired language. But I don't know which language the editor has selected in the backend. There seems to be no language set..... I'll check the controller as you said it would know which language is selected...
Yes this is a known bug and you have to make a change in one of the core files to fix this.
[url=http://open.silverstripe.org/ticket/4199]Here[/url] is the ticket report and there is a patch attached.
It stores the locale in the session which isn't something the core team wants to do. However right now there's no other easy way to fix this. With this fix the current locale will be correct but you might have to add it in yourself on the data object with onBeforeWrite().
thanks for getting back to me. I'm upgrading a site from 2.3.3 to 2.4.5 and actually applied that patch in 2.3.3 a year or so ago. since i didnt see 'cant handle CMSMain action' error in the popup i assumed it was fixed. turned out that there was a further thread on that bug ticket which fixed half of my problem. I was able to set the locale of the record pulled up in the popup, but the CTF refreshed to default locale. the last patch in [url=http://open.silverstripe.org/ticket/4199]the bug ticket[/url] fixed the refresh issue.
i uploaded another patch to the ticket to fix the bug in 2.4.5.
hopefully this patch gets added soon so we dont have to apply it again in silverstripe 3. it is a more solid patch now because its not handling anything through sessions now.
thanks again for letting me know about the ticket.
Yeah we should really push for this stuff to get fixed so that Translatable actually works going forward.
I hate having to patch all my multilingual sites every time just to make them work.
Also one more thing that should be fixed is entity translations in the frontend of the site. Right now they're only affected by i18n so I end up setting the i18n locale to the same thing as the Translatable locale but I don't think that's the way it should work.
i thought i replied to this but just noticed that it didnt get posted. anyways, i raised this issue in the google core dev discussion group. [url=http://groups.google.com/group/silverstripe-dev/browse_thread/thread/fb9ba5657389edaa#]Here's the thread[/url].
long story short, its possible that Translatable may become a module in the future.. could be good.. (and a lot of work). Has anyone put any thought around how to make the translation interface better? you can see my thoughts in the thread but i am very curious to get anyone else's thoughts.