[Resolved] Minor edits keep changing shortcode parameters
This thread is resolved. Here is a description of the problem and solution.
Problem: The client is experiencing issues with the translation memory in WPML not retaining the 'targetlanguage' string when minor edits are made to a page. This results in the need to manually re-enter the language parameter for the SayIt! shortcode across different translations. Solution: We recommend performing a full backup of your site before making any changes. If you encounter issues with translation memory not retaining settings after edits, try accessing the translation first and clicking the 'save translation' button before editing the original English version. This approach may help in preserving the translation memory settings. Additionally, consider using the translation glossary to automatically populate terms like 'targetlanguage' to your desired language code (e.g., 'it-IT'), which could save time.
If this solution does not resolve your issue or seems outdated, please check for related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and ensure you have installed the latest versions of themes and plugins. If problems persist, we highly recommend opening a new support ticket at WPML support forum for further assistance.
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 am building a language learning website for children featuring extensive usage of the text-to-speech plugin SayIt!. It uses a shortcode with language parameters, such as: [sayit lang="it-IT"]. The original language is English. Sometimes, I want the TTS to stay the same across different translations. For example, I might have a phrase in English that I'm trying to teach in a lesson (e.g. [sayit lang="en-GB"]Hello![/sayit]. At other times I want the parameters to change depending on the translation (for example, [sayit lang="fr-FR"]Bonjour[/sayit] for the French page, etc. The way I've gone about this is to have a placeholder parameter for the sections I do want to change, for example [sayit lang="targetlanguage"]. Using string translation, I look for the string "targetlanguage" and I translate it to whatever I want (e.g. fr-FR, it-IT). Link to a page where the issue can be seen: hidden link
Symptoms:
The problem is every time I make a minor edit to the text of any page, and then update each translation in the advanced translation editor, it seems like the translation memory "forgets" that the string "targetlanguage" should be "it-IT", etc. I have to go through and manually re-enter this. This doesn't seem normal.
Questions:
Is there a way to "lock" certain strings into the translation memory so it doesn't get deleted every time I make a minor edit?
Here is the ticket. I will need to closely examine your website. Therefore, I will require temporary access (WP-Admin and FTP) to a test site where the problem has been replicated, if possible. This will enable me to provide better assistance and determine if any configurations need to be modified.
Please note that it is important to have a backup for security purposes and to prevent any potential data loss. You can use the UpdraftPlus plugin (https://wordpress.org/plugins/updraftplus/) to fulfill your backup requirements.
Your upcoming reply will be treated with confidentiality and will only be visible to you and me.
✙ To resolve the issue, I may need your consent to deactivate and reactivate plugins and the theme, as well as make configuration changes on the site if necessary. This emphasizes the significance of having a backup.
I've checked and didn't notice any issues. Could you please record a short screen recording using the free tool hidden link ? This will help me replicate the problem and find a solution for you.
Here is a loom video that shows the error I have: hidden link
What I did notice when making this video is that if I click to update and save the translation immediately before making a minor edit, it seems to preserve the parameters.
I noticed while filming the loom video that sometimes I have the issue, and sometimes I don't.
The issue tends to happen if I go straight into editing the English version, and then do the translation (say in Italian). Then all the targetlanguage -> it-IT gets lost.
On the other hand, if at first (before editing the English version), I click in the translation, and just click the big green "save translation" button at the bottom, before I start editing the English version, then when I make the minor edits, if I go back to the Italian translation, most of the time the translation memory gets saved (but not all the time).
I guess this is my best workaround at the moment.
On another note, is there a way of making the translation glossary automatically populate the terms that I've specified (i.e. "targetlanguage" automatically translates to "it-IT")? At least that would save me a little bit of time.
The glossaries are stored at hidden link , as shown in the attached screenshot.
I've reviewed the strings you translated, and they are all present. Therefore, they should automatically appear when the corresponding records match.
I believe the issue arose when you edited the entire page, including inserting spaces and modifying HTML code. This action likely prompted the Advanced Translation Editor to rescan the entire page content.