Open nimasmi opened 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
Add data- attributes to GOOD_STRINGS File Changes
M django_template_i18n_lint.py https://github.com/rory/django-template-i18n-lint/pull/28/files#diff-a79e3ae1f1f57fd15fd90267bd89e815 (2)
M tests.py https://github.com/rory/django-template-i18n-lint/pull/28/files#diff-f4bc68ff01eef7bed2f3a64cad7d37ca (2) Patch Links:
https://github.com/rory/django-template-i18n-lint/pull/28.patch
https://github.com/rory/django-template-i18n-lint/pull/28.diff — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/rory/django-template-i18n-lint/pull/28, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAAAMC4LPQOU6VMQIXKRQRLSHSP5DANCNFSM4RZS234A.
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
Boolean data attributes (e.g. data-foo) should not be translated, whereas those which take values (data-title="foo") should be.