Skip Navigation

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

Problem:
The client was unable to translate the WooCommerce Extras section that can be added to single product listings.
Solution:
We recommended adding the following code to the Custom XML Configuration in WPML-> Settings-> Custom XML tab:

<wpml-config>
  <admin-texts>
    <key name="astra-settings">
      <key name="single-product-extras-text"></key>
      </key><key name="single-product-extras-list">
        </key><key name="items">
          </key><key name="*">
            <key name="label"></key>
          </key>
        
      
    
  </admin-texts>
</wpml-config>

After adding the code, we instructed the client to:
1. Go to the String Translation page.
2. Search for "single-product".
3. Delete the four strings related to the section.
4. Search again for "single-product".
5. Translate the strings.
6. Clear the site's cache.
7. Check if the strings are translated correctly.
8. Add a new test product and translate it to check the issue.
We also provided a guide for further information on registering admin strings: https://wpml.org/documentation/support/language-configuration-files/translate-strings-in-wp-options-table/

Please note that the solution might be irrelevant due to being outdated or not applicable to your case. If the issue persists, we highly 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 necessary, do not hesitate to open a new support ticket for further assistance: 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 25 replies, has 3 voices.

Last updated by Osama Mersal 1 year, 2 months ago.

Assisted by: Osama Mersal.

Author Posts
March 4, 2024 at 1:57 pm #15369985

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Klaus,

Thanks for the access details. I checked the site and was able to add the extras from the Astra-> Dashboard page.

Please check if the issue is replicable on the sandbox site.

Thanks for your cooperation

Best regards,
Osama

2024-03-04_15-54-59.jpg
March 4, 2024 at 3:36 pm #15370738

klausW-6

Hi Osama,
this is set up here now and already one of the four strings simply shows untranslated - even though it is all done in the list.

Klaus

Screenshot 2024-03-04 at 16.32.18.png
Screenshot 2024-03-04 at 16.32.40.png
Screenshot 2024-03-04 at 16.33.36.png
March 4, 2024 at 3:49 pm #15371032

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

I added the following code to WPML-> Settings-> Custom XML tab.

<wpml-config>
  <admin-texts>
    <key name="astra-settings">
      <key name="single-product-extras-text"/>
      <key name="single-product-extras-list">
        <key name="items">
          <key name="*">
            <key name="label"/>
          </key>
        </key>
      </key>
    </key>
  </admin-texts>
</wpml-config>

Kindly check this guide to know more about registering admin strings. (https://wpml.org/documentation/support/language-configuration-files/translate-strings-in-wp-options-table/)

Please check if the strings are translated correctly. (hidden link)

If translated correctly, please try reproducing the revert strings issue.

Best regards,
Osama

March 5, 2024 at 10:09 am #15373542

klausW-6

Hi Osama,
Am I meant to add this code on the main site? I did - and the issue remain exactly as it was! The vocabulary in the customiser panel switches to English and the English translation is shown on both English and German pages.

Klaus

March 5, 2024 at 10:12 am #15373546

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Klaus,

Thanks for your update. Please try to replicate this issue on the sandbox site.

If the issue is not replicable, please try the following steps:

1- Deactivate all the plugins except the active ones on the sandbox site.
2- Switch to a WordPress default theme like Twenty Twenty-one.
3- Delete the strings from String Translation.
4- Re-translate the strings.

If the issue is gone, activate them one by one to see which one is causing an interaction issue.

❌ Please backup your database before performing the above test ❌

Best regards,
Osama

March 5, 2024 at 10:20 am #15373596

klausW-6

Excuse me?
I already did all that days ago. Several times on the real site and the staging site.
It works fine at the moment at the sandbox since you added the code. What else am I meant to do there?

March 5, 2024 at 10:26 am #15373601

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi,

Currently, the strings are translated correctly in both languages. Please check this product. (hidden link)

It has the same status as the sandbox site. However, the strings revert to the wrong language when adding a new product, so please add a new product and translate it in both sites to check the issue.

Best regards,
Osama

March 5, 2024 at 11:12 am #15373979

klausW-6

Hi Osama,
I listed new products and translated them in both the sandbox and the staging site and it continues to work fine!

So .. What needs to be done to get the main site to do the same? Just adding the code does not yet do the job.

Klaus

March 5, 2024 at 11:16 am #15374019

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Klaus,

Please check the following steps:

1- Add the code to WPML-> Settings-> Custom XML tab
2- Go to String Translation
3- Search for "single-product"
4- Delete the 4 strings
5- Search again for "single-product"
6- Translate the strings
7- Clear the site's cache
8- Check if the strings are translated correctly
9- Add a new test product and translate it to check the issue

Best regards,
Osama

March 8, 2024 at 11:27 am #15388799

klausW-6

Hi Osama
thank you for this - I wanted to wait a bit before anwering, but am happy to say that this now works and seems to stay solid.

I also have an ongoing issue with Astra Pro 'Custom layoutss' using hooks. A colleague of yours previously advised me to solve this problem by simpl manually creating English duplicates. As I add - and change these frequently it's an ongoing, slow, time consuming process. Is that something that could be solved with extra lines of code?

I do have one further question. On the home page, I use a 'News - Ticker' - which is html and css that I inserted manually (not a plug in). I have translated the English version but whenever I change even one letter of the German, I have to do it all again. As its a news ticker ... that happens a lot. Is there a way to synchronise that?

Many thanks,

Klaus

March 9, 2024 at 10:20 am #15391283

Osama Mersal
WPML Supporter since 02/2020

Languages: English (English ) Arabic (العربية )

Timezone: Africa/Cairo (GMT+03:00)

Hi Klaus,

It's great to hear that the issue is fixed. 🙂

As the original issue is resolved, may I kindly ask you to open a new ticket for your additional question?

We try to keep one issue per ticket in our forum. Continuing with one ticket per issue helps supporters focus on one issue at once and enables other users to find solutions to their questions faster.

Have a great day!

Best regards,
Osama