 Itamar
WPML Supporter since 02/2016
Languages:
English (English )
Timezone:
Asia/Jerusalem (GMT+03:00)
|
Hi.
Please check my suggestion and reply here if you need more help with this issue.
Thanks,
Itamar.
|
 mikeD-5
|
Can you clarify what this means please?
|
 mikeD-5
|
I can also confirm that using the WP editor directly instead of the WPML translation system does NOT fix the problem.
|
 Itamar
WPML Supporter since 02/2016
Languages:
English (English )
Timezone:
Asia/Jerusalem (GMT+03:00)
|
Hi.
I've discussed this issue with our second tier supporter and there is a way to achieve what you need. You need to add the example following in the functions.php file of your site's theme.
add_filter( 'wpml_sl_blacklist_requests', 'wpml_sl_blacklist_requests', 10, 2 );
function wpml_sl_blacklist_requests( $blacklist, $sitepress ) {
$blacklist[] = 'documentation';
return $blacklist;
}
In this example, 'documentation' represents the slug of the page which you link to and don't want to take the user to the translation of this page. Please read more about this function in our documentation here.
https://wpml.org/documentation/getting-started-guide/sticky-links/#linking-to-pages-in-a-different-language
Note:
1. You do not need to activate the Sticky Links add-on.
2. For existing pages and posts that have links in their content you might need to make a small change in the page and press the Update button. And then also update the translation.
Please let me know if you have further questions about this issue.
Regards,
Itamar.
|
 mikeD-5
|
That did the trick. If I can make a suggestion, it would be to be able to do this without a filter. For example, a specific data attribute on the link like 'data-no-translation' or something.
|
 Itamar
WPML Supporter since 02/2016
Languages:
English (English )
Timezone:
Asia/Jerusalem (GMT+03:00)
|
Hi.
I'm glad that this helped you solve the issue.
At the following link, you can submit a feature request that goes directly to our developers.
https://wpml.org/suggest-a-new-feature-for-wpml/
They will consider whether it is possible or needed to add this feature.
If you consider this issue as resolved please mark this ticket as resolved.
Cheers,
Itamar.
|
 mikeD-5
|
For future visitors: this ticket was started via a chat, and the chat record is hidden. So here is a summary.
TL;DR: There is no way to prevent WPML from translating a link to a page in the default language.
I have a site with several languages, and in this site I have a page that has been translated using the WPML translation system. At the top of this page I have a block of text that says "This page is avaialble in the following languages:" followed by a list of the site languages, and each lang name is linked to the translated copy of the current page.
So for example for FR I have
/fr/award-recipient/this-years-winner/
but for EN I have
/award-recipient/this-years-winner/
(note that the language is not part of the link)
When I view this page in any language that is not EN, the EN link is being translated into the language of the current page automatically. This is not what I want.
This seems to be because the system is converting a link to the default page language (EN) found in the translated text, into the translated link link for the page
To duplicate, you can do the following
1. In an EN site, make a new page and translate it into FR
2. add dummy content and confirm that both pages work correctly in the front end.
3. In the post content, add a link to the EN page without the domain, into each page content
Result: EN page links to EN, FR page links to FR (not EN as desired)
Said another way: how can I add a link in the post content, to a specific page in the site default language, without that link being translated? IOW I want to link to the EN page from a FR page, but when I try the EN link is being translated into FR and I do not want this to happen.
What seems to be happening is that the pasted page link to the default content is being converted by the WPML system into the default permalink format (in this case, /?p=911), which is then translated into the localized content.
|
 Itamar
WPML Supporter since 02/2016
Languages:
English (English )
Timezone:
Asia/Jerusalem (GMT+03:00)
|
Hi and sorry for missing your reply here.
Thanks a lot for adding the above information to this thread.
Please let me know if you need more help with this issue.
Regards,
Itamar.
|