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.

Upgrading SilverStripe /

Ask questions about upgrading SilverStripe to the latest version.

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

Problems with HTMLCode in $lang after Update


Go to End


2 Posts   1658 Views

Avatar
theTigerDuck

Community Member, 20 Posts

9 September 2010 at 3:03am

Hi,

I have in my language file this:

$lang['de_DE']['Statistik']['ANDERESAISON'] = 'Andere Saison anzeigen  ';

and then I'm using that:

$filter = new DropdownField('Saisonauswahl', '', $return, '','' , _t('Statistik.ANDERESAISON','Andere Saison anzeigen  '));

after update the generated code is like this:

<fieldset class="top-form">
			<select class=" nolabel" id="CustomSeasonChooseForm__Saisonauswahl" name="Saisonauswahl"><option selected="selected" value="">Andere Saison anzeigen&amp;nbsp;&amp;nbsp;</option><option value="/spielplan-u23/2009/">2009/10</option><option value="/spielplan-u23/2010/">2010/11</option></select>
			<button onclick='changeSeason();return false;'>anzeigen</button>
		</fieldset>

So it's &amp;nbsp;&amp;nbsp; instead of &nbsp;&nbsp;

Anyone?

Avatar
Ingo

Forum Moderator, 801 Posts

20 September 2010 at 8:54am

DropdownField doesn't support filling HTML into <select> boxes (see Convert::raw2xml() call in DropdownField->Field()). This is not an i18n issue - try to output the string directly, it should come out as a HTML entity properly.