From 87f0fd3ed9a411d848fc0b0486123aadfa41738b Mon Sep 17 00:00:00 2001 From: Thomas Alrek Date: Tue, 16 Jan 2024 15:09:29 +0100 Subject: [PATCH] Attempt model label as fallback before using original parent method --- src/Concerns/HasLocalizableResourceLabels.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Concerns/HasLocalizableResourceLabels.php b/src/Concerns/HasLocalizableResourceLabels.php index 71bc560..7d11e64 100644 --- a/src/Concerns/HasLocalizableResourceLabels.php +++ b/src/Concerns/HasLocalizableResourceLabels.php @@ -59,7 +59,11 @@ public static function getNavigationLabel(): string { return static::translatedLabel( label: static::NAVIGATION_LABEL, - fallback: parent::getNavigationLabel(), + fallback: static::translatedLabel( + label: static::MODEL_LABEL, + fallback: parent::getSlug(), + plural: true + ) ); } @@ -67,7 +71,11 @@ public static function getSlug(): string { return static::translatedLabel( label: static::SLUG, - fallback: parent::getSlug(), + fallback: static::translatedLabel( + label: static::MODEL_LABEL, + fallback: parent::getSlug(), + plural: true + ) ); } }