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' => '移除收藏成功', +];