Uploaded image for project: 'Content Translation Support'
  1. Content Translation Support
  2. MGNLCTS-79

Yaml based Content Apps: Also enable yaml based apps to use content translation.

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Not an issue
    • Neutral
    • None
    • 2.1.2

    Description

      Currently the content translation is not usable for yaml based content apps.

      There are a couple of struggles/needed changed involved.
      I tested all on a training app called "cars" with workspace "cars"/

      I think the imrovement should be done in two steps:
      1. Updating the module to be able export and import on yaml based app configs.
      So until 2. is done, the configs would have to be added manually, but at least it would work with a yaml app.
      2. When MTE 1.0 is ready, adding an automatism for light modules comparable to the AddTranslationActionForDetailSubappTask.
      .

      Java adaptions needed in content translation

      The class DetailPresenterNodeDataToTranslateFinder.java uses the JCR config workspace, instead of operating pure on the App config bean. Then it would also work for a yaml based app.
      .

      1. The configurations needed:

      The "AddTranslationActionForDetailSubappTask" creates a couple of configurations in JCR. Of course it can't be used for a yaml based file.
      These would have to be supplied for the yaml world, if not automated, then at least to be able to add them manually.

      The two commands needed:

      The biggest problem is, that currently light modules don't provide a commands registry (until MTE 1.0)
      So the two needed command would have to be registered in some installed module, or some other project Maven module. But it would work as they are referenced by catalog and command name, so they can be registered anywhere.
      Here the two form my test:
      config.modules.training-content-apps.commands.content-translation-support.carsDownloadTranslation
      config.modules.training-content-apps.commands.content-translation-support.carsUploadTranslation

      The two dialogs needed:

      These could be provided as yaml:
      downloadTranslationFile:

      actions:
        commit:
          command: roomsDownloadTranslation
          label: content-translation-support.downloadTranslationFile.actions.commit.label
          catalog: content-translation-support
          class: info.magnolia.module.contenttranslationsupport.dialog.action.TranslationFileDownloadDialogActionDefinition
        cancel:
          class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition
      form:
        description: content-translation-support.downloadTranslationFile.description
        label: content-translation-support.downloadTranslationFile.label
        tabs:
          - name: download
            label:
            fields:
              - name: fileFormat
                importOrExport: export
                type: String
                required: true
                sortOptions: false
                label: content-translation-support.downloadTranslationFile.download.fileFormat.label
                class: info.magnolia.module.contenttranslationsupport.form.field.definition.TranslationFileFormatOptionGroupFieldDefinition
      

      uploadTranslationFile:

      actions:
        commit:
          command: roomsUploadTranslation
          label: content-translation-support.uploadTranslationFile.actions.commit.label
          catalog: content-translation-support
          class: info.magnolia.module.contenttranslationsupport.dialog.action.TranslationFileUploadDialogActionDefinition
        cancel:
          class: info.magnolia.ui.admincentral.dialog.action.CancelDialogActionDefinition
      form:
        description: content-translation-support.uploadTranslationFile.description
        label: content-translation-support.uploadTranslationFile.label
        tabs:
          - name: upload
            label:
            fields:
              - name: name
                required: true
                label: content-translation-support.uploadTranslationFile.upload.name.label
                binaryNodeName: import
                preview: false
                class: info.magnolia.ui.form.field.definition.BasicUploadFieldDefinition
              - name: fileFormat
                importOrExport: import
                type: String
                required: true
                sortOptions: false
                label: content-translation-support.uploadTranslationFile.upload.fileFormat.label
                class: info.magnolia.module.contenttranslationsupport.form.field.definition.TranslationFileFormatOptionGroupFieldDefinition
              - name: importOptions
                multiselect: true
                sortOptions: false
                label: content-translation-support.uploadTranslationFile.upload.importOptions.label
                class: info.magnolia.ui.form.field.definition.OptionGroupFieldDefinition
                options:
                  - name: overwriteExistingValues
                    label: content-translation-support.uploadTranslationFile.upload.importOptions.options.overwriteExistingValues
                    value: overwriteExistingValues
                  - name: importEmptyValues
                    label: content-translation-support.uploadTranslationFile.upload.importOptions.options.importEmptyValues
                    value: importEmptyValues
      
      The two Actions needed:

      These could be provided as yaml:

      downloadTranslationFile:
        label: contentTranslationSupport.browser.actions.downloadTranslationFile.label
        icon: icon-export
        dialogName: training-content-apps:downloadTranslationFile
        class: info.magnolia.ui.framework.action.OpenCreateDialogActionDefinition
        availability:
          rules:
            - name: IsNotDeletedRule
              implementationClass: info.magnolia.ui.framework.availability.IsNotDeletedRule
      uploadTranslationFile:
        label: contentTranslationSupport.browser.actions.uploadTranslationFile.label
        icon: icon-import
        dialogName: training-content-apps:uploadTranslationFile
        class: info.magnolia.ui.framework.action.OpenCreateDialogActionDefinition
        availability:
          rules:
            - name: IsNotDeletedRule
              implementationClass: info.magnolia.ui.framework.availability.IsNotDeletedRule
      

      Checklists

        Acceptance criteria

        Attachments

          Activity

            People

              Unassigned Unassigned
              cringele Christian Ringele
              Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Checklists

                  Task DoD