Files
Adam Daley c6992931bc Add open-source gettext extractor and translation source check (#4353)
* Add open-source gettext extractor and translation source check

Replaces the manual Poedit Pro step for regenerating messages.pot.
The extractor covers Twig |trans literals and PHP __trans /
__pluralTrans / exception keywords, mirroring the historical Poedit
runs (validated against the May 2026 messages.pot: only obsolete
fossils differ). Also adds an informational per-PR check reporting
msgid changes, as gettext matching is case-sensitive and casing-only
changes silently invalidate translations.

* Remove AI slop from extractor and workflow

Drop the unused function, unused parameters, unreachable branches,
restating comments and oversized docstring. No behavior change:
output verified byte-identical.

* Fix actions/github-script pin to a resolvable SHA

* Refresh i18n POT header and check label

* Rename translation workflow title

* Run translation source check on ubuntu-slim

* Ignore Python bytecode cache in scripts dir

* Address review: plural edge case and workflow injection

Skip __pluralTrans calls without a complete static plural instead
of emitting a misleading singular entry. Pass the pot diff to the
comment script via env to close the template-injection vector.

* Address review: one-to-one casing match and comment pagination

Consume each removed msgid at most once when pairing casing-only
changes, and paginate issue comments when locating the sticky
check comment.

* Address review: string-content calls, concat fragments, plural diff, credentials

Ignore keyword-like text inside PHP string/heredoc content, skip
concatenated first arguments instead of recording untranslatable
fragments (13 such fragments dropped from current output), report
plural changes across casing pairs, and set persist-credentials:
false with a non-failing comment step for fork PRs.

* Skip PHP string-content matches and fix heredoc terminators

Track string/heredoc spans during comment masking and ignore
keyword-like text inside them; also accept comma-terminated
flexible heredocs. Removes phantom refs and entries, keeps real
calls with correct line numbers (verified: timeago entries
intact, May-validation residuals all still excluded-path
fossils or untranslatable fragments).
2026-09-19 07:32:22 +01:00
..