François Lefebvre François Lefebvre - 3 months ago 45
HTML Question

How to parse Timber (twig) templates with poedit and detect quoted strings to translate

I want to parse twig templates for Timber with poedit and I need to translate quoted contents. The problem is that I can't find a parser that does not skip quoted content.

Example:

<htmltag attribute="{{ __('value','textdomain') }}" />


Does someone know of a parser for poedit that detects quoted content, like html attribute content?

Answer

The workaround I found is to set a variable and use it as my attribute value.

{% set attr_value = __('value', 'textdomain') %}
<a href='{{ attr_string }}'>link</a>
Comments