Uploaded image for project: 'Language Bundles'
  1. Language Bundles
  2. LANG-72

FR: field.upload.select.another.media is too long -> one can not delete the binary

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Neutral Neutral
    • None
    • 1.0.10
    • French

      This translation in the french language bundle is too long:

      field.upload.select.another.media = Sélectionnez un nouveau/une nouvelle {0}...
      

      When using it in a info.magnolia.dam.app.ui.field.definition.DamUploadFieldDefinition it results that the label of the field overlaps/pushes to the right the delete button:
      -> one can not delete the binary anymore. (see print screen 'DamUploadField.png').

      Work around:
      Nr 1: Fastest and least nice:
      Use the Dialog's full screen option, see print screen 'DialogFullScreen.png'.

      Nr 2: Set a fix 'label:
      If you don't need it translated, one can set a fix 'labeling' of this button.
      Add this to the field configuration:

      selectAnotherCaption: A fix button 'label'
      

      Nr 3: Override the the value of the original translation key:
      The original key is set in the constructor of the info.magnolia.dam.app.ui.field.definition.DamUploadFieldDefinition field definition:

      setSelectAnotherCaption("field.upload.select.another");
      

      When a media is already uploaded it gets the following key automatically (a '.media') is added:

      field.upload.select.another.media
      

      Add to your module a i18n folder and add into a french message file the key field.upload.select.another.media with a new translated value.
      https://documentation.magnolia-cms.com/display/DOCS/i18n+API#i18nAPI-AutomaticloadingofmessagebundlesfromtheMagnoliai18nfolder
      Ensure that your module is loaded after the language modules by setting a dependency on them -> manages the loading order by the dependencies.
      Example how it looks in the fr message bundle you'd create:

      a.key.to.translate.media = My overriding translation (in French of course)
      

      Nr4: Define your own translatable key and value:
      Instead of setting a fix String as a button label you can also define a key to be translated. Add this to the field configuration:

      selectAnotherCaption: a.key.to.translate
      

      As in Nr 3 you define your own i18n folder with a message bundle and add a translation by the key you defined:

      a.key.to.translate.media = My new translation (in French of course)
      

      Remember the .media which is automatically added to the key's end when a media is already uploaded.

        Acceptance criteria

              Unassigned Unassigned
              cringele Christian Ringele
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved:

                  Bug DoR
                  Task DoD