Skip to content

Machine translations appear in the API incorrectly #9592

@ahukkanen

Description

@ahukkanen

Describe the bug
Running the following query in the default development app with the default seeds:

{
  participatoryProcesses {
    id
    slug
    title {
      translations {
        locale
        text
      }
    }
  }
}

Results in the following type of outputs in the title field responses:

"title": {
  "translations": [
    // ...
    {
      "locale": "machine_translations",
      "text": "{\"es\"=>\"Corrupti blanditiis voluptatem harum excepturi.\"}"
    }
  ]
}

To Reproduce
Steps to reproduce the behavior:

  1. Go to the GraphiQL interface of the API
  2. Run the described query
  3. See the issue

Expected behavior
I would expect the machine translations to either show up as their own field or the API to parse the machine translations for the locales that have not actual translation values defined for them.

Screenshots
N/A

Stacktrace
N/A

Extra data (please complete the following information):

  • Device: (any)
  • Device OS: (any)
  • Browser: (any)
  • Decidim Version: current develop, probably after machine translations were introduced
  • Decidim installation: N/A

Additional context
N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions