Skip Navigation

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

Problem:
The client is trying to translate the header template using Divi Builder with WPML, but the URLs in the DonDivi DiviMenus Flex modules are not being translated and still point to the original language pages.

Solution:
1. Navigate to WPML-> Settings-> Custom XML Configuration tab.
2. Insert the following custom XML configuration:

<wpml-config><br />  <shortcodes><br />    <shortcode><br />      <tag>et_pb_divimenus_flex_item</tag><br />      <attributes><br />        <attribute>title</attribute><br />        <attribute>url</attribute><br />      </attributes><br />    </shortcode><br />  </shortcodes><br /></wpml-config>

3. Click "Save".
4. Edit the page/template in the default language and add the page's full URL.
5. Update the page/template.
6. Update the translation and search for the URL to ensure it's translated.

For further guidance, refer to our documentation on registering page builder modules.

If this solution doesn't look relevant, please 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 13 replies, has 2 voices.

Last updated by Osama Mersal 1 year, 2 months ago.

Assisted by: Osama Mersal.

Author Posts
October 24, 2023 at 9:18 am #14644637

olgaS-13

Tell us what you are trying to do?

I translated the header template, but this only offers the visible texts (not the URLs/links) for translation.

I also synchronized the menus (or more correctly: your support staff did because we failed), but the links on the translated site in den DonDivi DiviMenus Flex modules always point to the pages in the original language.

Do I need some custom XML configuration for this?

Is there a built-in way to translate the navigation with DonDivi DiviMenus?

Is there any documentation that you are following?

https://wpml.org/documentation/theme-compatibility/divi-builder/#translating-custom-global-header-footer

Is there a similar example that we can see?

The site is publicly visible here:

hidden link

If you select one of the items of the top navigation, the german (original language) page is selected.

(Welding technology, Surface technology, Special-purpose machine construction, Projects, Company, Careers, Contact)

But it should be the English translations.

What is the link to your site?

hidden link

Bildschirmfoto 2023-10-24 um 11.14.25.png
October 25, 2023 at 7:03 am #14657059

Osama Mersal
Supporter

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

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

Hi,

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

Please search for the URL in the translation editor search field. Kindly check our guide about translating URLs. (https://wpml.org/faq/how-to-translate-urls-shortcodes-and-html-attributes-using-the-advanced-translation-editor/)

Best regards,
Osama

October 25, 2023 at 7:31 am #14657391

olgaS-13

Hi Osama!

Thank you for your reply.

Unfortunately, this does not seem to work in this case.

I tried searching for various strings, but could not find anything (see attached screenshot).

I also tried e. g. searching for just a / character, also with no results.

Bildschirmfoto 2023-10-25 um 09.25.19.png
October 25, 2023 at 7:51 am #14657647

Osama Mersal
Supporter

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

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

Hi,

Please login to this sandbox site and install the "DiviMenus" plugin. (hidden link)

After that, please create a test header and translate it to replicate the issue. If the issue is replicable, please let me know how to reproduce it.

Best regards,
Osama

October 31, 2023 at 7:48 am #14697015

olgaS-13

Sorry for the delay, I've been occupied by other tasks the last couple of days.

I'll setup the sandbox as soon as possible.

October 31, 2023 at 8:34 am #14697331

Osama Mersal
Supporter

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

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

Hi,

Please take your time to replicate the issue. If the issue is replicable, please let me know how to reproduce it.

Best regards,
Osama

October 31, 2023 at 10:46 am #14698515

olgaS-13

Finally I've set the sandbox up with an example of the DiviMenus.

If you browse the homepage, you'll see 3 sample pages that can be selected from the main menu:

hidden link

(first image)

I added a translation to German, so if you switch to german the title on the page and the menu entries read "Seite" instead of "Page":

hidden link

(second image)

Now, if you click on any of the links in the menu (e. g. "Seite 2"), you are back on "Page 2" (english version).

To fix this, the URL in the menu would need to be translated from e. g. "/page-2/" to "/de/seite-2/", but it is not available and search does not produce it for me either:

(third image)

How can I translate these URLs?

Bildschirmfoto 2023-10-31 um 11.44.58.png
Bildschirmfoto 2023-10-31 um 11.40.54.png
Bildschirmfoto 2023-10-31 um 11.38.34.png
October 31, 2023 at 11:29 am #14699129

Osama Mersal
Supporter

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

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

Hi,

Thanks for replicating the issue. Please check the following steps:

1- Go to WPML-> Settings-> Custom XML tab
2- Add the following code

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>et_pb_divimenus_flex_item</tag>
      <attributes>
        <attribute>title</attribute>
        <attribute>url</attribute>
      </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

3- Click "Save"
4- Edit the page/template in the default language
5- Add the page's full URL and update the page/template
6- Update the translation and search for the URL. (Kindly check the attached screenshot)

Please check our guide about registering page builder modules. (https://wpml.org/documentation/support/language-configuration-files/#page-builder-content)

I've applied the above steps to the sandbox site, so please check if it works correctly.

Best regards,
Osama

2023-10-31_13-25-11.jpg
October 31, 2023 at 1:27 pm #14700117

olgaS-13

Hi!

Thanks! I'm almost there.

What's missing is the homepage link on the logo.

I added a logo to the sandbox to see.

In the sandbox example it would be necessary to translate "/" to "/de/" for the german homepage (or the respective full URL).

October 31, 2023 at 1:55 pm #14700655

Osama Mersal
Supporter

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

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

Hi,

Please let me know how this logo is added.

Best regards,
Osama

October 31, 2023 at 2:19 pm #14700843

olgaS-13

Hi,

the logo is configured in the DonDivi DiviMenus Flex settings of the Global Header.

Divi > Theme Builder > Global Header > Edit

there:

DiviMenus Flex Settings, tab "Content", group "Logo", property "Logo Link URL"

best regards

Werner

Bildschirmfoto 2023-10-31 um 15.17.32.png
October 31, 2023 at 2:44 pm #14701041

Osama Mersal
Supporter

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

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

Hi Werner,

I edited the custom XML to be the following:

<wpml-config>
  <shortcodes>
    <shortcode>
      <tag>et_pb_divimenus_flex_item</tag>
      <attributes>
        <attribute>title</attribute>
        <attribute>url</attribute>
      </attributes>
    </shortcode>
    <shortcode>
      <tag>et_pb_divimenus_flex</tag>
      <attributes>
        <attribute>logo_url</attribute>
      </attributes>
    </shortcode>
  </shortcodes>
</wpml-config>

Please check if that fixed the issue on the sandbox site.

Kindly note that you need to update the template in the default language after adding the custom XML.

Best regards,
Osama

October 31, 2023 at 3:33 pm #14701939

olgaS-13

Hi,

yes, this does the trick.

At least, if I use a full URL (including protocol and host).

It does not seem to work if the URL is only "/" (without the quotation marks) for site root.

Is there a filter in WPML preventing this 1 character string from showing up in the translation and if so can I have it ignore certain strings (so that I can translate "/" to "/en/" for example?

In general, I prefer to use site-relative links, since those are less headache when moving e.g. from staging to production servers.

best regards,
Werner

October 31, 2023 at 6:31 pm #14703277

Osama Mersal
Supporter

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

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

Hi Werner,

I'm afraid that the available workaround is to add the full site URL in order to translate it correctly in the advanced translation editor.

Best regards,
Osama

November 7, 2023 at 3:18 pm #14749029

olgaS-13

Ok, thanks!