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.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 | 9:00 – 18:00 |
- | - | - | - | - | - | - |
Supporter timezone: America/Lima (GMT-05:00)
This topic contains 5 replies, has 0 voices.
Last updated by Andreas W. 2 months, 3 weeks ago.
Assisted by: Andreas W..
Author | Posts |
---|---|
February 26, 2025 at 8:05 pm #16753263 | |
koenL-7 |
Background of the issue: Symptoms: Questions: |
February 26, 2025 at 11:00 pm #16753607 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Hello, I gave this a quick test. Example: If English is site default language, this will display all English posts: This also displays all English posts: This displays all French posts: With "?lang=all" I am getting only translations, but not the original content. Is this the issue that you would like to report? Best regards |
February 27, 2025 at 7:54 am #16754284 | |
koenL-7 |
The example given is for products, which work. The terms of the attributes however doesn't. It used to include "translations" : [id_english, id_dutch, id_german] with every object and the lang=all parameter does not give us the german and english terms, only the default dutch terms. See example below: |
February 27, 2025 at 2:52 pm #16756791 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
I consulted ChatGPT about it and it returned: Using ?lang=all in the WP REST API is not valid. The lang parameter in WordPress, when used with a multilingual plugin like WPML or Polylang, expects a specific language code (like en, fr, de, etc.) to filter the content based on language. If you wish I can double-check about this with our devs? |
February 27, 2025 at 3:01 pm #16756809 | |
koenL-7 |
The lang=all is documented on the page https://wpml.org/documentation/related-projects/woocommerce-multilingual/using-wordpress-rest-api-woocommerce-multilingual/. Also, the lang=en and lang=de is not returning the translated terms, which it did on the previous host. The site has moved to another host, on the previous api we had the translations: [en, de, nl] in the object returned from the rest api, without any parameter. Also, we are noticing that even tho the translation_ids haven't changed, posting a product translation will disconnect the product or even create a new duplicate product. We consulted our chatgpt intern and did all the steps before submitting. I think there might be an issue with the connection to the products or indexing, if that exists. We also tried several options on the support page, to reconnect the tables, etc. Could we get support within our website, since we tried the basic steps and it's a bit time sensitive? |
February 27, 2025 at 3:14 pm #16756910 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Thank you very much for pointing this out. I have to admit that I was not updated on this matter. I will run further tests today and then escalate accordingly. |
February 27, 2025 at 3:16 pm #16756929 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Maybe it would be ideal if I first take a look at the config of your site. I would like to request temporary access (wp-admin and FTP) to the site to investigate the issue further. The required fields are below the comment section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it. IMPORTANT If you cannot see the "wp-admin / FTP" fields, your post and site credentials will be set to "PUBLIC". DO NOT publish the data unless you see the required wp-admin / FTP fields. The private reply form looks like this: The next time you reply, click on "I still need assistance". Video: Please note that we are obliged to request this information individually on each ticket. We are not permitted to access any access information that was not specifically submitted on this ticket in the private response form. |
February 27, 2025 at 7:39 pm #16757986 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
When using WPML with WooCommerce you will need to install our add-on "WooCommerce Multilingual & Multi-Currency. Please read this guide, install the addon, and then test again: You can find the add-on at Plugins > Add new > Commercial (tab). Also, please take kindly note that you should always update all components and confirm if an issue persists, before reporting an issue on support. Currently, many plugins on your site are outdated. |
February 27, 2025 at 8:50 pm #16758185 | |
koenL-7 |
Thanks for the response. The plugin was installed before our report and now is again active on this version, I still see the download from last night and the communication after I updated it. Activating it again didn’t give me an initial change, unless I add the lang parameter, which didn’t work before. After installing this version, I went to support>troubleshooting and clicked the following (translated from dutch) After this, we now see the translations when we add the params for lang=en and see the right translations with the id of the dutch version. We do still mis the translations: [en_id, de_id, nl_id] in the call to the terms without a parameter. We also see the same for the products, where the product object would also contain the same translations part. Even tho this result is different than previous situation, with changes on my side I can make it work again. I will test synchronization in the morning and check for disconnections or duplicate products. It will be some work to fix the disconnections. The question for now: should the translations: [] part be active in products, terms or any other object (since we used this) and if so, why isn’t that shown in this version. In short: If I only use the lang parameter for synchronizing in stead of the translations, will this give us a stable method for the future. We use an external application to manage products and translations, so we need the affirmation on deciding on this route. |
February 27, 2025 at 8:51 pm #16758187 | |
koenL-7 |
For context, below the function which worked based on the translations part of the object. We now have to either convert it to work with the parameter, but it would be better to have the connected translations in the objects again. It would save a lot of work |
February 28, 2025 at 1:24 pm #16760982 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
I am sorry, but I am really not sure if I understand what you are trying to achieve. Do you mean that you want to make one REST call and edit original content and translations at the same time? According to our docs the lang parameter works like this for POST requests: lang – the respective lang value will be set for the product variation. If omitted, the default language of the site will be used. Our documentation does not provide any example of using the parameter "all" when sending a POST request. You might only be able to use this parameter to GET data. --- I can offer to provide a WPML test site on which you can integrate your code for running some tests. |
February 28, 2025 at 7:53 pm #16762613 | |
koenL-7 |
Just to shrink the issue: There used to be a parameter here "translations". |
February 28, 2025 at 8:15 pm #16762703 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
Yes, every original product should include something like: [translations] => stdClass Object Take note, that this parameter might not be included when calling translations. Currently, our plugins are outdated. Please go to Plugins > Add new > Commercial and install the latest versions of WPML and all used add-ons. Then test again and let me know if the issue persists. |
March 4, 2025 at 8:49 am #16772011 | |
koenL-7 |
We altered our functions according to your results (I can’t be more clear on where in the product response I expect a translations array) and tested creating the products, but we still get disconnected from the main product or a new product is created when we do this with the REST api. Either posting to the batch endpoint (request below) or posting with the normal product create endpoint “/products/?lang=en”, results in products being created as a dutch product. Below the minimized request to create product endpoint. It creates a new, dutch product, not connected to the product with id 353321. How can this happen and how can we solve it? { |
March 4, 2025 at 6:40 pm #16775660 | |
Andreas W. WPML Supporter since 12/2018 Languages: English (English ) Spanish (Español ) German (Deutsch ) Timezone: America/Lima (GMT-05:00) |
I am really sorry but I feel we are running in circles or at least running from one issue into another one. I need to know exactly what you are trying to do. do which part of our documentation are you referring? To clarify, you are trying to create translation at the same time while updating original content (product or global attribute) on the same request or are you trying to directly edit a product in a second language with one request? I would like to offer once more to provide a WPML test site on which you can recreate the issue. |
The topic ‘[Closed] Translation ID’ is closed to new replies.