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.

Form Questions /

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

multilingual form messages


Go to End


2 Posts   1929 Views

Avatar
yurigoul

Community Member, 203 Posts

4 February 2010 at 2:27am

Hi,

I have a multilingual site (NL, DE, US) where NL is set as the default language, i18n.js is loaded but the contact form only uses sapphire/javascript/lang/en_US.js for the error messages, no matter what language I am in. The result is that all the messages on the form appear in US-English only ('Please fill out "Name*", it is required.' etc).

I have done my dev/builds and whatever and I put everything I could find regarding translatable, default languages, i18n in mysite/_config.php and everything else is working just fine (my http-equiv="Content-Language" says content="de-DE",
got a language menu that works and even got the google sitemap extension working for sitemap.xml in different languages - and used a sitemap-index.xml for my robots.txt with links to them all)

Anyone?

Avatar
yurigoul

Community Member, 203 Posts

4 February 2010 at 2:38am

GOT IT! Forgot to add:

public function init() {
		parent::init();

		if($this->dataRecord->hasExtension('Translatable')) {
			i18n::set_locale($this->dataRecord->Locale);
		}
}