I have an array:
[
0 => 'translate.label1',
1 => 'translate.label2',
2 => 'translate.label1'
]
which I specify as a choices
param for field creation.
Now, is it possible to sort these options by translated labels? For example, label1
translated value is zero, label2
- something, label3
- abracadabra. Of course, I expect select options to be:
- abracadabra
- something
- zero
I thought to use this approach: https://stackoverflow.com/a/21586886/2324004
But doesn't it involve second translator digest inside view? Any ideas? I'd rather to use something more flexible because my form is based on non-fixed selects count and it would have executed something recursive...