BoltTranslate / Translate

Provides translation for contenttypes.
Other
43 stars 38 forks source link

Repeater Field Translation Not Displayed #175

Open dominiclooser opened 6 years ago

dominiclooser commented 6 years ago

[BUG]

I have the same problem as issue #90, but could not solve it with accessing the content with get(), as suggested there.

I have a contenttype projects with a repeater field descriptions, which itself has fields content and label. content and label are translatable (en and de). the german translation does not get displayed, but is in the database (i am not sure if its at the right place: its in dedata under descriptions key).

I experimented with different ways of accessing the data in twig and recreating the data in the database. everything without success. sometimes, under circumstances which seem very random, the german translation got displayed. for example when i when i access a single project with setcontent project = 'projects/2' . if i sort the projects differently, sometimes the german translation got displayed too. but i didn't see a clear pattern.

as said, the workaround with project.get('descriptions')[0].get('content') did not work for me. so i am running out of ideas. what is strange too, i got another contenttype with a repeating field and there the tranlsation works fine.

projects:
   name: Projects
   singular_name: Project
   viewless: true
   default_status: published
   title_format: [title]
   fields:
      title:
         type: text
         translatable: true
         group: content
         variant: inline
         class: large
      color:
         type: text
         variant: inline
      start_year:
         type: integer
         label: Start Year
      end_year:
         type: integer
         label: End Year
      ongoing:
         type: checkbox
      images:
         type: imagelist
         translatable: true
      descriptions:
         type: repeater
         translatable: true
         fields:
            content: 
               type: html
               translatable: true
            label:
               type: text
               translatable: true
               variant: inline
      locale:
         type: locale
      dedata:
        type: hidden
      deslug:
         type: locale_data
         index: true
      endata:
         type: hidden
      enslug:
         type: locale_data
         index: true
- setcontent projects = 'projects'
- for description in project.get('descriptions')
    .text != description.get('content')
(harp)

Details

SvanteRichter commented 5 years ago

I experimented with different ways of accessing the data in twig and recreating the data in the database. everything without success. sometimes, under circumstances which seem very random, the german translation got displayed. for example when i when i access a single project with setcontent project = 'projects/2' . if i sort the projects differently, sometimes the german translation got displayed too. but i didn't see a clear pattern.

Could you please make exact steps and configs to reproduce this in a sqlite setup, and I'll have a look at it. The repeater support has been iffy, but it should at least be consistent under the same conditions.