From 529640cbf6457f95281d585ba6c2b58d1443f8b7 Mon Sep 17 00:00:00 2001 From: Edward Yang Date: Mon, 22 Aug 2022 20:24:03 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=97=8F=E5=A4=9A=E8=AF=AD=E8=A8=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Account/WishlistController.php | 4 ++-- resources/lang/en/shop/wishlist.php | 15 +++++++++++++++ resources/lang/zh_cn/shop/wishlist.php | 15 +++++++++++++++ 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 resources/lang/en/shop/wishlist.php create mode 100644 resources/lang/zh_cn/shop/wishlist.php diff --git a/beike/Shop/Http/Controllers/Account/WishlistController.php b/beike/Shop/Http/Controllers/Account/WishlistController.php index c15d411f..cccfcfb7 100644 --- a/beike/Shop/Http/Controllers/Account/WishlistController.php +++ b/beike/Shop/Http/Controllers/Account/WishlistController.php @@ -33,7 +33,7 @@ class WishlistController extends Controller $productId = $request->get('product_id'); $wishlist = CustomerRepo::addToWishlist(current_customer(), $productId); - return json_success('加入收藏成功', $wishlist); + return json_success(trans('shop/wishlist.add_wishlist_success'), $wishlist); } public function remove(Request $request): array @@ -41,7 +41,7 @@ class WishlistController extends Controller $id = $request->id; CustomerRepo::removeFromWishlist(current_customer(), $id); - return json_success('移除收藏成功'); + return json_success(trans('shop/wishlist.remove_wishlist_success')); } } diff --git a/resources/lang/en/shop/wishlist.php b/resources/lang/en/shop/wishlist.php new file mode 100644 index 00000000..96974608 --- /dev/null +++ b/resources/lang/en/shop/wishlist.php @@ -0,0 +1,15 @@ + + * @created 2022-08-22 20:20:37 + * @modified 2022-08-22 20:20:37 + */ + +return [ + 'add_wishlist_success' => 'Add to wishlist successfully', + 'remove_wishlist_success' => 'Remove to wishlist successfully', +]; diff --git a/resources/lang/zh_cn/shop/wishlist.php b/resources/lang/zh_cn/shop/wishlist.php new file mode 100644 index 00000000..70fb77e3 --- /dev/null +++ b/resources/lang/zh_cn/shop/wishlist.php @@ -0,0 +1,15 @@ + + * @created 2022-08-22 20:20:37 + * @modified 2022-08-22 20:20:37 + */ + +return [ + 'add_wishlist_success' => '加入收藏成功', + 'remove_wishlist_success' => '移除收藏成功', +];