There are various instance in which while entity labels are either not translateable or not configurable. Tracking them here:

* admin/structure/short-news-type -> Wrong bundle label
* admin/structure/short-news-type -> Unconfigured table header description
* Local actions -> Untranslatable
* admin/structure/short-news-type -> Wrong page title / translation (double translation?)

Comments

archnode created an issue. See original summary.

archnode’s picture

StatusFileSize
new1.18 KB

Fixed most of the labels, translation needs further tests.

  • fago committed 9593a49 on 8.x-1.x
    Issue #2858265 by archnode: Fix entity label of WhileEntityType.
    
fago’s picture

thx, the patch looks good - I've committed and pushed this one already. Leaving the issue open for the rest.

archnode’s picture

StatusFileSize
new158 bytes

And another one with missing local actions translations.

archnode’s picture

StatusFileSize
new1.3 KB

Woops, the last patch was a bit insubstantial. Correct one added here.

fago’s picture

Status: Active » Needs work

hm, I think we are doing this wrong. The entity-name should be in config, thus it should be translated via the config system. Once that's done, there should not be a need for the t() call.

archnode’s picture

Status: Needs work » Needs review
StatusFileSize
new16.39 KB

Ok, I created following patch that removes all calls to "t" in this context and adds configuration translation as well as a configuration page. This patch also incorporates #2859637: Make content listing page more useful as the patch there also added some calls.

What I'm not sure about is the call to config translation in the alter hooks: This only gets called on cache clear, we would need to define a label callback, but I'm not sure on how to do this in this context. Any ideas?

fago’s picture

Status: Needs review » Needs work

>What I'm not sure about is the call to config translation in the alter hooks

I think this is fine. After while setting context changes, the entity type caches need to be cleared. Until there is no UI for that it's fine if one has to run a manual cache rebuild afterwards imo.

  1. +++ b/src/Form/WhileMainConfigForm.php
    @@ -0,0 +1,100 @@
    + * Class WhileMainConfigForm.
    + *
    + * @package Drupal\ali_content_lifecycle\Form
    

    Comments need work.

  2. +++ b/src/WhileEntityAccessControlHandler.php
    @@ -22,11 +22,9 @@ class WhileEntityAccessControlHandler extends EntityAccessControlHandler {
    -          return AccessResult::allowedIfHasPermission($account, 'view unpublished while entities')
    -            ->addCacheableDependency($entity);
    +          return AccessResult::allowedIfHasPermission($account, 'view unpublished while entities');
    

    Nope, that cache dependency has to stay.

  3. +++ b/src/WhileEntityListBuilder.php
    @@ -64,7 +100,8 @@ class WhileEntityListBuilder extends EntityListBuilder {
    +    ¶
    

    whitespace

  4. +++ b/white_label_entity.config_translation.yml
    @@ -0,0 +1,5 @@
    +white_label_entity.main_config_form:
    

    Would make sense to stay with consistent naming: Settings -> SettingsForm

  5. +++ b/white_label_entity.routing.yml
    @@ -0,0 +1,9 @@
    +white_label_entity.main_config_form:
    

    as above, settings?

fago’s picture

Status: Needs work » Fixed

wrong issue

fago’s picture

wrong issue

fago’s picture

Status: Fixed » Needs work
fago’s picture

Status: Needs work » Needs review
StatusFileSize
new10.37 KB

ok, I addressed the remaining issues and fixed the titles in the breadcrumbs of the collection routes.

fago’s picture

Title: Fix various instances of while entity labels » Fix various instances of while entity labels and add while settings form

  • fago committed 562f3d3 on 8.x-1.x
    Issue #2858265 by fago, archnode: Fix various instances of while entity...
  • fago committed f08731b on 8.x-1.x
    Issue #2858265 by archnode, fago: Fix various instances of while entity...
fago’s picture

Status: Needs review » Fixed

And committed.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.