New answers tagged localization
I had the same problem. Twig files are not automatically recognized when you use Poedit to work on your translations. The section about Generating .po files using Poedit in the Timber Wiki might help you set it up to make it work. The Twig Gettext Extractor that is mentioned there didn’t work well for me. Definitely try the parser for Python, which is also ...
esc_html_e() and esc_attr_e() are merely wrapper functions for _ to save a little bit of typing and help with readability. You're right, there isn't one for _n, so you'll just need to do the "wrapping" yourself: printf( esc_attr( _n( '%s item', '%s items', $count, 'textdomain' ) ), ...
Use the first option. translated strings are supposed to be "raw", and escaped only by the calling function. In addition many will not understand what ' mean and how to translate it without looking at the actual page which can be annoying.
Top 50 recent answers are included