Portlet labels and description are being translated on different translation levels

Created on 9 April 2024, 3 months ago
Updated 22 April 2024, 2 months ago

Problem/Motivation

There are 4 types of homebox portlet labels / descriptions:

Mainly, the label from the doctrine annotation is used, but these strings can only be translated on the content translation page ("/admin/config/regional/translate"), which is quite misleading, as one would think they can be translated on the homebox_type translation page. But there we only see a bunch of "(Empty) Mapping > (Empty)" entries which can be translated. UNTIL we overwrite a label / description through the "homeboxTypePortletSettings" tab on the homebox type page. Then the translation page will show the newly set overwritten labels / descriptions to be translated.

Steps to reproduce

Proposed resolution

This is all quite missleading. The best approach would be to have a central page to translate all portlets globally and the homebox type translation page, where we could translate the custom overriden labels / descriptions of each portlet. But this page should only show, if any overridden values are set, otherwise the page should be empty and only show a link to the global portlet translation page (to avoid the "(Empty) Mapping > (Empty)" bug).

This might be a complicated task, and maybe we this is only partially solvable.

Remaining tasks

User interface changes

API changes

Data model changes

πŸ› Bug report
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

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

Comments & Activities

  • Issue created by @Anybody
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica
  • First commit to issue fork.
  • Issue was unassigned.
  • πŸ‡©πŸ‡ͺGermany Grevil

    First and foremost, it doesn't seem, that we need to define schemes for homebox portlet types. E.g. "block_content" and other core modules do not define a schema when they define a new block.

    I think the (Empty) mapping bug comes from the way we save the homebox portlet types in our homebox type.
    Currently, any HomeboxType has an array called "$homeboxTypePortletTypesSettings", which saves the homebox portlet type as key and the values are "label", "description" and a bunch of boolean values (e.g. "status"):

    This perfectly translates to the translation UI. We are not actually translating the portlet types, but the homeboxTypePortletTypesSettings array instead (since the homeboxType doesn't know about the portlet plugins). That's why we also only get to translate "label" and "description", since these are the only translatable values inside the array:

    And both label and description are not set, until they are overwritten, that's why it says "empty" for the original label and description values.

  • πŸ‡©πŸ‡ͺGermany Grevil
  • Status changed to Closed: works as designed 2 months ago
  • πŸ‡©πŸ‡ͺGermany Anybody Porta Westfalica

    If the fields for label and description of the portlet types are empty, it's correct to show them empty in the config translation (no bug)
    Typically it would be great if the details in the form would show the programmatic label, but that would require custom coding and I guess it's not worth it.

    So this isn't a bug and the feature requests solution would simply be too expensive. So let's keep it like this. Not nice but working correctly!

Production build 0.69.0 2024