Skip to content Skip to sidebar

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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 9:00 – 14:00 -
- 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 15:00 – 18:00 -

Supporter timezone: Asia/Dhaka (GMT+06:00)

This topic contains 3 replies, has 2 voices.

Last updated by Prosenjit Barman 1 year, 5 months ago.

Assisted by: Prosenjit Barman.

Author Posts
March 5, 2024 at 12:25 pm #15374461

camillaB-7

The target links for translated pages are not generated correctly. Please see the attachment.

hidden link

hidden link

This is only one example, there are many such Urls.

Also while accessing the site, please add the ?token=b6d6bc7f-2ff3-4a4a-8853-b280e95c00e0 at the end of the URL.

Screenshot 2024-03-05 174329-bengali.png
Screenshot 2024-03-05 174046.png
March 6, 2024 at 8:21 am #15377568

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

I understand the issue you're having. Could you please confirm that the product you mentioned (Tuta absoluta) in the (ES, PT) text is translated into other languages? Additionally, upon inspection, I noticed that the switcher at the top is added via the "GTranslate" plugin. It is recommended to use only one translation plugin as multiple translation plugins can cause inconsistency in translation.

Could you please integrate the WPML language switcher, confirm that all linked pages/posts are translated into other languages using WPML, and then check again?

After translating the pages/posts, you may need to scan and adjust the link target. To do so, please go to WPML > Settings and scroll down to the "Translate link target" section. After that, click on "Scan now and adjust links".

Please let me know the update. I'll be happy to help if you need further assistance in this matter.

Best regards,
Prosenjit

March 6, 2024 at 8:37 am #15377733

camillaB-7

Yes, (Tuta absoluta) in the (ES, PT) is translated into all the languages.

We are not using the GTranslate, we have created our own switcher, the class name is only "g_translate"(don't confuse with this).

We have do the scan multiple time, but the links are generated incorrectly.

Also, FYI, in the site we have used URL rewriting, and the links are generated incorrectly. Below an example, I think is this something with URL rewrite that WPML is not handling correctly.

Generated Target URL : hidden link

Actual URL: hidden link

add_action(
'init', function () {
add_rewrite_tag('%id%', '([^&]+)');
}
);

add_filter(
'generate_rewrite_rules', function ($wp_rewrite) {

$details_page = 'productdetails';

$feed_rules = array(
$details_page . '/([0-9a-zA-Z%-]+)' => 'index.php?pagename=' . $details_page . '&id=' . $wp_rewrite->preg_index(1)
);
$wp_rewrite->rules = $feed_rules + $wp_rewrite->rules;
}
);

March 7, 2024 at 5:41 am #15382210

Prosenjit Barman
WPML Supporter since 03/2023

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hi There,
Thank you for the update.

Upon reviewing the details you've provided, it appears that the issue you're encountering may stem from custom modifications made to the URL structure. To isolate and identify the root cause, I kindly ask that you revert any custom adjustments related to the URL settings to their original state and then reassess the situation.

Additionally, to further remove any potential conflicts, I recommend temporarily switching to a default WordPress theme, such as "Twenty Twenty-One." After making this change, please proceed to update the translation once more and check if the issue persists.

It's important to note that custom code alterations can occasionally lead to unexpected behavior. Given that our support scope does not extend to issues arising directly from custom coding, this initial step of eliminating custom changes or checking by switching to a default theme is important for pinpointing the issue.

If the problem is resolved after these adjustments, it would suggest that the custom changes were indeed the cause. If the issue remains, however, we can explore other potential factors together.

Let me know the results of these tests, or if you require any further assistance throughout this process. Your cooperation and understanding are greatly appreciated as we work towards a resolution.

Best regards,
Prosenjit

The topic ‘[Closed] Translated Link taget for non-english languages are not correctly generated’ is closed to new replies.