V8-archive: Get Item (API) with the appropriate translation

Created on 19 Feb 2020  Â·  7Comments  Â·  Source: directus/v8-archive

Bug Report

Steps to Reproduce

  1. Create a collection and a translation interface
  2. Create an example item, with a bunch of translations
  3. Try to get the item through the API, targeting specific a translation

Expected Behavior

It seems that I get the translation collection working. I can add items, add translations, etc. However, I've read all the documentation and I still not sure how to get the translated content via API

Actual Behavior

Other Context & Screenshots

Technical Details

  • Install Method: cloned master branch
  • Directus Release Version: 8.5.5
question

Most helpful comment

@rijkvanzanten @WoLfulus — can we get this updated in the Docs?

All 7 comments

add7a23a548dee0373bbf084b1ed2cdf-1
as

Use the fields parameter to fetch nested relational data, like translations. https://docs.directus.io/api/query/fields.html

Hi @rijkvanzanten thanks for your answer. Using "?fields=." on the api call, I can see the translations, as well as any other nested field.

However, I thought there was a more direct approach to translations, by just passing the language you want to get on the API call itself, and get that language only (without the hassle to fetch the translations by yourself)

I've seen some posts about a ?lang parameter:
https://github.com/directus/api/issues/135
https://github.com/directus/api/issues/1390

Is this feasible?

Regards!

Agreed. It seems all this documentation was removed in https://github.com/directus/docs/commit/e6b0bd17a3fb1dd7f7af0d049ca637f862555d3f#diff-8a5da52ed126447d359e70c05721a8aa

@rijkvanzanten @WoLfulus — can we get this updated in the Docs?

Any update on that matter?

A update on this would be helpful

Was this page helpful?
0 / 5 - 0 ratings

Related issues

binary-koan picture binary-koan  Â·  3Comments

Nitwel picture Nitwel  Â·  3Comments

ondronix picture ondronix  Â·  3Comments

vuhrmeister picture vuhrmeister  Â·  3Comments

HashemKhalifa picture HashemKhalifa  Â·  3Comments