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 thread is resolved. Here is a description of the problem and solution.

Problem: The user was having issues with some icons urls in an Elementor page Solution: It seems that's a compatibility bug that could be fixed with some PHP code. check https://wpml.org/forums/topic/string-translations-keep-changing-even-after-saving/page/2/#post-4512105

This topic contains 13 replies, has 2 voices.

Last updated by Jamal 1 month, 1 week ago.

Assigned support staff: Jamal.

Author Posts
August 26, 2019 at 2:32 pm #4459785

patrickS-68

Hello !

First, will my site links be shown ? If so, is it possible for them to be hidden? Thank you.

My problem : I use Elementor and WPML to translate my French (default) site to English and Spanish. I have images on my Product pages that link to other product pages (see screenshot 1). Unfortunately these aren't supported by WPML, so when I go to Translate Editor of the page, I can only translate the text but not the associated link (see screen shot 2). To go around this, I go to the page in each language and manually edit the link in the page builder. For some reason though, the links keep changing back, making me think somewhere in WPML there is an override. So I checked String Languages, found the right links and manually changed and saved here. But even with this, the links change back once I refresh the page ! It also seems specific to 3 pages (Email, Pay and SMS) that have odd links. For example, on a Spanish version of Voice :
- hidden link
- hidden link
- hidden link

Link to a page where the issue can be seen: all product pages like hidden link at the bottom of the page.

If you have any idea how to fix this it would be great ! Constantly manually changing them isn't a viable solution. I have also emptied all my caches (WPML, disable WP Super Cache) etc.

Thank you

August 26, 2019 at 3:14 pm #4460099

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hi,

Please follow the instruction on my private reply(AUGUST 26, 2019 AT 3:14 PM) to migrate your website.
Once the migration is done we'll continue our analysis and get back to you.

Best regards,
Jamal

August 26, 2019 at 5:46 pm #4460625

patrickS-68

Hello ! The migration was succesful !

August 27, 2019 at 12:20 pm #4466411

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

The migration finished successfully. From my tests I was able to edit manually the translation to add proper links(Email link) and the change was not overwritten. Maybe I need to perform additional actions to reproduce the issue. Or maybe there is a cache in your server that still keeps the erroneous links and overwrites the translation.

On the other hand, I think that the links should be translatable through the Translation Editor rather than using manual translation. I would escalate this to our developers if you help reproduce it in a clean install. If you would be ok, please use the following link to login into our server.
hidden link

Configure WPML similarly to your website(Fr=>en and es), create a couple of pages (/produits/email and /produits/sms) and translate them. Then create a page and use similar icons and links to reproduce the issue(links are not translatable in Translation Editor). As soon as you did, I will ask our compatibility team to analyse and fix this.
This way we can resolve the root issue(translate links through Editor) and deploy it to your website.

Thank you,
Jamal

August 28, 2019 at 8:34 am #4472205

patrickS-68

Good morning Jamal !

I had emptied all caches (elementor, wp, emptied and disabled WP SuperCache). I changed the URLs manually the other day and they have switched back, which I'm sure is because of the links in the String Translations. When I search for the those links, and click "Translations" like in the first screenshots, the links are incorrect. I fix them and save, but the second I refresh, they return to the incorrect links which is what I think is what overwrites the corrections made manually in the page builder. But I don't know what could override this section of WPML and I don't understand where these links come from either as I checked the permalinks of each page and they were correct. Is there somewhere else we could look ?

Also, I built a page with the same building blocks as products/sms in the sandbox version. When I went to translate, I was able to translate the links of the images (unlike with my site), but the links given to the H2 titles weren't available to translate.

I'm not sure what could cause this, I compared with my original site and the widgets are the same.

Thank you for your help !

August 28, 2019 at 10:34 am #4473407

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hi,

The strings you see in String Translation are registered under a domain name like "Elementor-285" where 285 is the page ID. This is how WPML stores translations for fragments of page builders. Updating these strings translation should not be reflected in the frontend. The package strings are only used inside WPML Translation editors. Then the translation is saved as a regular WordPress(Elementor) page.

I can suggest translating the page again by following the steps below:
1. Switch to pages list in the secondary language(English).
2. Remove the translated page then remove it completely from trash(this is an important step)
3. Remove the original page package from WPML->Packages with the page ID
4. Translate again the page.

I can also suggest to build another page and translate it. In the meantime, I am approaching our 2nd Tier for assistance on this issue.

Best regards,
Jamal

August 28, 2019 at 4:53 pm #4476073

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

I escalated the ticket to our 2nd Tier team for further analysis. I would like to ask you again for login credentials, unfortunately, they were removed from the Chat session.

Thank you,
Jamal

August 29, 2019 at 3:30 pm #4482315

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Thank you,

Our 2nd Tier suggested running the "Translate target links" in WPML->Settings. The process is running for an hour ago. Still running. I will report again when it is finished.

Best regards,
Jamal

August 29, 2019 at 3:33 pm #4482385

patrickS-68

Hi Jamal ! Thanks for the suggestion, I had tried running the Translate target links as well, but nothing changed.

August 29, 2019 at 4:11 pm #4482573

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Running "Translate target links" did not update the urls in the English translation. I'll get back to you as soon as possible.

Best regards,
Jamal

August 30, 2019 at 10:49 am #4486691

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

The 2nd Tier team has suggested a patch to implement in theme's code to make the heading URLs translatable in the Sandbox as you can see in the attached image. But this did not make them translatable in the migrated site or in your website(This is expected because the links are internal and are translated automatically).
There are still issues for the links, I wonder if you can implement my suggestions in my reply(#4473407).
In the meantime, I am escalating my results to the 2nd Tier team to get more suggestions.

Best regards,
Jamal

September 2, 2019 at 7:20 am #4494949

patrickS-68

Hello Jamal ! Thank you for the update, I will try asap to implement your suggestions and will keep you posted !

September 2, 2019 at 4:10 pm #4498875

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

As per now, I escalated the ticket to our 2nd Tier for further analysis using the migrated site.
If we still need a Duplicator copy of your website, I'll get back to you to ask for permission to take it using the provided login/password.
Otherwise, We'll give news out as soon as possible.

Best regards,
Jamal

September 4, 2019 at 2:36 pm #4512105

Jamal
Supporter

Languages: English (English ) French (Français )

Timezone: Africa/Casablanca (GMT+01:00)

Hello,

Our 2nd Tier has suggested a fix for the issue. I tested it in the Sandbox and the migrated site and it worked. The images and headings links are now translatable in the Classic Translation Editor. See the attached image.

Please add the following code to your theme functions.php file. Remove the old code we have suggested and try this one:

//Elementor + WPML: Register URL's of the Headings and Images for translation
function wpml_widgets_to_translate_filter( $widgets ) {
  //heading
  $widgets['heading'] = [
    'conditions' => [ 'widgetType' => 'heading' ],
     'fields'     => [
        [
           'field'       => 'title',
           'type'        => __( 'Heading: Title', 'sitepress' ),
           'editor_type' => 'LINE'
        ],
        'link' => [
            'field'       => 'url',
            'type'        => __( 'Heading: Link URL', 'sitepress' ),
            'editor_type' => 'LINE'
        ],
     ],
  ];
  //image
  $widgets['image'] = [
    'conditions' => [ 'widgetType' => 'image' ],
     'fields'     => [        
        'link' => [
            'field'       => 'url',
            'type'        => __( 'Image: Link URL', 'sitepress' ),
            'editor_type' => 'LINE'
        ],
     ],
  ];
 
  return $widgets;
}

add_filter( 'wpml_elementor_widgets_to_translate', 'wpml_widgets_to_translate_filter');

Then go to the page /products/voice and make a small change(I added - to Email to be E-mail) and save.
Then open translation in Classic Translation Editor and update the translation for links and save.
You may want to undo the change(remove - to E-mail to be Email) and save. Then open translation in Classic Translation Editor and update the translation again.

Please test this in your website and let us know if it fixes the problem.

Best regards,
Jamal