Jump to:

22979 Posts in 11760 Topics by 2827 members

General Questions

SilverStripe Forums » General Questions » Siteconfig transalateable?

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Page: 1
Go to End
Author Topic: 600 Views
  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Siteconfig transalateable? Link to this post

    Hi,

    Out of the 3 default fields int eh site config (title, tagline, theme) 2 are text fields that are shown int eh basic theme. These two are not translated when adding translatable - but surely they would be?

    I've placed the site footer as a HTMLEditField in there and it would be very nice if it was "translatable" - can someone help me with this please?

    Barry

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Siteconfig transalateable? Link to this post

    Hi swaiba,

    I'm not quite sure if I understand you correctly (especially that part:"...shown in the basic theme."...)
    But when I'm logged into the backend and change the language in the profile settings (and refresh the page), all fields in SiteConfig will be translated (SS-2.4.5).
    ...

    The Translatable stuff from my /mysite/_config.php:

    Translatable::set_default_locale('de_DE');
    Object::add_extension('SiteTree', 'Translatable');
    Object::add_extension('SiteConfig', 'Translatable');

    ...
    Hope this helps a bit,
    Cheers
    Christian

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Siteconfig transalateable? Link to this post

    doh!

    I had not translated the site config! I'll try that... thanks!

    do you think that something like this would work for widgets too?
    http://www.silverstripe.org/widgets-2/show/17327

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Siteconfig transalateable? Link to this post

    Thanks Christian - the site config (and therefore custom footer) now is translatable

  • Invader_Zim
    Avatar
    Community Member
    141 Posts

    Re: Siteconfig transalateable? Link to this post

    ^^ Uh oh, sorry I never had to deal with that problem
    and honestly I'm quite happy about that since translatable and stuff makes my brain melt)
    I'm still struggling with a proper way to translate different DataObjects...

    Edit1: YAY

    Edit2:
    I'm still struggling with a proper way to translate different DataObjects...
    Object::add_extension('MyCustomShinyDataObject', 'Translatable'); <-- wonder how I could miss that... *slamsheadagainsttable*

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: Siteconfig transalateable? Link to this post

    since translatable and stuff makes my brain melt

    you are telling me - built a system and now each non-sitree page, ajax request, widget, image and so on needs to be reworked and I feel like I am rewriting the translatable each time! This was actually one of the easiest fixes...

    600 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.