wordpress wpml translation for custom post

I’ve created a custom post submission form for a specific category on my WordPress site. The form works fine for submitting posts, but there’s an issue with translation.

When a user submits a post using the form, the post is created but not translated immediately. However, if I then manually edit and save the post from the backend, it automatically gets translated as expected.

It seems like the translation is only triggered when a post is updated, not on the initial submission.

What I’ve tried so far:

Checked the form code and confirmed the correct category is assigned.

Verified that translation settings are working correctly for posts submitted through the WordPress dashboard.

Looked into hooks like save_post and wp_insert_post, but haven’t been able to trigger the translation on submission.