Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was unable to translate the options within a 'Single Choice radio' block created with Jetpack in WordPress. While the main question could be translated, the individual options such as 'Kitchen', 'Living Room' remained untranslated in WPML.
Solution:
We registered the radio buttons and checkboxes for translation by adding custom XML configuration to WPML. Here are the steps we followed:
1. Navigate to WPML-> Settings-> Custom XML Configuration tab.
2. Add the following code:

<wpml-config><br />  <gutenberg-blocks><br />    <gutenberg-block type="jetpack/field-radio" translate="1"><br />      <key name="label" /><br />    </gutenberg-block><br />    <gutenberg-block type="jetpack/field-checkbox" translate="1"><br />      <key name="label" /><br />    </gutenberg-block><br />    <gutenberg-block type="jetpack/field-option-radio" translate="1"><br />      <key name="label" /><br />    </gutenberg-block><br />    <gutenberg-block type="jetpack/field-option-checkbox" translate="1"><br />      <key name="label" /><br />    </gutenberg-block><br />  </gutenberg-blocks><br /></wpml-config>

3. Update the page and re-translate it.
For further guidance, check the guide on how to make custom Gutenberg blocks translatable.

If the solution provided does not apply to your case, or if it seems outdated, we highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If you still need assistance, please do not hesitate to open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 3 replies, has 2 voices.

Last updated by Osama Mersal 1 year ago.

Assisted by: Osama Mersal.

Author Posts
April 26, 2024 at 3:09 pm #15571151

jeremyL-22

I have created a survey in WordPress using the block available in the editor (Jetpack / WordPress). The translations are working fine except when I use a multichoice "Single Choice radio" block... In this situation, WPML translation tool gives me the possibility to translate the main question but the items of the list ("Single Choice Option" blocks) are not showing when I get to the translation... for example if I ask in the survey "Where are you?" and the options are "Kitchen", "Living Room"... In French, I can translate "Où es tu?" but the options of answers "Kitchen" "Living Room" remain in English as I can't manage to find them in WPML.

April 26, 2024 at 3:15 pm #15571154

jeremyL-22

please see my question above

April 28, 2024 at 2:04 pm #15574014

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for contacting WPML forums support. I'll be glad to help you today.

First of all, sorry for the late reply; it was due to a higher workload. Please go to WPML-> String Translation and search for these strings.

If you didn't find them, I would need to look closely at your site, so I would need to request temporary access (WP-Admin and FTP)
Preferably to a test site where the problem has been replicated.

Your answer will be private, meaning only you and I can access it.

❌ Please backup your database and website ❌

✙ I need your permission to deactivate and reactivate the plugins and themes and change site configurations. This is also why the backup is critical.

✙ I also need your permission to take a local copy of your site to debug the issue without affecting your live site.

Best regards,
Osama

May 2, 2024 at 10:09 am #15586557

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Thanks for the access details. I created a test page, added the form, and translated the page. (hidden link)

The radio buttons and checkboxes were not translated, so I registered them by adding the following code to WPML-> Settings-> Custom XML tab.

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="jetpack/field-radio" translate="1">
      <key name="label" />
    </gutenberg-block>
    <gutenberg-block type="jetpack/field-checkbox" translate="1">
      <key name="label" />
    </gutenberg-block>
    <gutenberg-block type="jetpack/field-option-radio" translate="1">
      <key name="label" />
    </gutenberg-block>
    <gutenberg-block type="jetpack/field-option-checkbox" translate="1">
      <key name="label" />
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

Kindly check this guide. (https://wpml.org/documentation/support/language-configuration-files/make-custom-gutenberg-blocks-translatable/)

After that, I updated the page and re-translated it. Kindly check the translated page. (hidden link)

If this is not the form you use, please add it to this test page, so I can check it.

Best regards,
Osama

May 10, 2024 at 5:43 pm #15616048

jeremyL-22

Thank you Osama, you have resolved the issue. It all works fine now.