How to translate a field group?

Dear all,

How can I translate a field group ?
E.g. on https://test-voisins2.web.cern.ch/universe-particles-exhibition I need to translate “See the map” by “voir la carte” ?

Thanks for your help!

Cheers,
Marie

Dear Marie,

It seems that the field is not translatable and comes from the iframe. The module itseld should provide a translation method for that field or to provide translation itself.

I tried to update the French language pack for your website but unfortunately it didn’t solve the issue with the field.

I am afraid that this field is not possible to be translated unless we hack the module’s code which I don’t advise because after you wouldn’t be able to update it to newer versions.

Hi Sotirios,

The field is not related to the module.
Here is how I added it:
Content type > Offer > manage display > Add field group > Field group label > “See the map”

Does that help?

Cheers,

Marie

Hi Marie,

That’s right. I missed it because it is a group field that can been added in Manage display and it doesn’t exist in the Fields’ list. I thought it was coming from the module.

I did a little digging and I found out that there is a bug with the Group field module and it doesn’t allow you to translate the label.

Fortunately there is a patch and since the module is installed in the central infrastructure I will ask Drupal admins to apply it.

Once it has been applied you will be able to translate the label then. I will let you know.

@eduardoa and @kosamara could you have a look at the following patch https://www.drupal.org/project/field_group/issues/3111107 and apply it to the infra?

Hello,

The suggested fix is not recommended by the community, as explained on the Drupal.org issue page, since this can cause long term problems and issues in the future.
According with the field group module maintainers the proper way to translate field group labels is using Config translation, but as far as I can see on their discussion (https://www.drupal.org/project/drupal/issues/2546212) this also require a patch that has not yet completed.

So my suggestion is to workaround this if possible, probably by rendering this field link in a different way. Perhaps web-team have some suggestions for that.

Regards,
Eduardo

Thank you Eduardo!

Marie, for the reasons that Eduardo mentioned they can’t apply thhee patch centrally. EIther you have to live with the field’s label in English, find another workaround or if it is really necessary to have it in this way I can install the module and apply the patch locally to your website.

If you go with the solution of the locally installed module, you will be responsible for its maintenance. You should update it to newer versions especially when there is a security update and you will have to apply the patch again if a fix is not included in the new version.

Let me know what you decide.

Thank you to everyone for checking this out.
Does anyone know another way to add a field that is not displayed as open by default without using the field group?

It could be done but not in an easy way if you don’t know coding.

I recommend to leave it as it is. Maybe the next version of the module includes the patch for translations.

I don’t advise to maintain a piece of code yourself for something like this.