Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Translation feature

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

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

Page: 1
Go to End
Author Topic: 1703 Views
  • SImoX
    Avatar
    Community Member
    11 Posts

    Translation feature Link to this post

    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

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: Translation feature Link to this post

    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

  • SImoX
    Avatar
    Community Member
    11 Posts

    Re: Translation feature Link to this post

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

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: Translation feature Link to this post

    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.

  • SImoX
    Avatar
    Community Member
    11 Posts

    Re: Translation feature Link to this post

    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.

  • Nivanka
    Avatar
    Community Member
    395 Posts

    Re: Translation feature Link to this post

    cheers!

    1703 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.