How to translate the field label?

Created on 12 September 2017, about 7 years ago
Updated 3 June 2024, 6 months ago

Is it possible to translate the field label - in my case 'View PDF' - on a multi-lingual site?

💬 Support request
Status

Needs work

Version

2.0

Component

User interface

Created by

🇬🇧United Kingdom jbd44

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

  • 🇨🇦Canada joseph.olstad

    until a better solution is found, using #21 and it works.

  • Indeed changing data type for the field labels from "string" to "label" makes sense, as they should be translatable. It might be something like this:

    core.entity_view_display.*.*.*.third_party.entity_print:
      type: sequence
      label: 'Schema for Entity Print third party settings'
      sequence:
        type: label
        label: 'Extra field labels for each export type'
    

    But seems it still will not be possible to edit translation using UI until Entity view/form mode formatter/widget settings have no translation UI 🐛 Entity view/form mode formatter/widget settings have no translation UI Needs review resolved.

    For now it possible to use one of 2 solutions:

    1. use patch from #21 and translate with user interface translation
    2. create translation YAML config files for needed content type display modes manually and import them, for example core.entity_view_display.node.article.default.yml . As I can see, it works even without changes in config schema.

    Example of the translation file

    third_party_settings:
      entity_print:
        pdf_label: 'Ver PDF'
        epub_label: 'Ver EPub'
        word_docx_label: 'Ver Word Document'
    
  • 🇬🇧United Kingdom matt b

    patch from #21 works for me - will do until this is solved

Production build 0.71.5 2024