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.

Archive /

Our old forums are still available as a read-only archive.

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

Translation feature


Go to End


6 Posts   2615 Views

Avatar
SImoX

Community Member, 11 Posts

10 December 2008 at 4:31am

Edited: 10/12/2008 4:32am

Hi all.
I've built my site in one language. Default english...
Now i want to add a second language user can choose in order to view my site.
So i've enabled i18n and run db build. Then i tried run [mysite]/i18n/textcollector/ but "page not found" error. Anyway in the backend, translation tab is present now...
so i added a new translation in my page and all seems to go in the right way except for fields that i added in extension to the default page class. For fixing this, i added

static $extensions = array("Translatable('myExtendedField')");

in my class description and now, when i flush my admin section, the server cannot answer me.

Another thing: i'm using 2.3.0-rc1 and in origin when i tryed to add a translation, backend section gave me javascript parse error. I had to change in CMSMain.php in line 1293 and 1298 div[1] with div[2] for making feature works (FormResponse::add("$('Form_AddPageOptionsForm').getElementsByTagName('div')[2].getElementsByTagName('input')[0].disabled=true;");)

What can i do for making this useful feature work correctly?

bye

Avatar
Nivanka

Community Member, 400 Posts

10 December 2008 at 4:35am

sometimes you can use my plugin I coded up,

http://www.silverstripe.com/extending-hacking-silverstripe-forum/flat/225382

you may find it much easier to use it

Avatar
SImoX

Community Member, 11 Posts

10 December 2008 at 4:41am

I would like to use a method that will support more than two language...
anyway your seems a very nice job.

Avatar
Nivanka

Community Member, 400 Posts

10 December 2008 at 4:44am

in that case it will be easy for you to add more database fields to the page type.

it is easy to update the script, there are some if conditions which render the correct content to the screen.

if you do any updates I would like to hear about that.

Avatar
SImoX

Community Member, 11 Posts

10 December 2008 at 4:56am

Maybe I'll do it... In that case I'll post, don't worry.

About my problem, i forgot to tell that after the whole process i can see all new tables in the db named *_lang so I think that in part this feature is working.

Avatar
Nivanka

Community Member, 400 Posts

10 December 2008 at 5:15am

cheers!