 guillermoC-9
|
Hello Prosenjit,
While waiting for an update on this issue I tried to run some tests on my end, which I would like to share with you in case they can help you and your team move forward with the investigation.
In you last message you mentioned "identified some issues with the code on the Single Post page". In order to test this I switched the site to a WP default theme, recreated my CPT (which are created by my theme) with a plugin, and attempted to translate some content.
The issue still persisted, so as far as I can tell, it is unrelated to the theme.
I hope this helps and I'll keep waiting for an update on your end.
Thanks!
|
 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
Hello There,
Thank you so much for the update.
One of our developers from our second-tier team has conducted an in-depth analysis of the problem and identified a potential workaround. This solution requires a few modifications, so please follow the provided steps closely and execute them in a staging environment or take a full backup of the site or database if you're trying them on your production site.
- Please go to: wp-content/themes/wikiarquitectura6/single-building.php
- Find the following line:
$architects = get_field('architect');
and add the code below after the line:
foreach ($architects as $key => $value) {
$architects[$key] = apply_filters( 'wpml_object_id', $value, 'architect' );
}
Note: You should find that line twice in the code, make sure to do the same for both lines.
- After that, Install and activate the "WPML Sticky Links" plugin on your site. You can download the plugin from your WPML Account(https://wpml.org/account/downloads/)
- Then, update the original post, which will allow you to convert the posts' links to IDs. Make sure that the link in the contents remains as: Walter Netsch
- After that, go to "wp-content/plugins/wpml-string-translation/classes/slug-translation/" and open the "class-wpml-slug-translation.php" file.
- Comment out the following line of code:
! ( $ld = $this->sitepress->get_element_language_details( $post->ID, 'post_' . $post->post_type ) )
Note: you may notice some error messages due to commenting on the code. Please be informed that the error is expected as we commented out a function call.
- Update the translation of the post again and the links should appear correctly after that.
For your information, the internal ticket as also been escalated to the core development team for further investigation. Please try the workaround and let me know if that helps. We will be happy to help if you need further assistance in this matter.
Best regards,
Prosenjit
|
 guillermoC-9
|
Hello Prosenjit,
I just wanted to ask for an update on this ticket. Whenever you can, no rush. Thanks! π
|
 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
Hi There,
I hope you're doing well.
It seems you have missed an update sent on March 7th that included a potential solution to this problem. Here's the link to the message from that day: https://wpml.org/forums/topic/autotranslate-is-not-translating-the-slug-of-custom-post-types-in-content-links/page/2/#post-15382610
Could you give the suggested workaround a try to see if it resolves the problem? Please feel free to let me know if you need further assistance in this matter. I will be happy to help.
Best regards,
Prosenjit
|
 guillermoC-9
|
Hi Prosenjit,
I saw that message, but to be honest, and as much as I appreciate the time you and your team are putting into this, that hardly sounds like a solution... even as a workaround it seems to me like the risk of performing all those steps and messing something up are higher than the potential reward, which again would not be a solution, and I would still face the same problem whenever I translate more articles after that.
I understand I don't have the knowledge you and your team have about how your plugin works, but it stands out to me that you guys keep pointing to the theme as the problem, when to me the theme is just a way to layout and style the information. As far as I can tell all the translated content lives in the database, and should be properly translated there. How the theme could interfere with the translation process is something I don't fully understand. Plus, as I said in a previous message, I tried switching to a default WP theme and the translation problem still persists, so it's hard to believe the problem is related to the theme.
That's how I see the issue from my end, but of course any insight you can give me into why you guys think differently is greatly appreciated, I'm here to learn from you π
|
 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
Hi There,
Thank you for your honest feedback. I understand your concerns and appreciate your patience.
Regarding the theme, we realize it might not be the root cause, especially since the issue persists with a default WP theme. Our initial focus on the theme aimed to thoroughly investigate all potential variables, but based on your feedback, we are now adjusting our focus accordingly.
For a more straightforward approach, I suggest adjusting the sticky link plugin as outlined in my last response. Please also ensure that internal links are formatted correctly (e.g., `Walter Netsch`). This solution showed positive results in our tests and might work for your site as well.
Please ensure your site and database are fully backed up before making any changes. Your understanding is valuable to us and I also have forwarded your feedback to the team. We're here to assist every step of the way.
Best regards,
Prosenjit
|
 guillermoC-9
|
I managed to fix the problem.
In case someone finds this thread in the future, this is what was going on.
I had declared my Custom Post Types in English, meaning I gave them an English name and an English slug.
As you can see in the image I attached to the first message of this thread, English was set as the "original" language for the CPT slugs in the WPML settings.
However, the main language of my website was set to Spanish.
I changed the "original" language of my CPT to Spanish, reset the permalink structure, and internal links are now properly translated.
Thank you Prosenjit and the rest of the WPML team for your assistance.
π
|
 Prosenjit Barman
WPML Supporter since 03/2023
Languages:
English (English )
Timezone:
Asia/Dhaka (GMT+06:00)
|
Hello There,
I hope you're doing well.
I'm glad to hear that you've successfully resolved the issue. The approach you've taken to solve the issue is certainly commendable and thank you for sharing the solution with the community! This will certainly help others who might encounter a similar problem.
I will also ensure to add the solution to the "Solution Box" right after you mark the ticket as resolved! π
Feel free to reach us if you ever need any assistance with our plugins. We will be happy to help.
Once again, Thank you so much for sharing the solution and your kind cooperation throughout this matter.
Best regards,
Prosenjit
|