Problem/Motivation
Field groups are present at many forms in open social. Especially on groups and group content. But there are critical issues when you want to translate them.
As field groups are config, It is clear to translate them trough the config ui rather the interface translation. But we have found several places where social translate field groups with the t() function which is wrong.
The issue was also hard to track, because "Social" manipulates the field groups via code.
Example form the social_group.module
$change_fieldgroup_titles = [
'group_topic_visibility',
'group_event_visibility',
];
foreach ($change_fieldgroup_titles as $fieldgroup_title) {
if (isset($form['#fieldgroups'][$fieldgroup_title])) {
$form['#fieldgroups'][$fieldgroup_title]->label = t('Access permissions')->render();
}
}
As you can see, the field group label will be changed with t(), which is wrong. There are several other places where this seems to happen.
Steps to reproduce
Visit an entity form display for a group or group content. Try to translate the field group label. You will recognize that no matter what you do, the field group labels will be always switch back to the strings transalted via interface translation.
Proposed resolution
Please avoid translating config with interface translation.
Comments
Comment #2
globexplorer commentedComment #3
ronaldtebrake commentedThanks for reporting!
I agree that can be improved, but admit we might not have the resources to work on this in the very near future.
Comment #4
chriszz commentedOkay - I understand. We would not have time to work on this right now - but we might as well put somebody on it in the future - if there would be somebody willing from the OS team to explain the rational behind those choices - and map out locations of all those things.
We have to solve this better sooner as later - as it harms translatability.
Comment #5
chriszz commentedmaybe if you take half a day of dev-time to document locations and rational - probably you have that already and just need to link it here - this might inspire other developers to help...