[Gelöst] Synchronization of Taxonomy Assignments from the Base Language to the Translations
Dieses Thema ist gelöst. Hier finden Sie eine Beschreibung des Problems und der Lösung.
Problem: The client has two custom post types (CPTs): 'hotels' and 'congresses'. Each hotel is associated with one or more conferences using the 'congress' taxonomy assigned to the 'hotels' CPT. In the default language (English), the client assigns or removes conferences using this taxonomy. However, these assignments are not automatically reflected in the translations, requiring the use of the troubleshooting tool to synchronize post taxonomies. Solution: We advised the client to change the settings for the 'congress' taxonomy to be translatable and only show translated items. This can be done by navigating to WPML > Settings > Taxonomies Translation and setting 'Congresses (congress)' to 'Translatable - only show translated items'. After adjusting these settings, the client should translate these taxonomies under WPML > Taxonomy Translation. Additionally, we suggested testing the 'use translation if available or fallback to default language' option, although it might lead to unexpected results and translating the categories might be a safer approach.
Please note that this solution might be outdated or not applicable to your specific case. If the issue persists, 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 needed, do not hesitate to open a new support ticket at 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've two custom post types (CPTs): 'hotels' for hotels and 'congresses' for conferences. Each hotel is associated with one or more conferences using the taxonomy 'congress' assigned to the 'hotels' CPT. In the default language (English), I assign or remove conferences using this taxonomy. Both CPTs are translated, and we are using the classic WPML editor. The taxonomy is not reflected in translations automatically. I've to use the troubleshooting tool instead. WPML-Link: Dashboard > WPML > Support > Troubleshooting (/wp-admin/admin.php?page=sitepress-multilingual-cms/menu/troubleshooting.php) > Clean up > Synchronize post taxonomies (CPT hotels)
Die Symptome:
Although I assign the taxonomy in the default language 'English,' this assignment is not reflected in the translations (e.g., French or German).
Fragen:
How can I automate the synchronization of taxonomy assignments from the base language to the translations?
Is it possible to trigger the cleaning action automatically whenever a 'hotels' CPT is saved?
Is there a way to provide my editors with a button that executes the function: Dashboard > WPML > Support > Troubleshooting > Clean up > Synchronize post taxonomies (CPT hotels)?
What parameters or functions would I need to link to this button?
Zur Erstellung der CPT's verwenden wir das Plugin "Custom Post Type UI" in der Version 1.17.2. Ansonsten setzen wir auf ACF Pro (Version 6.3.12). Als Theme verwenden wir Hello Elementor (Version 3.3.0) mit dem Thembuilder Elementor in der Pro-Version 3.28.1 bzw. das entsprechende Child-Theme (Version 1.0.1).
Ich kann gerne anbieten mir das einmal genauer anzusehen.
Ich möchte einen temporären Zugriff (wp-admin und FTP) auf die Website anfordern, um das Problem genauer zu untersuchen.
Die dafür erforderlichen Felder findst Du unterhalb des Kommentarbereichs, wenn Du dich anmelden, um die nächste Antwort zu hinterlassen. Die Informationen, die Du angibst sind privat, was bedeutet, dass nur Du und ich sie sehen und darauf zugreifen können.
WICHTIG
Lege bitte unbedingt eine Sicherungskopie der Website und der Datenbank an, bevor Du uns den Zugriff gewährst.
Wenn Du die Felder "wp-admin / FTP" nicht sehen kannst, werden Ihre Anmeldedaten für Post und Website als "PUBLIC" (Öffentlich) festgelegt. Veröffentliche die Daten NICHT, es sei denn, Du siehst die erforderlichen wp-admin / FTP-Felder.
Das private Antwortformular sieht folgendermaßen aus: versteckter Link
Klicke beim nächsten Antworten auf "I still need assistance".
Video: versteckter Link
Beachte bitte, dass wir verpflichtet sind, diese Informationen auf jedem Ticket individuell anzufordern. Wir dürfen nicht auf Zugangsinformationen zugreifen, die nicht speziell auf diesem Ticket im privaten Antwortformular übermittelt wurden.
Auf der Staging Site sind die Kategorien als "Nicht übersetzbar" eingestellt.
Gehe auf WPML > Settings > Taxonomies Translation und stelle "Congresses (congress)" auf "Translatable only show translated items". Das gleiche gilt für "Cities" und "Countries".
Übersetze dann diese Taxonomien unter WPML > Taxonomy Translation.
---
Weitere Tests kann ich hier leider aktuell nicht durchführen.
Das Problem, welches ich aktuell auf dem Staging sehen kann, ist das ich keine neuen Hotels erstellen kann und das speichern vorhandener Hotels zu einem schwerwiegenden Fehler führt.
Das ist allerdings auch dann der Fall, wenn ich WPML deaktiviere. Soll bedeuten, diese Fehler werden nicht durch WPML verursacht.
sorry, es war noch ein Artefakt im Quellcode, das den Fehler ausgelöst hat.
Vielen Dank für Deine Geduld und Unterstützung (Deine Zeit). Du hast mir sehr geholfen. Mir war nicht bewusst, dass ich die Taxonomien übersetzen muss, obwohl ich eigentlich keine Übersetzung benötige (in allen Sprachen fixer Name).
Mit „Übersetzung“ (ich übernehme einfach den String aus der Basissprache) funktioniert es.
Vielleicht eine letzte Frage:
Oder kann ich den Vorgang mit der Wahl von "use translation if available or fallback to default language" quasi (sicher) automatisieren, um nicht übersetzen zu müssen?
Die Idee mit dem "Fallback" für Taxonomien könntest Du einmal teste. Es kann allerdings in manchen Fällen zu unerwarteten Ergebnissen führen. Sollte es nicht wie erwartet funktionieren, wäre es besser die Kategorien zu übersetzen.