trp_translate function not working
-
Hello
I’m a developer of the WooCommerce Google Feed Manager plugin (https://www.ads-software.com/plugins/wp-product-feed-manager/) and I’m having an issue with making our plugin compatible with yours. I thought we had this working, but after a user contacted us reporting that our plugin fails to translate products in our feed, I tested it on my own test server and it indeed does not seem to work (anymore).
I’m using your trp_translate function to translate product information like title (post_title), description (post_content) and post_excerpt. On my test server I’ve set up TranslatePress with English (United States) as the Default language and Dutch as a second language. I translated several products in the shop to Dutch and in the shop this works great, I can switch between both languages.
But when I try to generate a feed with these translated products, the trp_translate function keeps returning the product details in English, even though I input the language as “nl_NL”.
When I take a deeper dive in the code I noticed that in the trp_translate function the global variable $TRP_LANGUAGE keeps the “us_US” value, even though it is set tot “nl_NL” in row 718. I even tried to force the $TRP_LANGUAGE variable to “nl_NL” just before the translate_page function is called (row 721), but even then my debugger reports that $TRP_LANGUAGE is stil “us_US”.
Any ideas what I’m doing wrong here?
- The topic ‘trp_translate function not working’ is closed to new replies.