收藏多语言

This commit is contained in:
Edward Yang 2022-08-22 20:24:03 +08:00
parent 6fd0fb353b
commit 529640cbf6
3 changed files with 32 additions and 2 deletions

View File

@ -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'));
}
}

View File

@ -0,0 +1,15 @@
<?php
/**
* wishlist.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @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',
];

View File

@ -0,0 +1,15 @@
<?php
/**
* wishlist.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author Edward Yang <yangjin@opencart.cn>
* @created 2022-08-22 20:20:37
* @modified 2022-08-22 20:20:37
*/
return [
'add_wishlist_success' => '加入收藏成功',
'remove_wishlist_success' => '移除收藏成功',
];