amandasaurus / django-template-i18n-lint

Lint tool to find non-trans/blocktrans text in django templates
http://www.technomancy.org/python/django-template-i18n-lint/
BSD 3-Clause "New" or "Revised" License
69 stars 36 forks source link

Add data- attributes to GOOD_STRINGS #28

Open nimasmi opened 4 years ago

nimasmi commented 4 years ago

Boolean data attributes (e.g. data-foo) should not be translated, whereas those which take values (data-title="foo") should be.

amandasaurus commented 4 years ago

I haven't touched django in years, so I haven't done anything with this project. I don't have the set up to test this now. So... 🤷

On Fri, 25 Sep 2020, at 4:08 PM, Nick Smith wrote:

Boolean data attributes (e.g. data-foo) should not be translated, whereas those which take values (data-title="foo") should be.

You can view, comment on, or merge this pull request online at:

https://github.com/rory/django-template-i18n-lint/pull/28

Commit Summary

nimasmi commented 4 years ago

That's okay. The diff here isn't really anything Django-specific. It adds a regular expression to include data attributes like data-foo among other Booleans. I'd say that assessing this diff requires more understanding of HTML and regular expressions than Django.

Demo: https://regexr.com/5ctp0