[Gelöst] Translate Custom Shortcodes, Theme Pro (theme.co)
Dieses Thema ist gelöst. Hier finden Sie eine Beschreibung des Problems und der Lösung.
Problem: Sie verwenden Theme Pro und möchten eine Komponente mit WPML übersetzen, die über einen Shortcode wie [cs_component id="hvRYbfgz3lz1YAyX99"] eingefügt wird. Sie haben einen benutzerdefinierten Shortcode registriert, können jedoch den Shortcode oder die ID nicht sehen, um ihn zu ändern. Solution: Wenn Sie dieses Problem haben, empfehlen wir Ihnen, den Classic Translation Editor zu verwenden, um den Shortcode zu übersetzen. Bitte folgen Sie diesen Schritten (stellen Sie sicher, dass Sie eine vollständige Website-Sicherung haben): 1. Löschen Sie die Übersetzung des Gravity Form. Gehen Sie dazu zu WPML > Pakete > Wählen Sie Gravity Form und löschen Sie die Übersetzung des Formulars. Überprüfen Sie den Namen des Formulars in der Namensspalte. Wählen Sie das Formular aus und klicken Sie auf "Ausgewählte Pakete löschen"; 2. Gehen Sie zu WPML > Einstellungen und wählen Sie "Classic Translation Editor" in Translation Editor > Editor für neue Übersetzungen; 3. Senden Sie das Formular erneut zur Übersetzung in WPML > Translation Management und übersetzen Sie es mit dem Classic Translation Editor; 4. Stellen Sie die Einstellungen auf "Advanced Translation Editor" zurück, in Translation Editor > Editor für neue Übersetzungen; Nun können Sie den gesamten Shortcode übersetzen. Lassen Sie uns wissen, ob das für Sie funktioniert.
Diese Lösung könnte irrelevant sein, entweder weil sie veraltet ist oder nicht auf Ihren Fall zutrifft. Wir empfehlen dringend, verwandte bekannte Probleme auf https://wpml.org/known-issues/ zu überprüfen, die Version der dauerhaften Lösung zu überprüfen und zu bestätigen, dass Sie die neuesten Versionen von Themes und Plugins installiert haben. Wenn dies der Fall ist, eröffnen Sie bitte ein neues Support-Ticket im WPML-Support-Forum.
Dies ist das technische Support-Forum für WPML – das mehrsprachige WordPress-Plugin.
Mitlesen können alle, doch nur WPML-Kunden können hier Fragen veröffentlichen. Das WPML-Team antwortet im Forum an 6 Tagen pro Woche, 22 Stunden am Tag.
Hintergrund des Themas:
I am using Theme Pro (theme.co) and I want to translate a component using WPML. A component can be placed with a shortcode like this: [cs_component id="hvRYbfgz3lz1YAyX99"]. I found a way to register a custom shortcode since WPML does not support translating components directly. I added this XML: cs_component id and additionally I pasted this code into my functions.php: add_filter( 'wpml_tm_job_field_is_translatable', '__return_true' );
Die Symptome:
I can't see the shortcode or the id to change it.
I checked on a testing environment, and the behavior was the same. That indicates, as I suspected, that this is a compatibility issue between WPML and Gravity Forms. I'll escalate that to our developers, so they can find a permanent solution for this issue.
To do that, I need you to create a user for me on your website, so I can create a copy of it for our devs to analyze. I've enabled the private fields so you can share your credentials safely.
IMPORTANT
- Please make a backup of site files and database before providing us access.
- If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
Sorry for the late reply. I forwarded your website to our devs, but the credentials you sent doesn't seem to be admin credentials. Can you please verify?
We need admin credentials to create a copy and be able to test implemented solutions. Thanks in advance.
Hey, I tried my provided credentials and could login.
First you need the last login (user: wpml) for the htpasswd and then you can login with the admin credentials (user: wpmlsupport).
Please try it again.
Thank you for your patience. I got feedback from our devs. The issue is that shortcodes inside HTML blocks from Gravity Forms are not yet translatable by WPML, with the latest Translation Editor.
As a workaround, please use the Classic Translation Editor to translate the shortcode. You can do that by following these steps (make sure to have a full website backup):
1. Delete the translation of the Gravity Form. To do that, go to WPML > Packages > Select Gravity Form and delete the translation of the Form. You can check the Form's name in the name column. Select the form and click on "Delete Selected Packages";
2. Go to WPML > Settings and select "Classic Translation Editor" in Translation Editor > Editor for new translations;
3. Re-send the form to translation in WPML > Translation Management and translate it using the Classic Translation Editor;
4. Revert the settings to "Advanced Translation Editor", in Translation Editor > Editor for new translations;
Now, you can translate the entire shortcode. Let me know if that works for you.
Hello!
Thank you for your reply. So I should use the classic editor for the complete translation? Did I get it right?
What can I do if I can delete the previous translation of the form? I click the trash can and there is a green toast messages, but after a reload the translation is still there 🙁
You only need to use the Classic Editor for the Gravity Forms that include shortcodes inside HTML elements. All the other translations can be done as usual. That's why I recommended switching the setting back to the Advanced Translation Editor after being done with the Gravity Forms.
Can you please share a video showing what's happening? You can use loom: versteckter Link
Hey there, we don't have a private field for sharing general links. I've enabled all the private fields we have available. Perhaps you can share the link in the duplicator package field. Let me know.
Thank you for sharing the video. So, the steps you took won't actually delete the translation. Please follow the steps I shared previously to delete them:
Delete the translation of the Gravity Form. To do that, go to WPML > Packages > Select Gravity Form and delete the translation of the Form. You can check the Form's name in the name column. Select the form and click on "Delete Selected Packages"
After that, you can switch to the Classic Translation Editor and follow the steps. Let me know.
I tried this but cant delete the package, cause it tells me "translation in progress" and shows a disabled checkbox. And if I try to stop the translation job you can see what happens in the video.
I see. Please try finishing the translation, so it's fully complete in the Advanced Translation Editor. After that, try deleting it again. If that doesn't work, please enable the access for me again, I tried accessing your website, but it's password protected.