[Resolved] Options Page CPT Not translating properly
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with the synchronization of 'locked' fields between languages in their Options Page CPT. The fields are not syncing as expected when switching between the WPML translation editor and the standard WordPress editor. Solution: We recommend consistently using the WPML translation editor for making updates to ensure that translations are not lost when switching back to the WordPress standard editor. If the field is set to 'Translate', update the choice in the original language, and then translate it in the WPML editor. Avoid editing the translation using the WordPress standard editor after setting it in the WPML editor to prevent losing the translation. The 'Copy Once' setting copies the field value only the first time; if the original language value is updated later, it will not update in the translation. Conversely, 'Translate' does not copy the value, allowing you to set the translation value manually.
If this solution does not resolve your issue, or if it seems outdated or irrelevant 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 the problem persists, please open a new support ticket.
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.
Background of the issue:
I have some issues with the translation of strings in my Options Page CPT. The values of 'locked' fields that are supposed to keep synced do not. I have made a video to better show you: hidden link. Link to a page where the issue can be seen: hidden link
Symptoms:
The French (the default) is fine apart from the fields name being in English, but the English message does appear but is not synched with French even if the fields in English are supposed to be 'Locked'. I have to also go in English and change the values from there then save.
Questions:
Why are the 'locked' fields not syncing between languages?
How can I ensure that the header message from the Options Page is displayed properly in all languages?
I'd like to try and reproduce this issue on a clean install. Is it possible for you to install Bricks on this sandbox site? Here's a link to login:
hidden link
I'll configure WPML and install ACF Pro. Let me know once Bricks is installed, and you can set up a quick test page like you did in the video you shared earlier and then I will further troubleshoot. If we are able to reproduce it here, I can forward it to our developers for additional troubleshooting.
I was able to test with a default theme and after adding PHP to the single content php file, I can see the correct translations here:
hidden link hidden link
I tried to test withe the Bricks theme, but it seems we need a license in order to activate that. Could you ask your theme support if we can have an extra license just for testing? If not, I can ask our compatiblity team to reach out. I'm thinking the issue lies somewhere with the Bricks Dynamic Content since it works if you drop the php code into a theme file.
I just edited both page in Bricks to test and it works on your site. Plus, when I edit the page in Spanish, Bricks is in Spanish. It does not do that on my site even if my Profile language is set at site default.
One other thing I noticed on my site is the OTGS plugin, I just can't activate it. I also had a license sync problem that I solved by deregistering and re-registering the staging site. Now, I can install addon for WPML but not activate the OTGS plugin. I don't know if this would have something to do with the translation not working???
The OTGS installer plugin only needs to be active when you originally install WPML. Once WPML is configured, that plugin can be deleted.
Since it's working on staging but not on your live site, it would be best to test minimal settings. Meaning, can you test with only WPML plugins active (and ACF of course) with a default theme?
if you don't have a staging environment where you can test that, let me know and I can set one up and migrate a copy of your site there for more testing.
I did deactivate the plugins except the one needed and also activated the 2024 theme.
I created 2 test pages (test EN and test FR) and I get the same result 🙁
Thanks for the additional video. It looks like the issue is happening because you are switching back and forth between the WPML translation editor and the standard WordPress editor, and this is expected. This is because the content from the Advanced Translation Editor does not sync with the WordPress backend, so when you update the translation using the WordPress standard editor, those translations are lost.
On your live site, if you set the field to Translate, then update the choice in the original language, you should then see the field values in the WPML translatione ditor, just like you did in the video, and translate them there. Do those steps resolve the issue in your live site? If you edit the translation again using the WordPRess editor, you will lose the translation, so once it is set in the WPML editor, you should not revert back to the WP editor.
Copy Once means it will copy the value of the field the first time only. If you later update the value in the original language, it will not update the translation. Translate means it will not copy the value at all and you can set the translation value when you translate the post. I hope that helps clear the difference up.
After many hours of trying to get a grip on how to properly translate, and with your help, I've managed to fix the problem.
What I think is missing from WPML docs is some king of process flowchart or some mind map to visualize the translation process with a list of do's and don't so we can avoid those bad translation situation. Videos explaining this would also be great. Unless it does already exist and I just did not find it.
Thank you very very much for all the time you took in helping me out.