internetstandards / Internet.nl

Internet standards compliance test suite
https://internet.nl
166 stars 36 forks source link

Perform a consistency check on content labels #1333

Open bwbroersma opened 4 months ago

bwbroersma commented 4 months ago

Perform a consistency check on labels, so typo's (referencing unknown labels) can be caught:

This might also show: unused labels.

Maybe this can be done in CI/CD with some new script in tools?

Related, not translated content:

bwbroersma commented 4 months ago

I did a poor mans check with grep in the repo (without pulling my AAAAA typo fix):

$ diff \
   <(grep --include \*.py -rhoP 'verdict.*[:=]\s*\K"([A-Za-z-0-9 ]{13,})"' | sort -u | tr -d ,) \
   <(grep -hoP 'msgid\s*\K"([A-Za-z-0-9 ]{13,})"' translations/nl/main.po | grep detail | grep -v ' exp"$\| label"$\| table"$' | sort -u) \
   | grep '^<' \
   | cut -c3-
"detail mail ipv6 mx-AAAAA verdict null-mx-with-other-mx"
"detail web ipv6 web-ipv46 verdict notice-status-code"

These are known / expected since they are linked to:

It would be nice to create a less bash implementation of this, e.g. (x)gettext, for some CI check, but I was unable to get that running in a short time.