This is the technical support forum for WPML - the multilingual WordPress plugin.
Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.
Assisted by: Sumit.
Author | Posts |
---|---|
February 4, 2022 at 1:34 pm #10509135 | |
emelieC |
Hello I have used the following codes to make some customisations to Woocommerce to fit our business. But I now find that None of the strings I have changed are translatable. Could you please help me out? Here are the lines that I have used to change some strings in this pastebin containing: // Change WooCommerce "Related products" text - BUT MAKES THIS UNTRANSLATEABLE: Similar hotel deals /** // Change default sorting in Woocommerce to A to Z - BUT MAKES THIS UNTRANSLATEABLE: Sort from A to Z Please check the code from functions.php here: Thanks and hope you can help! 🙂 |
February 4, 2022 at 2:01 pm #10509427 | |
Sumit Supporter
Languages: English (English ) Timezone: Asia/Kolkata (GMT+05:30) |
Hi, Thank you for contacting the support forum. I checked the code, using gettext filter for changing the text is very expensive. Anyway, for the solution, you should not pass variable in text domain $translated = esc_html__('Similar hotel deals', $domain); Instead use text value. Please check the updated code $translated = esc_html__('Similar hotel deals', 'your-theme-domain'); $tabs['additional_information']['title'] = __( 'Booking information', 'your-theme-domain' ); // Rename the additional information tab $options[ 'menu_order' ] = __('Sort from A to Z', 'your-theme-domain'); // rename Where "your-theme-domain" should be replaced by the actual theme domain. Generally, it is the name of the theme folder e.g. "twentytwentyone" for Twenty Twenty One theme. Then please follow these steps:- Hope it helps. Thanks |
February 10, 2022 at 5:02 pm #10554065 | |
emelieC |
Hello! That iis what I call great support! Could you please look into this last one I have added as well? I tried to figure it out but it doesnt look like the others I believe: Thanks again! |
February 11, 2022 at 3:00 pm #10562077 | |
Sumit Supporter
Languages: English (English ) Timezone: Asia/Kolkata (GMT+05:30) |
Hi, Thanks for the feedback! For this string, you can concatenate the strings like $price = '<span class="woocommerce-Price-amount amount">'. __('Special Price Conditions', 'your-theme-domain') .'</span>'; Please have a look at Thanks |