This thread is resolved. Here is a description of the problem and solution.
Problem:
The client was experiencing an issue where updating the translation on one of the Portuguese pages caused all the layout content to disappear, resulting in a broken page. The Advanced Translation Editor (ATE) was not appearing, and when using the duplicate option, the page could be edited normally through the WordPress Editor, but automatic translations were not available.
Solution:
We resolved the issue by ensuring that the field name "field-page_section-0" (intro) was consistent across languages. It was translated to Portuguese in ATE, while for French, it remained the same as English. We corrected the translation, and the Portuguese page started working correctly. We also advised the client that ATE does not usually translate special content like CSS, JS, HTML, JSON, IDs, etc. If automatic translation results in incorrect field names, the client can manually edit the translation in ATE and update the translation memory for future consistency. Additionally, we suggested using the Glossary feature to handle special words. For more information on translation memory, visit Translation Memory documentation, and for the Glossary feature, see Glossary Entries documentation.
Please note that this solution might be irrelevant if it's outdated or not applicable to your case. If you're still facing issues, we highly recommend checking related known issues at WPML Known Issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please open a new support ticket with us.
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.
Tagged: Exception, Not WPML issue
This topic contains 12 replies, has 2 voices.
Last updated by Waqas Bin Hasan 7 months, 3 weeks ago.
Assisted by: Waqas Bin Hasan.
Author | Posts |
---|---|
March 20, 2024 at 1:44 pm #15431784 | |
emilM-2 |
Hello There, Currently when I try to update the translation on one of the Portuguese pages (Capacidades) on some of the Portuguese translated pages (e. g. Homepage(Página inicial)) all the layout content disappears and the page gets broken. By the previous WPML support feedback, I've been advised not to mix the WPML and WordPress editors, but the Advanced Translation Editor does not appear. I've tried to debug and noticed that empty layouts are returned. After deleting the broken translation page, if the duplicate option is used, the page can be edited normally through the WordPress Editor, but automatic translations cannot be used. What could cause the issue, and how could be resolved? Thanks in advance! |
March 20, 2024 at 7:07 pm #15433476 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Hi, Thank you for contacting the support. Before proceeding further, may I ask you to try the following? IMPORTANT: Take full backup of your website and database beforehand. It is highly advised to try the following on a staging/dev site first, so your live website isn't compromised. - Update WPML plugins to the latest version, since you're using previous versions, updating may help fixing the said problem with automatic translation. If that doesn't help after updating, try the following in given order, that you may find a possible reason: Please let me know your findings and I'll try my best to help you further on the matter. Regards. |
March 21, 2024 at 3:20 pm #15437208 | |
emilM-2 |
Hi, I've tried disabling the plugins, changing the active theme, and using the WPML Troubleshooting Options, but any of these actions leads to the same issue - the layout names get translated and layout content disappears then the page gets broken. Even just accessing the plugins page does the same. Regards. |
March 21, 2024 at 8:42 pm #15438339 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates and the video. Looks like you haven't updated the WPML plugins to the latest. Or have you tried that also (in addition to deactivating the plugins)? The error you showed in the screenshot is coming from your theme, which I can't find on our compatibility list (https://wpml.org/theme/). Or perhaps it is based on another theme but heavily customized? However, 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 admin and on 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. |
March 22, 2024 at 6:21 pm #15442211 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the details, I tested a few things and indeed I can see the problem. But I am not sure if this is really coming from WPML, because translations are complete and there are no apparent bugs. So I created this test page hidden link by cloning your home page. It had the same problem as your original home page. Then I followed these steps: - Deleted the translations. And the translated versions started showing something promising: - PT: hidden link Although they're not exactly the same as the home page in English, but some content is showing up, following more or less the same design. So my observation is: I'll advise that if you can demonstrate the above mentioned issue with a default theme, WPML + ST + ACF and ACFML, then of course we can see if this is really on WPML. To further strengthen my case, I created another page based on Homepage template hidden link: - If you open it for editing and compare with frontend (even in default language), I can't see what I added in the page. Like I added all sections with various information, but on frontend lot of is missing. Specially: So the French translation (hidden link) which has the same design but missing almost everything. This looks like that everything is heavily customized and theme dependent. |
March 25, 2024 at 9:14 am #15445220 | |
emilM-2 |
Thank you for the feedback. I've checked the homepage-test and again the sections below the hero are missing. I've also checked the test with homepage template, and most of the missing content is due to not added links, which are required for the content to be displayed. However, the same issue with the missing sections occurred when I tried to translate it into Portuguese. hidden link I've tried to delete the Homepage and its translations and recreate it, but the same issue occurs when I try to translate the newly recreated page into Portuguese. I've also tried to change the theme to default, but as soon I change it the same issue occurs to the Portuguese Homepage, and the sections disappear. |
March 25, 2024 at 7:19 pm #15448737 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. Can you create one sample page using that template but with a default WordPress theme? AND DO NOT translate it!! So at-least we'd know that there's no custom coding involved and I'd then try and 'd be able to ask my team for help. Because as long as the custom coding is involved, that'd be out of scope. Please let me know. |
March 26, 2024 at 8:00 am #15449789 | |
emilM-2 |
Thank you for the advice. I've created a new Test page with a simple Test template, that just dumps the content of each section, as flexible content with layout sections cannot be used/displayed with a default theme. I've also added one layout section with a simple text field and did not make any translations to the page. Minimum custom code was used. You can check it here - hidden link Let me know if you were able to replicate the issue and made any progress. Thanks in advance! |
March 26, 2024 at 6:59 pm #15452960 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. I translated that page to French and Portuguese and can see the text translated: - hidden link So apparently it seems to work fine. The problem with your original page, I am still convinced about that heavily customized coding which probably needs to be taken with great care. Unfortunately support for custom coding is out of scope of this forum. However, WPML offers filters and action hooks that can be used in your WordPress theme or plugin to provide correct multilingual support. Browse following resources for more information: - https://wpml.org/documentation/support/wpml-coding-api/ If you need additional custom work, we recommend you contact WPML Contractors at https://wpml.org/contractors/. |
March 27, 2024 at 8:48 am #15453972 | |
emilM-2 |
Thank you for the feedback. I've managed to recreate the issue using the Default Twenty Twenty-Four theme (moved the simple Test template and the layout section to a child theme, so there is minimum custom code and keeping the default theme as clean as possible), and the ACF fields from the custom theme. Here are links to the pages: EN: hidden link FR: hidden link PT: hidden link Could you please check them, so we can be sure the issue is not something else related? Thanks in advance! |
March 27, 2024 at 9:06 pm #15458057 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Thank you for the updates. I think the problem is fixed now. Actually the "field-page_section-0" (intro) was being translated to Portuguese in ATE, while for French it was same as English (intro). So I fixed the translation and PT page is working fine now too: hidden link Since that's a field name, it should be the same. |
March 28, 2024 at 10:35 am #15459796 | |
emilM-2 |
Thank you for the reply. Looks like the fix works, thank you! Could you give some more in-depth info on what causes the translation in the ATE of the flexible content layout names? And is there any way to prevent it, so I can be sure the same issue will not occur again? Thanks in advance! |
March 28, 2024 at 4:36 pm #15461732 | |
Waqas Bin Hasan Supporter
Languages: English (English ) Timezone: Asia/Karachi (GMT+05:00) |
Well actually there's no particular reason for that because ATE just translates. Usually ATE 'll not translate some special content like CSS, JS, HTML, JSON, IDs and etc. But as long as a word or string is a proper word in a language, it tries to translate (in case of automatic translation). So if you're sending your content for automatic translation, once it is completed, you can edit the translation manually in ATE (by clicking the pencil icon). And in ATE, you can change the translation of such words (those field names in this case) back to what's suitable (same as default language in this case). This updates translation memory and perhaps next time when the same word goes for translation, ATE 'll use the existing translation. See https://wpml.org/documentation/translating-your-contents/how-wpml-keeps-track-of-your-translations/ about translation memory. You can also try Glossary feature to handle these special words, see https://wpml.org/documentation/translating-your-contents/advanced-translation-editor/how-to-create-and-manage-glossary-entries/ for details. |