Skip Navigation

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.

Elementor users - please update WPML to the latest version to maintain compatibility. More details here - https://wpml.org/changelog/2024/12/wpml-4-6-15-critical-update-for-elementor-sites/
Sun Mon Tue Wed Thu Fri Sat
9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 - -
14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 - -

Supporter timezone: Asia/Jerusalem (GMT+02:00)

This topic contains 0 replies, has 0 voices.

Last updated by Itamar 1 week, 2 days ago.

Assisted by: Itamar.

Author Posts
December 11, 2024 at 6:32 pm #16505117

ladislavM

Background of the issue:
I am trying to register custom fields for my widget dynamic_widget using the wpml-config.xml file. Despite following the documentation, the fields are not showing up for translation in the WPML String Translation panel. This is the content of my wpml-config.xml file: header content[title] content[subtitle] content[text] content[image_1] content[image_2] content[link] I have followed the official WPML documentation for the wpml-config.xml: https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/

Symptoms:
The header field does not appear in the String Translation interface. The dynamic fields (content[title], content[subtitle], etc.) are also not being registered for translation.

Questions:
Why are the custom fields not showing up for translation in the WPML String Translation panel?
Is there an error in my wpml-config.xml file that prevents fields from being registered?

December 11, 2024 at 7:54 pm #16505357

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi,

Looking at the screenshot you shared, it seems you did it incorrectly. I also want to ask you how did you create the dynamic_widget. Please give me access to your site, and I'll help you further. Please explain to me how to add this widget to a page.

If you need further help with this, please share the access details to your site with me. I'm enabling a private message for the following reply.
Privacy and Security Policy
We have strict policies regarding privacy and access to your information. Please see:
https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/
**IMPORTANT**
- - Please backup the site files and database before providing us access. --
-- If you have a staging site where the problem can be reproduced, it is better to share access to the staging site.--

Regards,
Itamar.

December 13, 2024 at 8:50 am #16510464

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Juraj.

Thanks for the access details. However, I can access your site. I get Access forbidden! Please see the attached screenshot.

About the dynamic-content-center-line-widget file. I'm sorry, but debugging custom code is out of the scope of our support forum. I can't check what's wrong with your dynamic-content-center-line-widget.php file. If you need further help with your PHP code, I would suggest you consider contacting one of our certified partners from this link: https://wpml.org/contractors/
Before doing so, please have a look also here:
https://wpml.org/documentation/about-wpml-contractors/what-type-of-work-you-can-expect-from-contractors/

To help you configure the wpml-config.xml, I suggest you use our Multilingual Tools plugin. You can read about it here: https://wpml.org/documentation/support/multilingual-tools/
It is a free add-on for testing your plugin and theme compatibility with WPML. You can also generate language configuration files with it.

Please let me know if you have any further questions.

Regards,
Itamar.

2024-12-13_10-20-04.jpg
December 13, 2024 at 9:06 am #16510523

ladislavM

Hi Itamar.

Thanks for your response.

Access is now allowed. There was a block in the .htaccess.

Could you please at least check why my wpml-config.xml is not working? Why does it not register texts using <widget>?

Best regards.
Juraj

December 15, 2024 at 7:28 am #16514434

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Juraj.

I'm sorry, but I still can't access your site. I get this message:

Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.

Error 500

Please see the attached screenshot.

Have you tried my suggestion to use our Multilingual Tools plugin?

**** Important! You should not use this tool on a production site; you should only use it on a development site. Take a backup of your site before you use this plugin!!!****

I also want to repeat that according to what I can see in the screenshot you shared, your WPML configuration code is wrong.
Are you trying to create a custom Elementorm Beaver Builder, SiteOrigin, or Cornerstone widget?
If so, please carefully read the guide you are already familiar with.
https://wpml.org/documentation/support/language-configuration-files/how-to-register-page-builder-widgets-for-translation/
For this guide, here is an example of what the XML code should look like.

<wpml-config>
    <elementor-widgets>
        <widget name="heading">
            <conditions>
                <condition key="widgetType">heading</condition>
            </conditions>
            <fields>
                <field type="Heading" editor_type="LINE">title</field>
                <field type="Heading: Link URL" editor_type="LINK">link>url</field>
            </fields>
        </widget>
    </elementor-widgets>
</wpml-config>

If you are creating a shortcode, the XML code should, for example, look like this:

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>goodmorning</tag>
      <attributes>
        <attribute>name</attribute>
        <attribute>type</attribute>
      </attributes>
    </shortcode>
    <shortcode>
      <tag label="Fanpage shortcode">fanpage</tag>
      <attributes>
        <attribute>link</attribute>
        <attribute>id</attribute>
      </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

If you created custom fields, the XML should, for example, look like this:

<wpml-config>
  <custom-fields>
     <custom-field action="copy">quantity</custom-field>
     <custom-field action="translate">custom-title</custom-field>
     <custom-field action="copy">weight</custom-field>
     <custom-field action="copy-once">bg-color</custom-field>
     <custom-field action="translate">custom-description</custom-field>
     <custom-field action="ignore">date-added</custom-field>
  </custom-fields>
</wpml-config>

Here are more helpful guides you should check.

https://wpml.org/documentation/support/language-configuration-files/

https://wpml.org/documentation/support/language-configuration-files/translate-custom-shortcodes-with-wpml/

https://wpml.org/documentation/support/language-configuration-files/custom-fields-translation-options/

Regards,
Itamar.

2024-12-15_09-04-05.jpg
December 17, 2024 at 3:27 pm #16522513

ladislavM

Hi Itamar,

Sorry for the late response.

I have fixed the .htaccess file, and the site is now running.
Please note: the website is currently in construction mode.
You can use the login page here:
hidden link

I also reviewed the examples you provided and checked the setup. However, the WPML configuration for the widget is not functioning as expected.

I used 'custom-field' for my custom widget. The widget name is "dynamic-widget". Could you let me know if this is correct?

Could you please take a look at it?

Thank you for your help!

Best regards,
Juraj

2024-12-17_16h20_49.png
December 19, 2024 at 4:53 pm #16531193

Itamar
Supporter

Languages: English (English ) Hebrew (עברית )

Timezone: Asia/Jerusalem (GMT+02:00)

Hi, Juraj.

I've accessed your site. Then, to test this issue, I created a new test page. You can see it here.

hidden link

Then, I wanted to add the "dynamic widget," but it was not found in the SiteOrigina Editor. Please see the attached screenshot.

How can I add your custom widget?
Please provide me with the exact steps and add screenshots.

Regards,
Itamar.

2024-12-19_18-48-51.jpg