This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is facing an issue where custom links in the menu are not translated correctly from German to English using ATE. The links appear as /?product_cat=vehicle-type-car instead of the expected translated format like https://www.valtron.de/en/c/rear-view-cameras/f/vehicle-type-car/.
Solution:
We recommend adding the following code to the end of your
functions.php
file to address the issue:
// WPML Workaround for compsupp-7532 function wpml_compsupp7532_add_custom_blacklist_requests( $blacklist, $sitepress ) { // Add your custom request to the blacklist array // We can hardcode URL's, like: //$blacklist[] = "c/rear-view-cameras/f/vehicle-type-truck"; // Or use REGEX. This regex should match slugs like "c/(any slug here)/f/(any slug here)" - we may need to adapt it if needed $blacklist[] = '/^c\/[^\/]+\/f\/[^\/]+\/?$/'; return $blacklist; } add_filter( 'wpml_sl_blacklist_requests', 'wpml_compsupp7532_add_custom_blacklist_requests', 10, 2 );
After adding the code, save the file, make a small modification to the block content, and save. Then, update the translations. You may need to re-translate the links.
If this solution does not resolve your issue or seems irrelevant due to being 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 further assistance is needed, 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.
This topic contains 22 replies, has 2 voices.
Last updated by Waqas Bin Hasan 3 months ago.
Assisted by: Waqas Bin Hasan.
Author | Posts |
---|---|
August 5, 2024 at 10:47 am #16038921 | |
nicoK-7 |
Background of the issue: Symptoms: Questions: |
August 6, 2024 at 7:50 am #16042726 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for contacting the support. I'll recommend syncing menus from WPML → WP Menus Sync (https://wpml.org/documentation/getting-started-guide/translating-menus/#easy-customizable-wp-menus-sync), then clear all caches and recheck. IMPORTANT: Please take full backup of your website and database beforehand. If this doesn't help, then please also try with only WPML plugins active (while all other plugins are inactive). Let me know your findings and I'll try my best to help you further on the matter. Regards. |
August 6, 2024 at 12:23 pm #16043887 | |
nicoK-7 |
Hi, In my case it's not a standard WordPress menu it's a custom taxonomy "HTML Block". So, I translate them like a usual page or post. But when I open the translated page, all text translated correctly instead of links. |
August 6, 2024 at 12:51 pm #16044037 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. Can you try the following please? 1) Take a full backup of your site and database before proceeding. Please let me know and I'll try my best to help you further on the matter. |
August 6, 2024 at 4:41 pm #16044901 | |
nicoK-7 |
I go through all steps you gave me, but the issue is still there. |
August 7, 2024 at 7:37 am #16046427 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated. Your next answer will be private, to share this information safely. Also provide detailed steps to reproduce the issue and links to pages in the admin and on the frontend. IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also. See https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/ for details on privacy and security. |
August 7, 2024 at 1:20 pm #16048228 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience and cooperation. I'm looking into this and 'll get back to you accordingly. |
August 8, 2024 at 11:46 am #16052484 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience and cooperation. Yesterday I was able to login to your site successfully but today when I am trying to login I'm getting following error after submitting login credentials: > Fehler: Cookies sind gesperrt oder werden von deinem Browser nicht unterstützt. Du musst Cookies aktivieren, um WordPress verwenden zu können. I've tried to allow cookies, delete existing ones, clear caches, incognito mode and have tried in 2 different browsers without any luck. Can you please deactivate any security or firewall related to this and let me know? Also please confirm if it is OK to deactivate plugins and switch themes for investigation? |
August 8, 2024 at 12:30 pm #16052642 | |
nicoK-7 |
If you get cookie error during login process. Then click login button once again and it will let you in. |
August 9, 2024 at 4:37 am #16054739 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates, I was able to login again and working on it. |
August 9, 2024 at 6:06 am #16054903 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your patience and cooperation. I've analyzed in detail and looks like all these links like hidden link are custom build. Because I can find "k" (German) as product category base as translation of "c" (English) in WCML -> Store URLs but can't find "f". I can't also find "fahrzeugtyp-pkw" (or vehicle-type-car) in Product Categories (hidden link). I can't also find these in custom taxonomies as child (i.e. hierarchical) in Toolset -> Taxonomies (hidden link). Perhaps I'm missing something here about these URLs? As per my understanding based on the URL hidden link, it should be like rear-view-cameras (top category) -> vehicle-type-car (child category), right? Anyways, I see that WPML is doing its job well, as you can find and translate these links in Advanced Translation Editor, thus content from HTML Blocks are well translated. The reason why these custom links aren't being linked correctly, is perhaps the links are not being form in a standard way. So to fix these I'm afraid you'll have to edit the translations manually. See my screencast hidden link for a reference about how you can do it. I did this for one link and it is working fine in the frontend. |
August 10, 2024 at 9:59 am #16058297 | |
nicoK-7 |
Thanks for the video tutorial. If I replace the links according to this instruction, they work. But if I update the translation via ATE, all the links that were added in the English version revert to the original version and I must add them again. And this is not very convenient, as I have a lot of such links. And I am also planning to add several languages in the future and this will create a lot of extra work for me. I want to know why WPML, instead of using the link I added in the translation via ATE, generates some link of its own. I need to achieve to translate these links using ATE. This is filter link hidden link Here are details about structure of this link: rueckfahrkameras -> it's top category |
August 12, 2024 at 6:49 am #16060643 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. I understand your concern. However, to escalate this issue further to our 2nd tier team (for some insights, investigation and/or a solution), can you please use this fresh sandbox site hidden link (one-click login) and recreate the problem? I've installed and configured WPML and String Translation. While WooCommerce and WCML are installed but not active. Woodmart theme is also active. You can upload any other theme and plugins here and setup as needed. You can use this plugin https://wordpress.org/plugins/download-plugins-dashboard/ to enable downloadable links for plugins and themes (in your site), in Plugins and Themes pages respectively. Then you can upload in the sandbox via Plugins/Themes -> Add New. A minimal setup to reproduce the issue is necessary. This way we can see if this only happens on your server or it's a global problem. Then I can also request expert insights from our 2nd tier team, to investigate the issue. Please take your time and reply when the site is ready. |
August 12, 2024 at 10:59 am #16061840 | |
nicoK-7 |
I have made all settings and added all plugins to reproduce the issue. So, now you can investigate this issue. |
August 12, 2024 at 1:13 pm #16062395 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for your time to reproduce the issue in the sandbox. I am working on this and 'll get back to you as soon as I find something or have a solution. |