Skip to content

Conversation

@Nyholm
Copy link
Member

@Nyholm Nyholm commented Jan 6, 2018

We save the desc filter when exporting, and we do also fallback to that filter when the current translation is empty...

Hm... our desc filter works likes default. Not sure if this is correct.

This will fix #153


I chose to not reuse the TranslationFilter in the php-translation/extractor because I would like the bundle to be decoupled from the extractor as much as possible.

@Nyholm Nyholm requested a review from damienalexandre January 6, 2018 15:20
@mvrhov
Copy link
Contributor

mvrhov commented Jan 6, 2018

It should not work as a default. In debug mode it should show the content of desc, if trans returns what was passed to it (This means, that there is no translation for that string). In production everything should behave like there is no desc filter, to not slow down the production e.g the call to desc filter should be removed.

@Nyholm
Copy link
Member Author

Nyholm commented Jan 6, 2018

But then we need to use a custom Translator, right?

@mvrhov
Copy link
Contributor

mvrhov commented Jan 7, 2018

JMS uses a custom Node visitors, to add / remove code when compilation is done.

@Nyholm Nyholm merged commit d9d0404 into master Jan 14, 2018
@Nyholm Nyholm deleted the desc branch January 14, 2018 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Twig filter] Add 'desc' twig filter

3 participants