Problem/Motivation

may be relevant to #2135829: [PP-1] EntityResource: translations support
The problem is that when using multiple languages in the REST web service
we don't get back language specific results in the JSON data.

Steps to reproduce

  1. install fresh copy of Drupal 8
  2. install the restui contributed module (http://ftp.drupal.org/files/projects/restui-8.x-1.x-dev.tar.gz)
  3. enable the module (drush en restui -y)
  4. create a view with a REST export display and specify a path (for example /firstview) to get results in (export of the entire site is in this uploaded file, config.tar.gz)
  5. enable the Content Translation module
  6. create a new language other than English (mine was Traditional Chinese) /admin/config/regional/language
  7. create a piece of content, like an article.
  8. translate article
  9. call web service to get the results back in Traditional Chinese (curl -H 'Accept: application/json' --request GET http://d8/zh-hant/firstview )
  10. json results are in English
  11. expected Chinese for chinese language results

Proposed resolution

Remaining tasks

  • (done) make the steps to reproduce details
  • investigate cause

User interface changes

n/a

API changes

?

CommentFileSizeAuthor
#1 config.tar_.gz33.98 KBzippydoug
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

zippydoug’s picture

Issue summary: View changes
FileSize
33.98 KB
zippydoug’s picture

Issue summary: View changes

made steps to reproduce more specific.

Gábor Hojtsy’s picture

Right. In #2135829: [PP-1] EntityResource: translations support the argument is the REST endpoints should not be different per language and language should be a request detail (practically Accept-language: XXXXX). Until that question is resolved, there is no way to get to specific languages in REST I believe. Your feedback on #2135829: [PP-1] EntityResource: translations support would be very welcome.

Gábor Hojtsy’s picture

Issue tags: +REST
Gábor Hojtsy’s picture

Status: Active » Closed (duplicate)

Sounds to me this is the same as #2135829: [PP-1] EntityResource: translations support. Please provide more feedback there.

clemens.tolboom’s picture

I've added the steps to reproduce to #2135829: [PP-1] EntityResource: translations support

@zippydoug thanks for the steps.