schmittjoh/JMSTranslationBundle — Issue #22: The twig 'desc' filter does not work with the 'transchoice' filter
Author: buschjost
Created: 2012-01-26 16:20:08+00:00
State: open

According to the example in the readme file the descfilter should work with transchoice.

However, this is not working. One problem lays in file DefaultApplyingNodeVisitor:51 where the code only tests for 'trans' which results in the runtime exception in line 56 beeing thrown.
However, just allowing 'transchoice' in line 51 as well does not solve the issue as after that any call to the template results in an Exception: 'An exception has been thrown during the rendering of a template ("Unable to choose a translation.")'

I think there is some additional handling required for injecting the translation into the nodes in the transchoice case.

The used example code:
```twig
{% set count = 0 %}
{{ "text.apples_remaining"|transchoice(count)|desc("{0} There is no apple|{1} There is one apple|]1,Inf] There are %count% apples") }}
```