How to programmatically determine that a string in a template doesn't translated? I mean a case when a message doesn't enclosed by {% trans %}
or trans()
.
Like here:
<h1>Hello, world</h1> - miss trans tag
Actually, I have really much amount of templates in my applications and I need to know which message and in which template I could missed a trans tag.
You could use a screen scraping/html parser library such as Beautiful Soup. Here's an SO article on how to use it with a local HTML file.
However, unless you're going to be using this quite often (or it's a massive project) I'd imagine it would be less work to just look through the files manually.
I suggested BS since it's Python and it might be closer to PHP for you but there's also JSoup or HTML Agility Pack. I looked around, but don't see any HTML linters that also check for potential localization...
Edit: I also found this Stack Overflow post with suggestions for PHP specifically.