• Resolved aegisjester

    (@aegisjester)


    We have a “headless” wordpress site where we use the wordpress API to import post content into our app, fetching by post ID (e.g. /wp-json/wp/v2/posts/123).

    I am curious if/how this plugin works with the API. Do the cached translations have their own unique post ID, or is there a param we can pass in the json to get the translated version of a given post?

Viewing 1 replies (of 1 total)
  • Plugin Author Gerard Kanters

    (@gkanters)

    AI Translate does not create separate posts for translations. Post 123 stays post 123 in every language.

    Translations are generated from the rendered HTML page and stored as cached HTML per language (not as WordPress posts). The WordPress REST API is not translated: /wp-json/wp/v2/posts/123 always returns the original content. There is no query parameter to request a translated JSON version.

    To get a translated version you would fetch the public HTML URL for that language, e.g. https://yoursite.com/de/{translated-slug}/ (same post, language-prefixed URL). That response is HTML, not the REST JSON payload.

    Headless REST translation is not supported at the moment.

Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.