Skip Navigation

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

Problem:
The client reported that certain hardcoded strings on their product page were not translating, despite having translations available. Additionally, content in the Information tab was not displaying correctly.
Solution:
1. To address the display issue in the Information tab, we added the following CSS to the custom CSS section of the theme:

.woocommerce-Tabs-panel .woocommerce-Tabs-panel {
    display: block !important;
}

This change ensured that the tab content is now visible in all languages.
2. For the hardcoded strings on the product page, such as 'Code du produit', we took the following steps:
- Enclosed the strings within the gettext __() function in the functions.php file of the child theme, changing 'Code du produit' to:

__('Code du produit', 'savoy-child')

- Scanned the child theme using WPML's Theme and plugins localization feature.
- Located the string on the WPML String Translation page and added its translation.
For more details on translating themes, you can refer to this documentation: Translating the Theme You Created
3. A separate issue related to manually translating product details has been addressed in a new support ticket.

If this solution does not resolve your issue or seems outdated, we recommend opening a new support ticket. We also advise 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. For further assistance, please visit our support forum 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 4 replies, has 2 voices.

Last updated by Noman 5 months, 3 weeks ago.

Assisted by: Noman.

Author Posts
June 2, 2024 at 9:56 am #15695337
claudeD-16

Some lines that were encoded for me by a programmer don't seem to translate (In the screenshot, there are "Code du produit", "Quantité par caisse ou palette" and "Prix de détail suggéré" on the product page), even thought I did translate the strings....

Maybe it'd be easier if you could access my site. I have a temporary user plugin I could link you with if you want to.

Thank you for your time again.

New threads created by Noman and linked to this one are listed below:

https://wpml.org/forums/topic/manually-translating-product-issue/

June 2, 2024 at 11:40 am #15695417

Noman
Supporter

Languages: English (English )

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

Hi,

Thank you for contacting WPML Support. To take a closer look at this issue, please provide temporary access (WP-Admin and FTP Login info) to your site (preferably staging site), so that I can look into your setup and debug the issue.

I’ve enabled a private input box for your next reply.

=== Please backup your database and website ===

✙ I would additionally need your permission to deactivate and reactivate Plugins and the Theme and to change configurations on the site. This is also a reason the backup is really important.

✙ Please provide me an example product link where I can see this issue.

Thank you

June 4, 2024 at 8:35 am #15700315

Noman
Supporter

Languages: English (English )

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

Thanks for sharing the access to your site.

1. For the Information tab, I've examined the source code and noticed that the content was already there but it was hidden using a CSS, so I've added the below CSS in custom CSS section of the theme:

.woocommerce-Tabs-panel .woocommerce-Tabs-panel {
    display: block !important;
}

And now information tab content shows correctly in both languages.

2. For translating the hardcoded strings on the product page, I've followed the below steps:

- Wrapped the strings in the gettext __() function by replacing the below string:

Code du produit

With:

__('Code du produit', 'savoy-child')

From functions.php file of the child theme.

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

- Went to WPML >> String Translation page, searched the string and added the translation and now it seems to be showing the correct translation at frontend.

Here is a doc for more details:
https://wpml.org/documentation/support/translating-the-theme-you-created/#understanding-gettext-and-text-domains

3. For manually translating product issue, it’s a different issue and will be handled separately as per our support policy. I've created new ticket for this at: https://wpml.org/forums/topic/manually-translating-product-issue/

If your product strings translation is solved, please mark this ticket as resolved and we will continue working on the above ticket for it.

Thank you for your cooperation

product strings.jpg
info tab content.jpg
tab content translaton.jpg
June 4, 2024 at 11:37 am #15701791
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!

New threads created by Noman and linked to this one are listed below:

https://wpml.org/forums/topic/string-translation-issues-on-checkout-page/

Screenshot 2024-06-04 at 7.29.02 AM.png
Screenshot 2024-06-04 at 7.29.09 AM.png
June 4, 2024 at 1:15 pm #15702215

Noman
Supporter

Languages: English (English )

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

Glad to hear it helps 🙂

For checkout page string translation issues, I've created new ticket for this at: https://wpml.org/forums/topic/string-translation-issues-on-checkout-page/

If the string translation issue on product page is solved, please mark this ticket as resolved and we will continue working on the above ticket for it.

Thank you for your cooperation