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.

General Questions /

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

Siteconfig transalateable?


Reply


6 Posts   703 Views

Avatar
swaiba

Forum Moderator, 1799 Posts

30 June 2011 at 5:12am

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

Avatar
Invader_Zim

Community Member, 141 Posts

30 June 2011 at 6:02am

Edited: 30/06/2011 6:03am

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

Avatar
swaiba

Forum Moderator, 1799 Posts

30 June 2011 at 6:09am

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

Avatar
swaiba

Forum Moderator, 1799 Posts

30 June 2011 at 6:20am

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

Avatar
Invader_Zim

Community Member, 141 Posts

30 June 2011 at 6:24am

Edited: 30/06/2011 9:45am

^^ 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*

Avatar
swaiba

Forum Moderator, 1799 Posts

30 June 2011 at 7:14am

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