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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

$SearchForm didn't translate to other languages

Go to End

3 Posts   1800 Views


Community Member, 134 Posts

10 May 2010 at 8:49am


This might help somebody. After doing a FulltextSearchable::enable(); in _config.php I got the $SearchForm up and running in the blackcandy theme.

However even though I've enabled i18n and translatable the word "Search" wasn't translated. I had a look into the sapphire folder and there is a file called: ContentControllerSearchExtension.php with a function called SearchForm. Inside this form the _t()-function hadn't been used and that caused the problem.

Here is how the function looks after a few corrections that made it work:

	 * Site search form
	function SearchForm() {
		$searchText = isset($_REQUEST['Search']) ? $_REQUEST['Search'] : _t('SearchForm.SEARCH', 'Search');
		$fields = new FieldSet(
			new TextField('Search', '', $searchText)
		$actions = new FieldSet(
			new FormAction('results', _t('SearchForm.GO', 'Search'))
		return new SearchForm($this->owner, 'SearchForm', $fields, $actions);



Forum Moderator, 801 Posts

11 May 2010 at 9:30pm

Fixed in r104596, that was an oversight on our part, sorry about that! In general, you have better chances of your patch being noticed if you put it up on


Community Member, 134 Posts

11 May 2010 at 9:50pm

Ok, will do that in the future...