Home›Support›English Support›[Resolved] Video Gallery Links in Secondary Language Redirecting to Primary Language
[Resolved] Video Gallery Links in Secondary Language Redirecting to Primary Language
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:
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.
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
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?
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?
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 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.