Problem/Motivation
On a site that also runs a payment engine, the inbox offers its claim action in French as Prélèvement (a direct debit) instead of S'attribuer. The word is right for a payment engine and meaningless for a task inbox.
The cause is not a wrong translation in this project. orchestra_inbox already ships the correct French:
modules/orchestra_inbox/translations/fr.po:msgid "Claim"=>msgstr "S'attribuer"
But locale keeps one string table per site, so a source string that two projects translate differently has a single row, and whichever imported last wins. On the affected site that row is lid=18244 with an empty context, holding Prélèvement, and t("Claim") in French returns it. The inbox link at TaskActions.php asks for $this->t("Claim") and gets the other project's word.
scripts/check-translations.php already describes this exact failure in its own documentation, including the remedy: "Where the same English means two things, a translation context makes them two strings and each keeps its own French." The script cannot detect it, because it reads one project's catalogues and the collision is with another project.
Proposed resolution
- Give the inbox action a translation context, so claiming a task and drawing on a payment are two strings:
$this->t("Claim", [], ["context" => "Task"])inTaskActions. - Add the matching
msgctxtto theClaimentry inorchestra_inbox's catalogue, keeping S'attribuer as its French.
The English is unchanged, so the functional tests that click the Claim link keep working untouched.
A companion change on the payment engine gives its own Claim a context too, so the bare string belongs to neither project and no third module inherits either meaning by accident.
Remaining tasks
After deploying, the catalogue has to be re-imported so the single row splits into two: the contextless row and the new contexted one.
AI-Generated: Yes (Claude Code was used to diagnose the collision against the site's locale tables, to draft this issue summary, and to write the change. The diagnosis was confirmed by reading the stored string row and the French value t("Claim") actually returns.)
Issue fork orchestra-3624941
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
mably commentedComment #5
mably commented