Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
The client was unable to translate certain hardcoded strings on the checkout page, which were not visible in WPML's "Choose texts for translation" section.
Solution:
1. We added the missing text domain to the hardcoded strings by replacing the code:

__('Numéro de PO du Client')

with:

__('Numéro de PO du Client','savoy-child')

2. We scanned the child theme from WPML >> Theme and plugins localization page.
3. We navigated to WPML >> String Translation page, searched for the strings, and noticed that the English language was assigned to the French strings.
4. We selected those strings and assigned the French language using the "Change the language of selected strings" dropdown.
5. We added the translations, and they now appear correctly.
For more details, you can check the documentation here: https://wpml.org/documentation/getting-started-guide/string-translation/how-to-change-the-source-language-of-strings/

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 further assistance is needed, please open a new support ticket at WPML support forum.

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: 

This topic contains 2 replies, has 2 voices.

Last updated by claudeD-16 5 months, 2 weeks ago.

Assisted by: Noman.

Author Posts
June 4, 2024 at 12:59 pm #15702163

claudeD-16

Noman, you are an absolute king! What a job you just did! I used some of the tricks you highlighted in your last reply and was able to fix a few additional strings I couldn't translate before and it worked!

The only strings left, as far as I can see this morning are in the Checkout Page and were coded by someone else. I don't know where to look for to translate, WPML doesn't seem to see them even tough I went into the "Choose texts for translation" section.

There's only 3 lines, there's the "récupérer chez Anidis", which should be "Pickup at Anidis" in english, and below that the "Numéro de PO du client" which should be "Customer's PO number" and finally the line "Entrez votre no de PO (optional)" which should be "Enter your PO number".

If you can let me know how to find these and translate them, we will be done for the string translation mysteries.... and we could proceed with the new thread you created for the manual product translation...

Thanks a million again!

June 4, 2024 at 1:08 pm #15702175

Noman
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. For translating the strings on checkout page, I’ve followed the below steps:

1. Added the missing text domain for the hardcoded strings by replacing the below code:

__('Numéro de PO du Client')

With:

__('Numéro de PO du Client','savoy-child')

2. Scan the child theme from WPML >> Theme and plugins localization page.

3. Went to WPML >> String Translation page, searched for the strings, and I’ve noticed that the English language was assigned to the French strings.

4. Selected those strings, assigned the French language using “Change the language of selected strings” dropdown as you can see in the attached screenshot.

5. Added the translation and now it seems to be shows correctly. Could you please check and confirm?

Here is a doc for more details:
https://wpml.org/documentation/getting-started-guide/string-translation/how-to-change-the-source-language-of-strings/

Thank you

frontend strings - checkout.jpg
assignging the correct source language.jpg
June 4, 2024 at 1:21 pm #15702228

claudeD-16

Hi again. I have followed the steps in the thread you sent me and it worked like a charm! Everything is now translated to my taste, thanks to you. This resolves this issue for me. I'll transfer now to the other thread we have going for the products manual translations.

Noman, thanks again for all your help you have no idea how much it's appreciated.

June 4, 2024 at 1:22 pm #15702231

claudeD-16

Noman is king! He fixed everything I asked and more! Thank you again.