Search code examples
angularjsgettexttext-extraction

How to extract translation for gettext. AngularJS (quotes wrapped by single quote)


This is how gettext extract translation:

<custom-tag custom-attr="{{'Edit page' | translate}}"></custom-tag> 

but how can I extract from this:

<custom-tag custom-attr='"Edit page"'></custom-tag>

seems the bellow one is wrong:

<custom-tag custom-attr='"{{\'Edit page\' | translate}}"'></custom-tag>

Solution

  • This is the way to extract text in such cases:

    <custom-tag custom-attr='"Edit page" | translate'></custom-tag>