[TYPO3-mvc] Problem with translate in f:form.select option

Sebastian Fischer typo3 at fischer.im
Wed Jun 9 15:50:34 CEST 2010


On 09.06.2010 14:54, Martin Kutschker wrote:
> Bastian Waidelich schrieb:
>> Sebastian Fischer wrote:
>>
>> Hi Sebastian,
>>
>>> <f:form.select name="data[delivery]" options="{
>>> pickup: '{f:translate(key: delivery_pickup)}',
>>> depositing: '{f:translate(key: delivery_depositing)}',
>>> shipment: '{f:translate(key: delivery_shipment)}'
>>> }" value="pickup" />
>>
>>> How could this be fixed? First solving answer wins a beer on the dev
>>> days ;)
>>
>> I'll take it:
>>
>> <f:form.select name="data[delivery]" options="{pickup:
>> '{f:translate(key: \'delivery_pickup\')}', depositing:
>> '{f:translate(key: \'delivery_depositing\')}', shipment:
>> '{f:translate(key: \'delivery_shipment\')}'}" value="pickup" />
>
> We need some alternative quoting (or allow the quoting to be omitted if no white space occurs in the
> argument). The backslashes make reading a view helper in short notation painful.
>
> BTW, while it is unclean I think it should be possible to omit the parameter name for a view helper
> in short notation when only one parameter is given (or define a fixed order as usual with functions).
>
> eg
> {f:translate(key: delivery_pickup)}
> becomes
> {f:translate(delivery_pickup)}
>
> Masi

Hi Masi,

+1 on reading specially for the last suggestion i would really like it 
to give only the key without any quoting. In translate case key with 
whitespaces aren't allowed so it wouldn't collide with any thing else.

Greetings
Sebastian


More information about the TYPO3-project-typo3v4mvc mailing list