Skip Navigation

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

Problem:
When viewing video galleries from the Spanish version of the site, clicking an image thumbnail redirects to the English version of the post/video instead of the Spanish version.
Solution:
We recommend adding the following XML configuration in WPML > Settings > Custom XML Configuration section:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="kadence/advancedgallery" translate="1">
      <key name="imagesDynamic">
        </key><key name="*">
          <key name="alt"></key>
          <key name="caption"></key>
          <key name="customLink"></key>
        </key>
      
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

After adding the XML, open the default language gallery page in Edit mode and make a small change to the page title to reload the translation. Then, open the translated page in Advanced Translation Editor (ATE) and search for the custom URLs by typing "http" in the search box. Add the custom links translation as needed and press the Complete button.

This solution might be irrelevant if it's outdated or not applicable to your case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket at WPML support forum.

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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Noman 2 months ago.

Assisted by: Noman.

Author Posts
September 14, 2024 at 3:53 pm #16178866

johnsutton

Background of the issue:
Hi!

Problem: When viewing video galleries from the Spanish version of the site, clicking an image thumbnail links to the english version of the post/video and not the Spanish version.

STEPS to replicate issue:

1. Go to: hidden link
2. Using the language switcher (Under Banner/header) switch from English > Spanish
3. On the Spanish Page, click an image thumbnail in the gallery
4. The redirection is to the English version of the post, not the Spanish

DOCS read:
1. https://wpml.org/forums/topic/the-images-gallery-in-other-languages-not-changed-when-have-different-images/
2. https://wpml.org/forums/topic/links-to-non-english-sites-dont-work-on-our-site/

What I tried:
Wordpress Dashboard > WPML > Settings > Translate Link targets > Scan now adjust links
Wordpress Dashboard > WPML > Settings > Media Translation > Uncheck 'Duplicate media attachments for translations (Apply then Start)

This site uses the Kadence Advanced Gallery block. I tried pasting the XML code recommended in (Doc ref 2) into 'WPML > Settings > Custom XML Configuration' but it would not save and generated the following error: Element 'gutenberg-block': No matching global declaration available for the validation root.'

Symptoms:
When clicking an image thumbnail in the video gallery on the Spanish page, it redirects to the English version of the post instead of the Spanish version.

Questions:
How can I ensure that clicking image thumbnails in the Spanish video galleries redirect to the Spanish version of the post?

September 15, 2024 at 6:28 am #16179307

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. I can confirm that I can see the issue on your site: hidden link

It might be a compatibility issue with Kadence Blocks plugin widget, could you please follow the below steps and let me know how it goes:

1. Please login to the fresh WP site by clicking on the auto login URL: hidden link

2. Please install the Kadence Blocks plugin and configure it as you did on your site.

3. Please configure the WPML plugins as you did on your site.

4. Please create a test page and insert the problematic Gallery element and try to translate it and let me know how it goes.

Please note that we only need above mentioned plugin functionality, you don't need to set up an entire website or clone your existing site.

Please let me know the results,
Thank you for your cooperation

link translation issue.png
September 15, 2024 at 4:47 pm #16180448

johnsutton

Hi Noman

On the sandbox: hidden link

I set up four posts.

I set up one page with a kadence blocks gallery (adv).

Gallery thumbnails link to the four posts. (language switcher in footer.)

On the gallery page (ENGLISH), the thumbs link to the English posts.

On the gallery page (SPANISH), the thumbs still link to the English posts.

This replicates the issue on the production site: hidden link

NOTE: As for WPML translation: On the production site I use auto translation. On Sandbox I had to manually translate posts

Thanks!

John

September 16, 2024 at 7:22 am #16181722

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thanks for replicating the issue at the fresh WP site. I’ve followed the below steps on the sandbox site:

1. Added the below XML in WPML >> Settings > Custom XML Configuration section:

<wpml-config>
  <gutenberg-blocks>
    <gutenberg-block type="kadence/advancedgallery" translate="1">
      <key name="imagesDynamic">
        <key name="*">
          <key name="alt" />
          <key name="caption" />
          <key name="customLink" />
        </key>
      </key>
    </gutenberg-block>
  </gutenberg-blocks>
</wpml-config>

2. Open the default language gallery page in Edit mode and make a small change to the page title to reload the translation.

3. Opened the translated page in ATE and searched for the custom URL’s by typing the “http” in the search box , added the custom links translation as you can see in the attached screenshot, and pressed the Complete button.

Now, It shows the correct translation at frontend. Could you please check and confirm?

Thank you for your cooperation and patience

custom URL translation.png
Spanish URL.png
September 16, 2024 at 2:28 pm #16184423

johnsutton

Hi Noman,

I reviewed and understood your setup in the sandbox.

I replicated these steps in the production site:

1. Added and saved custom XML in in WPML >> Settings > Custom XML
2. Cleared all caches.
3. Opened Premium Videos Page in English (default) and made/saved a small change in the page title
4. Opened the translated page in the automatic translation editor and typed 'http' in the search box
5. Do not see the English Langauge URLS translated to Spanish. (See Screenshot)

Thank you for your effort and help.

John

Screenshot 2024-09-16 at 10.19.08 AM.png
September 16, 2024 at 3:23 pm #16184792

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your feedback and for replicating the steps.

I apologize for any confusion. The custom XML we added simply makes those custom links available in the WPML Translation Editor for translation. However, these links need to be manually translated in the editor; they won't be automatically translated into the secondary language.

Please let me know if you have any questions.

Thank you for your cooperation