Base fields across the project declare their allowed_values labels as plain PHP strings, and nothing translates them: OptionsWidgetBase::getOptions() reads the setting and sanitizes it, so the label reaches the select exactly as written. A French site shows "The full price" under a French label and description, and the string is never extracted for translation either, since no translation function ever sees it.
Seventeen option lists are affected, across eight files: the booking state; the resource's booking mode, booking cutoff, lead time unit, refund gate and cancellation deadline unit; the payment collection mode, deposit handling, refund gate and refund deadline unit; the calendar's availability display and selection mode; the manager grant scope; the node display mode; and the ticket switch. The pattern to follow is already in the project: the resource's settlement field and every Kessai state list wrap their labels in TranslatableMarkup.
Fixed by wrapping every option label, and by adding a kernel test that walks the base fields of every yoyaku entity type and fails on any label that is not a TranslatableMarkup, so the next plain string is caught before it ships rather than being noticed on a translated screen.
Note for the release notes: option labels live in the installed field storage definitions, so a site that installed before this change will report those fields as needing an update until it reinstalls. Pre-1.0, so no update hook.
Issue fork yoyaku-3614403
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 commentedComment #7
mably commentedMerged to 1.x as
39bd4f0.The fix went wider than the title first said, which is why the issue was rewritten: the same plain-string labels were in seventeen option lists across six modules, not just the two payment fields.
OptionLabelsTranslatableTestnow walks the base fields of every yoyaku entity type, so a new plain string fails a test rather than reaching a translated screen.One correction to the note above about the release notes: no field update is needed after all. Core flags a field only when its storage schema changes, and an option label does not affect the schema, so an existing site picks the translated labels up with nothing more than a cache rebuild.