BoltTranslate / Translate

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

[BUG?] Not translating specific template fields #117

Closed iamajoe closed 7 years ago

iamajoe commented 7 years ago

Using a specific templatefield, I set the "title" to "X" in a language A and to "Y" in language B. Language A "title" has become "Y" when it should've stayed at "X".

Details

Reproduction

  1. Blocks content type definition (main type):
blocks:
    name: Blocos
    singular_name: Bloco
    slug: blocks
    singular_slug: block
    fields:
        title:
            type: text
            class: large
            group: "Bloco"
            is_translateable: true
        slug:
            type: slug
            uses: title
        template:
            type: templateselect
            filter: 'view/blocks/*.twig'
            required: true
        # Translations
        locale:
            type: locale
        ptdata:
            type: hidden
        ptslug:
            type: locale_data
            index: true
        frdata:
            type: hidden
        frslug:
            type: locale_data
            index: true
    show_on_dashboard: true
    viewless: true
    default_status: publish
    searchable: false
    icon_many: "fa:cubes"
    icon_one: "fa:cube"
  1. Template fields definition (where the problem resides):
templatefields:
    view/blocks/hero.twig:
        title:
            type: html
            class: large
            is_translateable: true
  1. Set a new block with template on hero.twig
  2. On the specific template field of the hero, title, set X
  3. Change to language B and the title, to Y
  4. Change back to language A and notice that now title is Y instead of X
benwallis commented 7 years ago

Check if it works on the front-end.

It might be the bug where correct translation is not shown in the admin: https://github.com/AnimalDesign/bolt-translate/issues/110

lenvanessen commented 7 years ago

You need to tag the templateselect with is_translateable instead of the individual fields.

Like:

 template:
            type: templateselect
            filter: 'view/blocks/*.twig'
            required: true

Updated readme is coming in that clarify's this.

SvanteRichter commented 7 years ago

Fixed by a readme update in 10a40d0