Issue
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?
Solution
The workaround I found is to set a variable and use it as my attribute value.
{% set attr_value = __('value', 'textdomain') %}
<a href='{{ attr_value }}'>link</a>
This way, the PHP and Python parsers work, as suggested in the Timber documentation.
Using Twig-Gettext-Extractor, I get a Twig-Error-Syntax because of unrecognized __() function.
Answered By - François Lefebvre Answer Checked By - Gilberto Lyons (PHPFixing Admin)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.