Problem: The client is trying to translate a site from English to Spanish using WordPress/WooCommerce. However, the translated page does not display as expected. Instead of the expected URL, an incorrect URL is shown, and the WordPress title and search bar issues are present. Solution: We recommended translating the header "template part" using Translation Management. This can be done by navigating to the Translation Management section in the WordPress admin panel. Here is a step-by-step guide: 1. Go to your WordPress admin area. 2. Navigate to Translation Management. 3. Translate the header "template part". After applying these changes, the issue with the URL and the display of the WordPress title should be resolved.
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 do not hesitate to open a new support ticket at WPML support forum.
Problem: The client is trying to change the button label from 'Book now' to 'Add to Cart' and translate it to German ('Zum Warenkorb hinzufügen') using WooCommerce Bookings. Despite modifying the functions.php file and using WPML to scan and translate the string, the German translation does not appear on the products. Solution: We recommended the client to ensure that the custom code in functions.php is correctly using the WPML translation function. Here is the code snippet that should be used:
We also suggested reproducing the issue in a new WordPress installation to determine if the problem is specific to the client's site or a general issue. If the problem persists, it might be necessary to review the theme or plugin compatibility or other specific configurations on the original site.
If this solution does not resolve the issue or seems outdated, 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 further assistance is needed, please open a new support ticket at WPML support forum.
Problème : Vous souhaitez rendre le texte d'un bouton dans un shortcode, défini dans le fichier functions.php, traduisible par WPML. Solution : Pour rendre le texte du bouton traduisible, vous devez envelopper le texte par défaut dans la fonction ,,
__()
. Voici comment vous pouvez modifier votre code :
// SHORTCODE REEL INSTAGRAM
function instagram_reel_popup_shortcode($atts) {
global $post;
// Define default attributes with translatable text
$atts = shortcode_atts(
array(
'button_text' => __('VOIR LA VIDÉO', 'your-text-domain'), // Make button text translatable
),
$atts,
'instagram_reel_popup'
);
Remplacez 'your-text-domain' par le domaine de texte de votre thème. Après avoir appliqué ce changement, sauvegardez votre site et allez dans WPML > Theme and Plugin Localization > Scannez le thème pour les nouvelles chaînes. Cela permettra de charger cette nouvelle chaîne sous String Translation.
Si cette solution ne résout pas votre problème ou semble dépassée, nous vous recommandons de consulter les problèmes connus, de vérifier la version du correctif permanent et de confirmer que vous avez installé les dernières versions des thèmes et plugins. Si nécessaire, n'hésitez pas à ouvrir un nouveau ticket de support.