we have import function that retrieves data from external service.
now we need to add translation jobs from import script so the WPML will create translations for the imported post.
how can we achieve that ?
with function wpml_add_translation_job ?
At the moment, WPML does not provide a public hook or API method to programmatically trigger automatic translation on demand from custom code.
If you would like posts to be translated automatically after they are imported, you can enable the Translate Everything Automatically option by navigating to WPML → Translation dashboard.
Once this option is activated, any newly published content will be translated automatically according to your WPML settings.
The challenge with enabling automatic translation for everything is that we only want this to apply to a specific post type, and only into certain languages. To give you a bit more context on our workflow: we have an external integration that pushes job listings into our website. Once these come in, we'd like them to be automatically translated into 4 out of our 5 WPML languages.
Based on this setup, do you know whether there is a workaround to achieve this? We're open to any solution, whether that's a custom hook, a WPML API approach, or another method.
Languages: English (English )Spanish (Español )Italian (Italiano )
Timezone: Europe/Madrid (GMT+02:00)
Hi there,
Thank you for your detailed explanation!
In this case, WPML does not currently provide a built-in option to automatically translate content based on a specific post type and only into selected languages when it is imported via an external integration. Automatic translation can be enabled globally, but it cannot be limited to particular post types and target languages simultaneously.
Please go to WPML --> Translation dashboard and send the content to automatic translation.