Kdyby / Translation

Integration of Symfony/Translation into Nette Framework
https://packagist.org/packages/kdyby/translation
Other
88 stars 84 forks source link

PrefixedTranslator and Phrase not working together #73

Closed Aurielle closed 9 years ago

Aurielle commented 9 years ago

I'm having an issue using PrefixedTranslator and Phrase together (I'm attempting to translate flash messages with parameters). The issue is that here the magical method __toString() on Phrase gets activated, thus the translator discards any parameters Phrase carries and translates only the message.

I'm not sending PR yet because I have to attempt to fix it first and don't know how it would turn out.

Aurielle commented 9 years ago

I see no easy fix for this. Phrase wants Translator directly, a temporary walkaround would be to require ITranslator instead, or just translate Phrases with normal, unprefixed Translator (which works, but is kinda pointless).