/**
   * {@inheritdoc}
   */
  public function getEntityTypeLabels() {
    $lowercase_label = $this->entityType->getSingularLabel();
    return [
      'singular' => $lowercase_label,
      'plural' => $this->t('@entity_type entities', ['@entity_type' => $lowercase_label]),
    ];
  }

The word entities is not needed here. If my entity has the name Document, then the ief form shows it as Document entities or in German Dokument Entitaeten. This is aweful. We do not need the word "entities" here. Please remove it

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

xvendo created an issue. See original summary.

globexplorer’s picture

globexplorer’s picture

joachim’s picture

Component: Code » User interface
Priority: Major » Normal
Status: Needs review » Needs work

Thanks for the patch.

Though I think this should be using EntityType::getPluralLabel() instead.

viren18febS made their first commit to this issue’s fork.

viren18febs’s picture

Status: Needs work » Needs review
StatusFileSize
new585 bytes

I have added getPluralLabel() in this patch please review.

joachim’s picture

Looks good.

Just a nitpick: can the call to getSingularLabel(() now be inlined into the array, or is that variable used elsewhere?

viren18febs’s picture

StatusFileSize
new716 bytes

I have added the getSingularLabel() direct in array , as this variable is not used anywhere in this function, please review.
thanks

joachim’s picture

Status: Needs review » Reviewed & tested by the community

Thanks!

RTBC :)

dww’s picture

Status: Reviewed & tested by the community » Needs work
+      'plural' => $this->t('@entity_type entities', ['@entity_type' => $this->entityType->getPluralLabel()]),

I thought the point was to remove 'entities' from this.

Don't we just want this?

+      'singular' => $this->entityType->getSingularLabel(),
+      'plural' => $this->entityType->getPluralLabel(),

??

dww’s picture

p.s. But at that point, why do we need this method at all? Oh, I see that's what #3413653: Deprecate InlineFormInterface::getEntityTypeLabels() is about. Maybe we should proceed there, instead?

dcam’s picture

Yes, I apologize for not updating this issue with that information.

dcam’s picture

For the record, my recommendation in #3413653: Deprecate InlineFormInterface::getEntityTypeLabels() is to close this one. Credit should be granted to everyone who contributed here in the other issue.

dcam’s picture

Oh hey, that's right - I have the power to grant credit now. Neat. Just let me know if the plan sounds good.

dww’s picture

For me, I think the scopes make more sense if we just fix this problem here as a stand-alone thing, then deprecate the method entirely in the other issue. There's no particular reason that we should change the text at the same time as deprecating.

So, for me, I'd probably just commit this pretty much as-is and credit the folks here, then we can do a "clean" deprecation in the other issue.

YMMV. /shrug 😂

dww’s picture

Version: 8.x-1.x-dev » 3.x-dev
Status: Needs work » Needs review
StatusFileSize
new663 bytes

E.g. just this. Interdiff is confused, but it's such a small patch, it should be obvious.

dww’s picture

Note: although this is technically a "string change" from the perspective of translators, it's actually a win for them/us: removing a t() always helps. 😅 So I'm in favor of backporting this to the 3.0.x branch as a fix before 3.0.0 stable, even though that's already in "RC" and therefore we should be well past the point of changing t().

dcam’s picture

Status: Needs review » Reviewed & tested by the community

That's fine by me. This looks good. It's a simple change to using a well-defined API.

dww’s picture

Title: Hardcoded word entities should be removed » Remove hardcoded word 'entities' in EntityInlineForm::getEntityTypeLabels()

Saving credits and updating title.

  • dww committed c753ec18 on 3.x
    task: #3149783: Remove hardcoded word 'entities' in EntityInlineForm::...
dww’s picture

Status: Reviewed & tested by the community » Fixed

There is no 3.0.x branch yet to backport this to, so this is now done. Thanks, everyone!

Status: Fixed » Closed (fixed)

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