Problem/Motivation
When a group has a translation, the group name is properly displayed in the select list but the translated value does not display after the group has been selected.
Steps to reproduce
1. Set up a site with translations with at least one additional language
2. Create a group with multiple languages
3. Set the user's language to the alternate language
4. Create a node with a form field that is "Group select"
5. Select the Group (which has the localized name) from the dropdown menu
6. Save the node
The group name displayed is not the localized value for the language of the user
Proposed resolution
See patch (note this is the same method the select field's options use)
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | 3302321-3.patch | 1.25 KB | dww |
Issue fork entitygroupfield-3302321
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:
- 3302321-2x-translate-group-name
changes, plain diff MR !25
Comments
Comment #2
bbeversdorf commentedComment #3
dwwThanks for the issue and the patch! I was able to reproduce this. The patch worked as advertised.
However, in local testing, I also tried deleting a group association via the widget, and in that case, the group name is once again displayed in the original language, not the translation.
So here's an updated patch that handles both.
Comment #4
dwwAlso, while it'd be great to have tests for this, there aren't currently any translation-related tests, and I'm not going to require them to move forward here. 😅
Comment #5
dwwI want to get this in before next round of releases. First, need to make it an MR and ensure pipelines are still cool.
Comment #7
dwwComment #11
dww