From 607751abc6c829968ddbca82bbfbf49f6719ee78 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Wed, 31 May 2023 18:06:43 +0800 Subject: [PATCH] Support description multi languages. --- beike/Plugin/Plugin.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/beike/Plugin/Plugin.php b/beike/Plugin/Plugin.php index 0a70f12a..6697b196 100644 --- a/beike/Plugin/Plugin.php +++ b/beike/Plugin/Plugin.php @@ -171,6 +171,13 @@ class Plugin implements Arrayable, \ArrayAccess $item['label'] = trans($languageKey); } + $descriptionKey = $item['description_key'] ?? ''; + $description = $item['description'] ?? ''; + if (empty($description) && $descriptionKey) { + $languageKey = "{$this->dirName}::{$descriptionKey}"; + $item['description'] = trans($languageKey); + } + return $item; }