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: Custom Work
This topic contains 9 replies, has 2 voices.
Last updated by Mateus Getulio 1 year, 5 months ago.
Assisted by: Mateus Getulio.
Author | Posts |
---|---|
August 10, 2023 at 1:08 pm #14182595 | |
stefanoS-55 |
Tell us what you are trying to do? Is there any documentation that you are following? Is there a similar example that we can see? What is the link to your site? |
August 10, 2023 at 8:27 pm #14184965 | |
Mateus Getulio Supporter
Languages: English (English ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hi there, Thanks for your contact! There is no native way to bulk change product languages. The only way you can do bulk things in products is: 1) REST API : 2) WP All Import with WPML All import : 3) Here my colleague offered another option, which involves database manipulation: https://wpml.org/forums/topic/product-default-language/#post-9596035 I hope this helps. Please let us know if you need any further assistance. Regards, |
August 11, 2023 at 10:06 am #14187689 | |
stefanoS-55 |
Hi Mateus, I think to use a DB query like this to select products and change their value SELECT * FROM `_icl_translations` WHERE `source_language_code` = "it" AND `element_type` = "post_product" OR "post_product_variation"; The things that are not clear to me are these: Regards |
August 11, 2023 at 8:50 pm #14190837 | |
Mateus Getulio Supporter
Languages: English (English ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hi there, Thanks for your reply. Answering your questions: - there are other "element_types" to change - is it the "source_language_code" variable that I need to modify? DISCLAIMER: Note: the possible solution provided is to be used just as an informational one. Please remember that custom coding is out of the scope of our support, so we can't create, debug or modify code for you and it's your responsibility to maintain it. We hope the one we used as an example could point you in the right direction. Please check our support policy: - https://wpml.org/purchase/support-policy/ Thanks for your understanding. If you need anything else don't hesitate to contact us. |
August 14, 2023 at 7:30 am #14194949 | |
stefanoS-55 |
Hi Mateus Thanks for your reply I find it really absurd that a paid plugin doesn't have this basic function by default and forces users to experiment with their own sites |
August 14, 2023 at 4:57 pm #14199273 | |
Mateus Getulio Supporter
Languages: English (English ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hi there, Thanks for your reply. Although this feature seems to be a simple function, its implementation might not be that easy. In order to not compromise the original website, please consider to test it first in a staging or local version. Thanks, |
August 15, 2023 at 6:15 am #14201265 | |
stefanoS-55 |
Hi Mateus, I'm make a simply test by modify source_language_code from "it" to "de" in a test product but nothing has changed; the original language of the product remains "it". Is there anything I need to do other than change the language code? |
August 15, 2023 at 4:18 pm #14204273 | |
Mateus Getulio Supporter
Languages: English (English ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hi there, Thanks for your reply. Please apologize me, you asked about the 'source_language_code', and somehow I've read it as 'language_code' - which is the right column here. Therefore, instead of 'source_language_code', try to change the 'language_code' value. If you get a 'trid' duplicated message, make sure to delete the German translation of the post (this error message only appears if the post already has a translation). Another possibility, if you want to avoid meddle with the database, is to bulk duplicate the 'Italian' products to German, as explained here: https://wpml.org/forums/topic/i-want-to-change-all-content-to-another-standard-language/#post-14199925 Please check the info above and let me know if you still have doubts. Thank you. |
August 16, 2023 at 1:11 pm #14236017 | |
stefanoS-55 |
Hi Mateus, I did some tests and found that: language_code : is the language code of the product it is wrong to edit language_code. This is because the texts inserted in a specific language code are of the indicated language. if I change language_code from IT to DE for example I will have a German product sheet with Italian language i think the correct way is to work on source_language_code. In the attached image an example of the change I tried to make unfortunately nothing has changed, so I don't know if I have to do anything else. as for the modification query, there are no problems, I write it, but I need to know how your DB works, I kindly ask you to inform yourself as best as possible to help me solve the problem. |
August 16, 2023 at 8:35 pm #14241257 | |
Mateus Getulio Supporter
Languages: English (English ) Portuguese (Brazil) (Português ) Timezone: America/Sao_Paulo (GMT-03:00) |
Hi there, Thanks for your reply. I'm not sure if I fully understood this: it is wrong to edit language_code. This is because the texts inserted in a specific language code are of the indicated language. if I change language_code from IT to DE for example I will have a German product sheet with Italian language Could you please give an example of this behavior? For instance, I have made some tests in a Sandbox. Three Italian products were created, and their language could be changed without problems to German through SQL commands. I've recorded a video showing how to change it back to Italian, and at last, I modified to German again. Please check it out: hidden link If you want to access the Sandbox and make your own tests, just do it through the automatic login link that I'll provide in my next private reply. When possible, please take a time to read our doc related to the icl_tables: https://wpml.org/documentation/support/wpml-tables/ Furthermore, I have to emphasize that custom code solutions are out of the scope of this support forum. We can guide you through some examples, but not create the code customized for you. Please consider consulting one of our partners: https://wpml.org/contractors/ Thanks for your understanding. |