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.

Blog Module

Discuss the Blog Module.

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

Template i18n


Reply

5 Posts   2408 Views

Avatar
Henk Poley

30 March 2009 at 2:34am (Last edited: 30 March 2009 10:53am), 30 Posts

Somehow the translation of the blog templates doesn't work. I do have the files in blog/lang/*.php, and they contain the right references to the templates. But everybody sees the blog controls in English. Our CMS is still translated, so it doesn't seem to be a global problem.

Anybody knows what's going on?

Avatar
Henk Poley

30 March 2009 at 10:57am 30 Posts

Or is there some sort of override to always use nl_NL i18n? Basically all my traffic is Dutch anyways.

Avatar
Henk Poley

31 March 2009 at 1:07am 30 Posts

How I fixed it..

Part 1:
Old tutorials apparenly only wrote about enable(), set_default_lang() and using 'nl'. Full code for in mysite/_config.php

// Enable Translations
i18n::enable();
i18n::set_locale('nl_NL');
i18n::set_default_lang('nl_NL');

Part 2:
http://open.silverstripe.com/ticket/2102#comment:2
This also needs a lot of extra language files and strings for your widgets.

Avatar
Henk Poley

31 March 2009 at 3:17am (Last edited: 31 March 2009 3:35am), 30 Posts

Part 3:
A patch that fixes included (<% include .. %>) templates source, so their i18n translation strings are sourced from the right namespace:
http://open.silverstripe.com/ticket/3400

Avatar
Kalileo

1 May 2009 at 6:08pm (Last edited: 1 May 2009 6:11pm), Community Member, 127 Posts

Thanks Henk, I should have seen that before I patched all the templates concerned and added the "identifier>.ss." to the "_t(<i18n-name>, <string>)" calls.

Testing and including your patch as fast as possible in the released version is a must for SS if they care about the International - non English speaking country - users. Most normal users will not be able to fix this, or workaround, and then it is a showstopper.