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.

Author Posts
October 2, 2018 at 11:41 pm

gillesB-3

I am looking to translate from French to English or vice versa Email Text in: woocommerce / email / completed order.
But also the other statuses:
refunded order, on hold order ...

Remark: surprisingly, I could translate it the following statutes: processing order, new order, note, canceled order, failed order ... (why not the others)

I can not find the text e-mail of (for example the text of e-mail of "completed order") in wpml / Translation of string
I use the plugin to write the email "Email Text Customizer for WooCommerce" free on: https://wordpress.org/plugins/email-text-customizer-for-woocommerce

FYI, I have already tested the following but nothing worked.
- I analyzed theme and plugin via locating the theme and plugins
notice there is an error message on "Other options:" (see attached photo)
- I deleted and copied HTML Template
- I disabled each plugin and reactivated one by one
- I took an old version of the site on another domain (.shop) to test if the problem still existed

Can you help me it's really urgent

October 5, 2018 at 4:17 am #2789547

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Thank you for contacting us. Please, my sincere apologies for the delay in answering.

I tried to access your site but it looks like the credentials are invalid. It seems that it is necessary to make this field translatable. To do this, please follow the steps below:

- Click on the WPML > Settings > Custom XML Configuration
- Paste these lines:

<wpml-config>
    <admin-texts>
        <key name="woocommerce_customer_completed_order_settings">
            <key name="email_text" /></key>
    </admin-texts>
</wpml-config>

- Click on the Save button

After following the steps above, just click on WPML> String Translation and translate the desired string.

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.

October 8, 2018 at 9:52 pm #2797450

gillesB-3

Hello Bruno,

Thanks for the code.

But I could not wait for your answer any longer , so I made a recovery of a backup and updated the site.

But I still cannot find the solution to translate the email texts of woocommerce.

I may have a procedural problem.

I have a copy of templates in my child theme as proposed by woocommerce (see annexe1 point N°1)

The problem is that when I change the text directly in the child code (since woocommerce does not leave the possibility to change this text (see annexe1 point N°2), I have the translation in wpml translation chain, but it seems that each text modification wpml translation, the chain saves the previous versions, which unnecessarily lengthens the translation list (see annexe2 point N°3)

I have been in "Locating the theme and plugins" but nothing changes.

How not to duplicate the chain and not save the old changes?

Note: I personally find it that neither Woocommerce nor wpml provide solutions to redirect and translate these texts that are still the first direct link with customers.

I do not even talk about mail customization plugins

October 8, 2018 at 11:28 pm #2797537

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you for the feedback. From what I understood your message, this seems to be correct.

You are changing a string and this string is added as new, rather than editing the previous string. Is that what you're talking about?

If so, this is the expected behavior of WPML. WPML is basically recognizing this string as a new string because there was no string like this before.

That is, as for WPML this new string did not exist previously, this string is added as new. When you edit a string directly in the code, ideally you should access the WPML > String Translation page and remove the unnecessary string.

Please, let me know if I can help with any other questions you may have. I'll be happy to help.

Thank you.

October 10, 2018 at 1:30 pm #2804460

gillesB-3

Hi Bruno

Simple apartment can not translate the text entered with the plugin "Email Text Customizer for WooCommerce"
  it does not work because
- the translation chain can no longer find the text
- or he did not pick up the text.

On the other hand if I change the code of the child template it works.
The only flaw is that the code does not accept the "<P> </ P>" tag
But I need input enriched text.

And after testing 5-6 plugin (free and paid) I can not find anything that is accountant with wpml and ideally with the Advanced WooCommerce Order Status & Action Manager plugin + Colorize filtering on the Order List-colorize-filtering-list.

How then do the others?
Do you have good names of one and / or two plugins (paid or not) compatible with wpml that allows:
1) translates enriched texts?
2) Customize the design of the e-mail? (similar to Decorator - WooCommerce Email Customizer)
Or would you have any advice or other solution?
Thank you.

Gilles

October 11, 2018 at 3:33 am #2806623

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

>>> On the other hand if I change the code of the child template it works.
The only flaw is that the code does not accept the "<P> </ P>" tag
But I need input enriched text.

Instead of adding the paragraph tags for translation, have you tried to keep them off the translation string? From the screenshot you posted earlier, it looks like the paragraph tag is outside of the translatable string. It does not work?

Unfortunately, I do not know any plugins that meet your needs. I still would like to better understand with is the problem you are facing with the plugins you are using now.

The code I posted above should solve the problem with the plugin you were using previously. Here is my previous answer: https://wpml.org/forums/topic/traduire-le-texte-order-completed/#post-2789547

I tested this in my testing environment and it looks like it worked correctly. I'm not sure if you tested it.

If I still do not understand what you mean, can you please elaborate a little more so I can better understand? Sometimes screenshots illustrating what you mean may go a long way to clarify what words fail to transmit so if you like make use of "upload an image" below the comment area.

Thank you.

October 15, 2018 at 4:45 pm #2818344

gillesB-3

Hello,

The problem is not simple because I partially solve the problems as our conversation.
at the moment i have just modified the texts present in the standard woocommerce email template and the wpml translation is now working (without adding your code that you gave me).

Here is the simple procedure that I used:
1) Copy the templates directly in backoffice WP / woocommerce / e-mail / in child theme
2) add the code (without <p>) in English in child template version Html and raw version
3) update in wpml / "Locating the theme and plugins" the child theme
4) Search the translation in Wpml / translation channel.

Now I would like to create other woocommerce personal order status and translate the e-mail to report
Example a status "delivery in progress" and translate "email subject" "email heading" "email text" correct.
For that I tested 3 plugin (2 pay including a official woocommerce and a free). in order to know which of these three plugin works with "string translation" of wpml to translate texts ("email subject" "email heading" "email text")

Here are the 3 plugins that are:
- PW-Advanced-Woocommerce-Order-Status action-manager-colorize-filtering-list
hidden link
- woocommerce-order-status-manager-1.4.1
hidden link
- Custom Order Status for WooCommerce
https://wordpress.org/plugins/custom-order-statuses-woocommerce/

Result no "email subject" "email heading" "email text" of these 3 plugin is taken up by the wpml translation channel.
I yet well via wpml "Localization of the theme and plugins" and I have updated them but nothing to do I do not find them in the translation WPML chain.

And so can you help me translate this text with wpml and these plugin.
If you have no other solution to create this "delivery" statute and allow to create translatable emails?

If you need a site tests with these 3 plugin I can make them available.
But I do not know if this ticket is private or public, can I send them directly in this post privately?

October 17, 2018 at 4:36 am #2823131

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you. To make it easier to verify the problem you're reporting, we should have to isolate one issue at a time.

Since your initial topic is about the "Email Text Customizer for WooCommerce" plugin, may I kindly ask you please to open a new ticket for your new questions? This will also help other users with similar problems find solutions when searching the forum.

For this reason, we will initially focus only on the "Email Text Customizer for WooCommerce". I'll need to request temporary access (wp-admin and FTP) to your site - preferably to a test site where the problem has been replicated if possible - in order to be of better help.

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.

Note:

*** Please let me know exactly what steps should I follow to see the problem.

*** Please, can I install the Duplicator or All in One Migration plugin to make a copy of your site and install it on my test environment? This will help me debug the problem.

*** Note: Please make a full backup of your site.

Privacy and Security when Providing Debug Information for Support: https://wpml.org/purchase/support-policy/privacy-and-security-when-providing-debug-information-for-support/

Thank you.

October 18, 2018 at 4:26 pm
October 23, 2018 at 4:02 am #2840703

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hello,

Thank you and my sincere apologies for the delay.

About the first question, when I access the template wp-content/themes/north-wp-child/woocommerce/emails/customer-processing-order.php, I can not find the code you posted above (you are probably using this inside the plugin, but the correct one, since you are editing this within the file would be you edit within your child theme).

The code, however, to be translatable should look like this:

<?php
// appel de la date de commande
$order_date = $order->order_date;

// date de commande
$order_date = date( 'd-m-Y', strtotime( $order_date ) );
echo '<h2>' . __( 'Order date:', 'woocommerce' ) . $order_date . '</h2>';

// Délais apriximatif
$order_date_20d = date( 'd-m-Y', strtotime( $order_date ) + ( 20 * 24 * 60 * 60 ) );
echo '<h3>' . __( 'Approximate delay (20 days): ', 'woocommerce') . $order_date_20d . '</h3><br>';
?>

Note that in strings I'm using the __() function, which makes the string to be translatable. You can see more details in the official WordPress documentation: https://developer.wordpress.org/reference/functions/__/

Then in WPML > Theme and plugins localization, you can re-scan your child theme and in WPML > String Translation, translate the content you want. By following the steps above, can you translate the content correctly?

Thank you.

October 23, 2018 at 9:30 am #2841689

gillesB-3

Hi Bruno,

Thanks for the information it works!

remains a last concern.
When I write in the email template email_customer_processing_order:
"Dear {customer_name}" the variable code works.
In English e-mail it is well written "Dear Gilles".

But when I translate french "Dear {customer_name}" by "Hello {customer_name}" in the translation string, the e-mail variable code does not work. WPML takes into account the text to translate but it does not take against the variable code and it says "Hello {customer_name}"

Do you have a solution for the string translation to take into account the {customer_name} hook?

Note
- I do not have this problem with the e-mail news order that he send me
- I leave the example on the site

Regards,

October 26, 2018 at 10:51 am #2852827

Bruno
Supporter

Languages: English (English ) Portuguese (Brazil) (Português )

Timezone: America/Sao_Paulo (GMT-03:00)

Hi,

Glad to hear that it now works. About your second question, this code you want to translate is inserted where? Is this a custom coding? Or is that some option of your theme/plugin?

I tried to find the code you're talking about above, but I did not find it. Please, could you tell me what is the file and where is this file located so that I can check it?

Thank you.

October 28, 2018 at 11:35 pm #2856518

gillesB-3

I solved all the problems with the update of woocommerce 3.5.
But it's unfortunate that woocommerce does not include functions manage the order mail, and a parameter to indicate a simple delivery dates (without a calendar).
Two simple functions poutant seems like even basic for an e-commerce site.