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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Data Model Questions /

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

Problems with Translatable & 2.3.1

Go to End

7 Posts   2501 Views


Community Member, 16 Posts

1 May 2009 at 6:00am

I'm working on my first multilingual site with SS and I'm having troubles with the translatable class!
I was trying to do everything according to but could not get anything working at all!

First I tried putting

in my _config.php, but this function doesnt seem to exist in my Ss version in the Translatable class!

Furthermore if i try

Object::add_extension('Page', 'Translatable');
in _config.php or
	static $extensions = array(
in Page.php the result is always resulting in
[Warning] Missing argument 1 for Translatable::__construct()

I think I have to pass somehow the translatable fields to the decorator, but don't know how to do that!

All in all i would just need a quick version to make all content translatable, and the site will feature at least 4 languages, so work arounds like creating seperate fields for languages doesnt really work, and translateable as shown in the tutorial would be perfect for me, but no idea how to get that working, any fast help is really appreciated! thanks!


Community Member, 1 Post

1 May 2009 at 4:42pm

I've funnily enough been working through the exact same problem today; I've managed to enable the module using:


And then doing a dev/build, however this still doesn't work correctly. I get an error message when trying to create a new translation:

Error: Couldn't run query: SELECT `SiteTree`.*, `SiteTree_lang`.*, `SiteTree_lang`.*, `GhostPage`.*, `ErrorPage`.*, `RedirectorPage`.*, `VirtualPage`.*, `UserDefinedForm`.*, `SiteTree_lang`.OriginalLangID, if(`SiteTree_lang`.ClassName,`SiteTree_lang`.ClassName,'SiteTree') AS RecordClassName, `SiteTree_lang`.OriginalLangID AS ID, `SiteTree_lang_lang`.OriginalLangID AS ID FROM INNER JOIN `SiteTree_lang` ON `SiteTree_lang`.OriginalLangID = `SiteTree_lang`.OriginalLangID INNER JOIN `SiteTree` ON `SiteTree_lang`.OriginalLangID = `SiteTree`.ID LEFT JOIN `GhostPage` ON `GhostPage`.ID = `SiteTree_lang`.OriginalLangID LEFT JOIN `ErrorPage` ON `ErrorPage`.ID = `SiteTree_lang`.OriginalLangID LEFT JOIN `RedirectorPage` ON `RedirectorPage`.ID = `SiteTree_lang`.OriginalLangID LEFT JOIN `VirtualPage` ON `VirtualPage`.ID = `SiteTree_lang`.OriginalLangID LEFT JOIN `UserDefinedForm` ON `UserDefinedForm`.ID = `SiteTree_lang`.OriginalLangID WHERE (`SiteTree`.`ParentID` = 0 AND `SiteTree_lang`.OriginalLangID != 0) AND (`SiteTree_lang`.Lang = 'de') AND (`SiteTree_lang`.Lang = 'de') ORDER BY Sort You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'INNER JOIN `SiteTree_lang` ON `SiteTree_lang`.OriginalLangID = `SiteTree_lang`.O' at line 1

Anyway, any further ideas anyone? From as far as I can see the fix is to use the SVN trunk; is it safe to use yet?


Community Member, 127 Posts

1 May 2009 at 6:26pm

You guys might have noticed that translatable does not work currently, with 2.3.1 and I think also 2.3.0, it's mentioned quite often here.

However that should not stop you from making multilanguage sites even with 2.3.1, see recipes:multilingual_content and Multilingual Content - alternative to 'translatable'.


Community Member, 16 Posts

1 May 2009 at 11:14pm

Edited: 01/05/2009 11:51pm

As I mentioned above it's not a nice aternative for me to make seperate fields for seperate languages since the site will feature 4+ languages and probably grow! But you think there's no chance of getting Translatable work with 2.3.1?

Is there anybody out there who managed to get Translatable working with 2.3.1 and can post his code?


Community Member, 48 Posts

6 May 2009 at 10:24am

It definately doesn't work with 2.3.1. I'm currently trying out 2.3.2beta1 which you can check out via svn. So far no luck tho... when I change the locale using

I just get an error: The requested page couldn't be found.


Community Member, 48 Posts

6 May 2009 at 1:04pm

Okay, so now I see each page has a unique url. So If I have an english version of home at to get to the japanese version, I have to visit

BUT the locale is not persisted.

If I then try to visit the about page by clicking a link in the navigation it goes to and I get the error 'The requested page couldn't be found.'

I have to explicitly visit

Does anyone know how to make the locale persistant, so that once the user visits a Japanese page, the site STAYS in Japanese until they choose to switch back to English?




Forum Moderator, 801 Posts

11 May 2009 at 8:34pm