Passer au contenu Passer à la barre latérale

Ce sujet est résolu. Voici une description du problème et de la solution.

Problème :
Les pages non traduites affichent une erreur 404 au lieu de rediriger vers la page d'accueil ou de masquer la langue si aucune traduction n'est disponible.
Solution :
Si vous rencontrez ce problème, nous vous recommandons de suivre ces étapes :
- Rendez-vous dans WPML > Réglages et descendez jusqu'à la section Traduction des types de contenus.
- Définissez la préférence de traduction pour le type de contenu "produit" à "Traduisible - afficher uniquement le contenu traduit" et enregistrez les modifications.
Cette méthode garantit que le sélecteur de langue n'affiche que les langues pour lesquelles des traductions sont disponibles.

Si cette solution ne s'applique pas à votre cas, car elle pourrait être obsolète ou ne pas correspondre à votre problème, nous vous suggérons d'ouvrir un nouveau ticket de support. Nous vous recommandons également de consulter les problèmes connus, de vérifier la version de la correction permanente et de confirmer que vous avez installé les dernières versions des thèmes et des plugins. Si vous avez besoin d'une assistance supplémentaire, n'hésitez pas à contacter notre équipe d'assistance sur le forum de support WPML.

Il s'agit du forum d'assistance technique de WPML, le plug-in multilingue pour WordPress.

Il est accessible à tous, toutefois seuls les clients de WPML peuvent y publier leurs messages. L'équipe du WPML répond sur le forum 6 jours par semaine, 22 heures par jour.

Marqué : 

Ce sujet contient 4 réponses, a 2 voix.

Dernière mise à jour par Prosenjit Barman Il y a 1 année et 11 mois.

Assisté par: Prosenjit Barman.

Auteur Messages
Avril 17, 2024 à 3:52 pm #15533875

ericD-36

Bonjour,
Les pages non traduites sont en 404.

URL de (mon) site Internet où le problème apparaît :
lien caché
Je travaille sur un serveur de pré-prod mais le site est également en prod.

Je m'attendais à voir : Soit un retour à la page d'Accueil, soit que la langue soit masquée si il n'y a pas de traduction existante comme cela peut être paramétré dans le plugin.

À la place, j'obtiens des erreurs 404.

Merci de l'aide que vous pourrez m'apporter.

Avril 18, 2024 à 7:25 am #15535612

Prosenjit Barman
Partisan de WPML depuis 03/2023

Les langues: Anglais (English )

Fuseau horaire: Asia/Dhaka (GMT+06:00)

Hello There,
Thanks for contacting WPML Support.

To reduce the waiting time, I took this ticket and responded in English. Please let me know if you're okay with it or If you want to continue the conversation in French.

I understand the issue you're experiencing. Please note that the languages displayed in the language switcher depend on the availability of translations. If a translation for a page is not available in a particular language, that language option will not appear in the language switcher when you are viewing that page. Additionally, if you attempt to access the page in a language for which there is no translation, you will be redirected to the default language version of the page.

If it is not happening, please try the following:

- Update the WPML and String Translation plugin to their latest version(WPML -> 4.6.10, String Translation -> 3.2.11)
- Once done, please go to WPML > Languages and scroll to the "Language switcher options"
- Select "Link to home of language for missing translations" option.
- Then go to "Settings > Permalinks"
- Resave the permalink structure.

Let me know if that helps in solving the issue. If the issue persists even after that, please share the link to the exact page where you're having the issue. I will check and advise you on what to do next.

Best regards,
Prosenjit

Avril 22, 2024 à 6:25 am #15548102

ericD-36

Hello,
I'm okay to continue the conversation in english.

It seems the site key doesn't match. Therefore I can't update the plugins.
I have a meeting with our client today.
I'll let you know if I still need help.

Best regards,
Florent

Avril 22, 2024 à 1:31 pm #15550822

ericD-36

Hello,
I generated a new site key and I updated WPML & its add-ons.
I followed your instructions and the problem is still there.
It happens on a lot of pages. For example :
lien caché
If you try to go to english or spanish pages, you'll find the 404 page.
These products are not published yet.

Avril 23, 2024 à 3:26 am #15553392

Prosenjit Barman
Partisan de WPML depuis 03/2023

Les langues: Anglais (English )

Fuseau horaire: Asia/Dhaka (GMT+06:00)

Hello Florent,
Thank you for the update.

As you have mentioned that the translated products aren't published yet, then it is expected to see a 404 error at the time of accessiing the translated version. In WordPress, any content that is saved as a draft is not publicly accessible. This is to prevent unfinished or unreviewed content from being viewed by the public. When WPML translates a product and saves it as a draft, the translated version doesn’t have a published URL that can be accessed. Therefore, when users or search engines attempt to access these draft translations, WordPress cannot find a published page at that URL and returns a 404 error, which is a standard response for an unavailable page.

If you prefer to keep languages hidden when translations are not available, here is what you can do:

- Please go to `WPML > Settings` and scroll to the `Post type translation` section.
- Set the translation preference for the "product" post type to "Translatable - only show translated contents" and save the changes.

This approach ensures that the language switcher only shows languages for which translations are available.

Let me know if that helps or if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

Avril 23, 2024 à 6:25 am #15553608

ericD-36

Thank you very much.