Uploaded image for project: 'Magnolia UI'
  1. Magnolia UI
  2. MGNLUI-3879

i18n suffixes wrong for default locale on upload fields

    XMLWordPrintable

Details

    • Bug
    • Resolution: Obsolete
    • Neutral
    • None
    • 5.3.12
    • forms, framework
    • None

    Description

      Expectation

      When i18n is enabled on a form field, we expect it to be saved with suffixes for corresponding languages, e.g. title_fr for French, and without a suffix for the default language, e.g. title for German if that's the default. This works as expected for most fields.

      Problem

      When using special fields like the DAM upload field, the default language version is also stored with a suffix (e.g. myImage_de instead of myImage).

      Cause

      The reason is that DefaultI18NAuthoringSupport only handles default languages on transformers extending BasicTransformer (see line 118 of DefaultI18NAuthoringSupport in Magnolia 5.3.12), but AssetTransformer doesn't do this.

      Workaround

      As an ad-hoc workaround, we're using a custom I18nFixedAssetTransformer<T extends AssetUploadReceiver> extends BasicTransformer<T>. This one mostly adapts the behaviour of BasicTransformer, but wraps an instance of AssetTranformer and redirects the methods writeToItem(T newValue) and readFromItem() to it.

      This has only been tested on 5.3.12. I'm not sure what the situation on 5.4.* is, as i18n authoring seems to have changed quite a bit.

      Checklists

        Acceptance criteria

        Attachments

          Issue Links

            Activity

              People

                Unassigned Unassigned
                creichenbach Cedric Reichenbach
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  Checklists

                    Bug DoR
                    Task DoD