Issue #3614057: Let potx extract the wrapped Drupal.t() calls, translate the 94 missing strings, and drop the 81 dead ones

Brings the French translation into line with reality, in both directions. Audited with potx, the extractor localize.drupal.org actually runs, after an in-house scan proved unreliable.

1. Nine JavaScript strings never reached the template

potx skips a Drupal.t() or Drupal.formatPlural() call when the last argument is followed by a comma. That is exactly what Prettier emits under core's .prettierrc.json ("trailingComma": "all") once a call is long enough to wrap, so the code was correctly formatted and simply unreadable to the extractor. It is not the line wrapping: both potx regexes use the s modifier, so a multi-line call parses fine without the comma.

Affected: the calendar's Select at least/at most N day(s) and N day(s) selected messages, the place map's empty-selection hint, and both check-in camera fallbacks.

Six call sites are marked // prettier-ignore with the trailing comma dropped, each carrying a note pointing at the upstream issue so the directive is not later removed as noise. In the two ternary branches Prettier insists on placing the comment after the ?/:; that placement is kept, since the directive still applies and the alternative is restructuring working code.

Upstream: potx #3164803, open since 2020. The current 2.0.0-alpha2 does not fix it, since its trailing-comma allowance sits inside the optional arguments group and these calls have no arguments object. Core is affected too, for example Drupal.t('Changed',) in core/misc/tabledrag.js. The directives come out once potx is fixed.

2. Ninety-four strings had no French translation

With extraction fixed, the template carries 1,166 strings and fr.po covered 1,072. The gap was almost entirely strings a hand-rolled scan does not look at: config schema labels, module names and descriptions shown on the Extend page, and operational log messages. All 94 are translated, following the terminology already established in the file (Passerelle, Nom machine, Paramètres, tenant, billet, réservant).

3. Eighty-one dead entries removed

fr.po also carried entries whose source string no longer exists anywhere in the module, mostly left over from the checkout simulator that moved out to kessai. Each was judged by searching the whole source tree for the literal string rather than by asking the extractor, so an entry was removed only when nothing in the module references it.

The 43 entries that the template does not carry but that do still appear in source are kept deliberately: they are shipped config labels and similar, reached through channels potx does not scan, and dropping them would lose live translations.

Verification

Measured with potx 1.1.0, the version drupal.org runs, not a patched copy:

before after
JS strings extracted 63 of 72 72 of 72
template strings untranslated 94 0
dead .po entries 81 0

prettier --check with core's config passes on all three JavaScript files. msgfmt --check-format passes on the .po.

Edited by Frank Mably

Merge request reports

Loading
Loading