This thread is resolved. Here is a description of the problem and solution.
Problem:
The client uses the Plugin Kadence Email Customizer but some of the strings are not appearing translated e.g. body text, additional content.
Solution:
The following code solved the issue in this case. It can be added to the theme´s functions.php file:
<?php /* Plugin Name: WPML Fix for Kadence WooCommerce Email Designer */ add_filter( 'woocommerce_email_format_string', function ($string, $email) { $string = apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_kt_woomail', '[kt_woomail]customer_processing_order_body' ); $string = apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_woocommerce_customer_processing_order_settings', '[woocommerce_customer_processing_order_settings]additional_content' ); return $string; }, 21, 2);
Relevant Documentation:
N/A
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.
Tagged: Translating a plugin
This topic contains 12 replies, has 4 voices.
Last updated by thomasK-90 1 year, 1 month ago.
Assigned support staff: Andreas W..
Author | Posts |
---|---|
November 1, 2019 at 5:33 pm #4872613 | |
alessioS-15 |
Hello I have translated strings from email created with kadence email customizer but some of the strings are not used e.g. body text additional content. Heading text istead is takeing into account. This is not acceptable in order to run a multilanguage site as adverstised by the product which support string translation. Thank youi in advance for your help. |
November 5, 2019 at 12:28 am #4885223 | |
Andreas W. Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Thank you for contacting the WPML Support Forum. Are you referring to this plugin? Kadence WooCommerce Email Designer The plugin is not yet in our compatibility list and was not tested, neither we do have documentation about it yet, but in case we can not solve the issue I will be able to try to reproduce the issue on a new install and escalate for testing and fixes. Please try the following first: 1) Go to String Translation The strings should now show up on String Translation. Let me know if you need further assistance. Kind regards |
November 8, 2019 at 8:49 am #4911445 | |
alessioS-15 |
Thank you will try and get back to you. |
November 8, 2019 at 7:37 pm #4916429 | |
Andreas W. Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Please let me know if you need any assistance with locating the strings. I am sending an access request just in case: I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to a testing site where the issue is replicated. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it. Maybe I'll need to replicate your site locally. For this, I’ll need to temporarily install a plugin called “Duplicator” on your site. This will allow me to create a copy of your site and your content. Once the problem is resolved I will delete the local site. Let me know if this is ok with you. IMPORTANT Please make a backup of site files and database before providing us access. Kind regards |
November 11, 2019 at 10:39 am #4923733 | |
alessioS-15 |
Hello Andreas, the point is that strings are available in the string translation. Even after I translate them there the translation are not being used. I would invite to try on as installation of woocommerce. I had a sandbox related to another issue if you want I can reproduce there with Kadence. Let me know. |
November 11, 2019 at 8:45 pm #4928117 | |
Andreas W. Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Thank you for your patience. I was able to recreate the issue. Can you confirm that you receive the same issue as seen on the screenshot or is there another issue apart of that? For some reason the .mo-file translation is not working as expected and also trying to translate on String Translation does not solve the issue. I am escalating the issue towards our compatibility team and I will be in contact as soon I received feedback. Kind regards |
November 11, 2019 at 8:50 pm #4928143 | |
alessioS-15 |
Hello Andreas, exactely, the part at the beginning of the email and at the end does not get translated even if one has provided the translation in the strings translation section. cheers, |
November 12, 2019 at 4:45 am #4929007 | |
Andreas W. Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Thank you for your confirmation. I will be in contact once I receive feedback from our team. Kind regards |
November 15, 2019 at 9:57 pm #4957001 | |
Andreas W. Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, We have created a plugin that solves the issue. You can download it here: hidden link Here the code of the plugin which also should work when beeing added to your theme´s functions.php file: <?php /* Plugin Name: WPML Fix for Kadence WooCommerce Email Designer */ add_filter( 'woocommerce_email_format_string', function ($string, $email) { $string = apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_kt_woomail', '[kt_woomail]customer_processing_order_body' ); $string = apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_woocommerce_customer_processing_order_settings', '[woocommerce_customer_processing_order_settings]additional_content' ); return $string; }, 21, 2); Kind regards |
November 22, 2019 at 7:54 am #4994653 | |
alessioS-15 |
THank you Adreas, I will try and let you know if it works. |
November 22, 2019 at 6:28 pm #5001405 | |
Andreas W. Supporter
Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, Thank you for your message. It worked on our test site. I would advise you go with the plugin version as in case you experience any issue it can be simply deactivated without the need for editing theme¿s functions.php file and it should further do its job when switching the theme. I hope this is a suitable solution for you. Kind regards |
November 28, 2019 at 11:45 pm #5039921 | |
Marcin |
hi, $string = apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_woocommerce_customer_completed_order_settings', '[woocommerce_customer_completed_order_settings]subject' ); helps but not exactly - order number in string "Order #{order_number} has been completed!" stops to be filled in with real number in emails (stays as "code") adding apply_filters( 'wpml_translate_single_string', $string, 'admin_texts_kt_woomail', '[kt_woomail]customer_processing_order_body' ); does mess things totally - text from body content shows in title |
January 17, 2020 at 6:56 am #5309665 | |
thomasK-90 |
I am also facing this issue. [woocommerce_customer_completed_order_settings]subject Both of them are translated in the backend, but not showing in the emails. The fix above didn't help. Instead, it replaced Could you help? |