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 5 replies, has 2 voices.

Last updated by Bruno Kos 4 months, 2 weeks ago.

Assigned support staff: Bruno Kos.

Author Posts
June 5, 2019 at 3:27 am

davidF-76

Right now the links in the Arabic version of the website are not leading to the Arabic version of the pages they're linking to.

For instance, go to the Arabic homepage here:
hidden link

Click on the olive branch to the left of the first slider, that leads to this page:
hidden link

It's my understanding that it should lead to this page instead, its Arabic equivalent:
hidden link

I did the following steps to try to correct:
1. Clicked the "scan now" button on Settings > Translate Link Targets
2. Installed Sticky Links

A couple of questions:
1. Should I switch to a dedicated subfolder structure vs a URL parameter?
2. Should I select in "Settings > Translated documents options" this option since the translated posts are Arabic: Copy from original language if translation language uses encoded URLs

June 5, 2019 at 12:29 pm #3960371

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Thank you for contacting WPML support!

I've checked your website in detail using provided credentials. Everything seems to be properly translated and configured. However, the link you provided does not seem to be a translation of the homepage, hence all the links are not correct. This one seems to be correct one:
hidden link

And this corresponds with "Different languages in directories" you have set for your website.

Regards,
Bruno Kos

June 5, 2019 at 12:42 pm #3960609

davidF-76

Hi Bruno,

Apologies for not updating that I did change the setting last night.
I still, however am seeing the original issue.
If I go to the Arabic homepage, and then click on the link outlined in red (see image), then it takes me to the English version of that page instead of the Arabic version.

Is there any way to have all internal links link to the translated version of that page when someone clicks on them on site?

June 5, 2019 at 1:29 pm #3960871

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

I believe that what you're asking is the following option:
WPML -> Settings -> Translate Link Targets - Scan now and adjust links

If this isn't working (the process will take a while), I believe that the only solution might be editing these links directly on translations. I think that this may explain what's behind it:
https://wpml.org/forums/topic/what-is-the-real-purpose-of-translate-link-targets/#post-2797321

Regards,
Bruno Kos

June 5, 2019 at 2:09 pm #3961247

davidF-76

I did this multiple times and it did not work. Doing this manually seems counter to the entire point of this system...I'd like not to have to do that every time we add links. Can you please figure out why this is happening and how we can achieve normal usage?

June 6, 2019 at 8:00 am #3966847

Bruno Kos
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hi,

Can you please figure out why this is happening and how we can achieve normal usage?

I have checked on how these links are added to your website and I can see that they are using Icon Box with the URL field. However, this URL field was not recognized by string translation and hence there was no way to translate it either. I can see that you've already attempted to make this visual composer element compatible with string translation, but I updated your code a bit more:

<wpml-config>
    <shortcodes>
        <shortcode>
            <tag>vc_icon</tag>
            <attributes>
                <attribute>link_text</attribute>
                <attribute>title</attribute>
                <attribute encoding="vc_link" type="link">link</attribute>
            </attributes>
        </shortcode>
    </shortcodes>
</wpml-config>

After I did this, I clicked update on your homepage (original language) and these links appeared in string translation. I have translated this URL now and it seems to be working:
hidden link

The strings for this particular page are stored within "page-builder-shortcode-strings-73821" domain. I have not tried translate link targets now, but I think that if you only update originals (so that string translation can pick up these urls) and try that option again, it should work. That was the main reason why it didn't work before - no strings were available in string translation, so WPML didn't have anything to translate either.

Regards,
Bruno Kos