Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Xiaohua Guan created an issue. See original summary.

Xiaohua Guan’s picture

Xiaohua Guan’s picture

@yas

Please review the patch file. Thanks.

Xiaohua Guan’s picture

Status: Active » Needs review
yas’s picture

FileSize
735.75 KB

@xiaohua-guan

Thank you for providing the patch. I tested it and looks good to me but I was concerned about the following code.

+++ b/modules/cloud_service_providers/k8s/src/Plugin/Derivative/K8sMenuLinks.php
@@ -253,14 +253,7 @@ class K8sMenuLinks extends DeriverBase implements ContainerDeriverInterface {
         continue;
       }
 
-      $label = (string) $entity_definition->getLabel();
-      $title = preg_replace('/Kubernetes (.*)/', '${1}', $label);
-      $title = (preg_match('/y$/', $title))
-        ? preg_replace('/y$/', 'ies', $title)
-        : ((preg_match('/s$|x$|ch$|sh$/', $title))
-          ? $title . 'es'
-          : $title . 's');
-
+      $title = (string) $entity_definition->getCollectionLabel();

I think we should leave the following logic:

-      $title = preg_replace('/Kubernetes (.*)/', '${1}', $label);

screenshot-20191222.png

Xiaohua Guan’s picture

Xiaohua Guan’s picture

@yas

Thanks for your comment. I create a new patch file. Please take a look again. Thanks.

yas’s picture

Status: Needs review » Reviewed & tested by the community
FileSize
942.79 KB

@xiaohua-guan

Thank you for the update. I tested it and looks good to me now. I'll merge the patch to 8.x-2.x and close this issue as Fixed.

screenshot-2019-12-23a.png

  • yas committed 1895d1f on 8.x-2.x authored by Xiaohua Guan
    Issue #3102694 by Xiaohua Guan, yas: Add an Entity Type plural label in...
yas’s picture

Status: Reviewed & tested by the community » Fixed
yas’s picture

Status: Fixed » Closed (fixed)

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