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.
Problem: The client is experiencing a timeout issue when trying to automatically duplicate job listings to the default language using custom code from the WPML forums. Despite disabling unnecessary plugins and checking the debug log, the timeout persists. Solution: We recommend using the bulk 'duplicate' feature in WPML for duplicating posts from a secondary language to the default language. This can be done by navigating to WPML->Translation Management, filtering for the posts created in the secondary language, and performing a batch duplication to the default language. If custom code is necessary, we suggest modifying the existing code to prevent duplicate function calls and ensure it targets the specific needs of the site. Here is an example modification:
Ensure that listings are set to 'translatable' in WPML->Settings. If further customization is needed, consider hiring a specialized developer with WPML experience from https://wpml.org/contractors/.
If this solution does not resolve your issue or seems outdated, please check related known issues at https://wpml.org/known-issues/, verify the version of the permanent fix, and confirm that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket at https://wpml.org/forums/forum/english-support/.
Problem: The client wants to modify the batch name on their site using functions.php but is unsure if there is a WPML hook available for this purpose. Solution: We reviewed the client's request and confirmed that there is no existing WPML hook that allows modification of the batch name directly from functions.php. This task requires custom development, which is outside the scope of our support.
If this solution does not apply to your situation, or if it seems outdated, we recommend opening a new support ticket. We also advise checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. For further assistance, please visit our support forum.
Problem: You are trying to prevent WPML from auto-translating specific links on translated pages, aiming to use English links on German pages. Despite following the provided documentation, the links still auto-translate to the targeted page translation instead of pointing to the original English page. Solution: In WPML -> Settings, you can adjust the page slug setting from "Auto generate from the title" to "Copy." This setting is mainly for languages with encoded URLs. Alternatively, you can use the "Translate" setting within the translation editor to manually set the slug, allowing you to point links to the original language page as needed. For further customizations beyond these settings, additional development might be necessary, which is outside our support scope.
If this solution does not resolve your issue or seems outdated, we 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 open a new support ticket.