Need to add taxonomy term with translation via REST API

Steps to Reproduce

  1. Drupal install
  2. Enabled Language,Interface Translation,Content Translation,Configuration Translation modules
  3. Created Custom Vocabulary and enabled following option Show language selector on create and edit pages Enable translation
  4. Given Permission as follows Create/Edit Translations Translate taxonomy term
  5. REST API For creating a term I will be doing a POST operation first and then execute another PATCH operation with translation langcode.
{"langcode":[{"value":"en"}],"vid":[{"target_id":"<custom vocabulary machine name>"}],"name":[{"value":"test taxonomy"}]}

{"langcode":[{"value":"ar "}],"vid":[{"target_id":"<custom vocabulary machine name>"}],"name":[{"value":"test taxonomy ar"}]}

Even both these API return success,The original language value changes to the translation value based on langcode in the request.

How can I prevent that from happening?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.