后台后端语言包

This commit is contained in:
TL 2022-08-30 11:20:14 +08:00
parent 9212617242
commit c5f6c22f33
18 changed files with 67 additions and 20 deletions

View File

@ -73,7 +73,7 @@ class AdminRoleRepo
}
}
if (empty($items)) {
throw new \Exception('权限不能为空,请选择至少一项');
throw new \Exception(trans('admin/role.select_one_at_least'));
}
$adminRole->syncPermissions($items);
}

View File

@ -39,9 +39,6 @@ class CustomerGroupService
{
$data = self::getParams($data);
$customerGroup = CustomerGroupRepo::find($id);
if (!$customerGroup) {
throw New \Exception("您更新的ID不存在");
}
$customerGroup->update($data);

View File

@ -96,7 +96,7 @@ class FileManagerService
$catalogFolderPath = "catalog/{$folderName}";
$folderPath = public_path($catalogFolderPath);
if (is_dir($folderPath)) {
throw new \Exception("目录已存在");
throw new \Exception(trans('admin/file_manager.directory_already_exist'));
}
create_directories($catalogFolderPath);
}
@ -114,7 +114,7 @@ class FileManagerService
if (is_dir($filePath)) {
$files = glob($filePath . '/*');
if ($files) {
throw new \Exception("该目录不为空");
throw new \Exception(trans('admin/file_manager.directory_not_empty'));
}
@rmdir($filePath);
} elseif (file_exists($filePath)) {
@ -154,7 +154,7 @@ class FileManagerService
{
$originPath = public_path("catalog/{$originPath}");
if (!is_dir($originPath) && !file_exists($originPath)) {
throw new \Exception('原始文件或者文件夹无效');
throw new \Exception(trans('admin/file_manager.target_not_exist'));
}
$originBase = dirname($originPath);
$newPath = $originBase . '/' . $newPath;

View File

@ -51,16 +51,16 @@ class UserService
$verifyCode = VerifyCodeRepo::findByAccount($account);
if ($verifyCode->created_at->addMinutes(10) < Carbon::now()) {
$verifyCode->delete();
throw new \Exception("您的验证码已过期10分钟请重新获取");
throw new \Exception(trans('admin/user.verify_code_expired'));
}
if ($verifyCode->code != $code) {
throw new \Exception("您的验证码错误");
throw new \Exception(trans('admin/user.verify_code_error'));
}
$user = UserRepo::findByEmail($account);
if (!$user) {
throw new \Exception("账号不存在");
throw new \Exception(trans('admin/user.account_not_exist'));
}
UserRepo::update($user, ['password' => $password]);

View File

@ -35,7 +35,7 @@ class Brand extends Component
$data['register'] = [
'code' => 'brand',
'sort' => 0,
'name' => '品牌模块',
'name' => trans('admin/design_builder.module_brand'),
'icon' => '&#xe602;',
];

View File

@ -35,7 +35,7 @@ class Image100 extends Component
$data['register'] = [
'code' => 'image100',
'sort' => 0,
'name' => '单图模块',
'name' => trans('admin/design_builder.module_banner'),
'icon' => '&#xe663;',
];

View File

@ -35,7 +35,7 @@ class Image401 extends Component
$data['register'] = [
'code' => 'image401',
'sort' => 0,
'name' => '一行四图-pro',
'name' => trans('admin/design_builder.module_four_image_pro'),
'icon' => '&#xe663;',
];

View File

@ -35,7 +35,7 @@ class SlideShow extends Component
$data['register'] = [
'code' => 'slideshow',
'sort' => 0,
'name' => '幻灯片模块',
'name' => trans('admin/design_builder.module_slideshow'),
'icon' => '&#xe61b;',
'style' => 'font-size: 40px;',
];

View File

@ -35,7 +35,7 @@ class TabProduct extends Component
$data['register'] = [
'code' => 'tab_product',
'sort' => 0,
'name' => '选项卡商品',
'name' => trans('admin/design_builder.module_tab_products'),
'icon' => '&#xe688;',
];

View File

@ -46,7 +46,7 @@ class CustomerGroupRepo
*/
public static function find($id)
{
return CustomerGroup::query()->find($id);
return CustomerGroup::query()->findOrFail($id);
}
/**

View File

@ -0,0 +1,18 @@
<?php
/**
* design_builder.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author TL <mengwb@opencart.cn>
* @created 2022-08-30 11:03:19
* @modified 2022-08-30 11:03:19
*/
return [
'module_brand' => 'Brand Module',
'module_banner' => 'Banner Module',
'module_four_image_pro' => 'For Image PRO Module',
'module_slideshow' => 'Slideshow Module',
'module_tab_products' => 'Tab Products Module',
];

View File

@ -13,5 +13,8 @@ return [
'file_manager_create' => 'Create',
'file_manager_show' => 'View',
'file_manager_update' => 'Rename',
'file_manager_delete' => 'Delete'
'file_manager_delete' => 'Delete',
'directory_already_exist' => 'The directory not exist!',
'directory_not_empty' => 'The directory not empty!',
'target_not_exist' => 'The target file/directory not exist!',
];

View File

@ -14,5 +14,6 @@ return [
'admin_roles_create' => 'Create',
'admin_roles_show' => 'Detail',
'admin_roles_update' => 'Edit',
'admin_roles_delete' => 'Delete'
'admin_roles_delete' => 'Delete',
'select_one_at_least' => 'Please select one permission at least!'
];

View File

@ -14,5 +14,8 @@ return [
'admin_users_create' => 'Create',
'admin_users_show' => 'Detail',
'admin_users_update' => 'Edit',
'admin_users_delete' => 'Delete'
'admin_users_delete' => 'Delete',
'verify_code_expired' => 'The verify code expired (10 minute), please retry.',
'verify_code_error' => 'Verify code error!',
'account_not_exist' => 'Account not exist!',
];

View File

@ -0,0 +1,18 @@
<?php
/**
* design_builder.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author TL <mengwb@opencart.cn>
* @created 2022-08-30 11:03:19
* @modified 2022-08-30 11:03:19
*/
return [
'module_brand' => '品牌模块',
'module_banner' => '横幅模块',
'module_four_image_pro' => '一行四图 PRO',
'module_slideshow' => '幻灯片模块',
'module_tab_products' => '选项卡商品',
];

View File

@ -13,5 +13,8 @@ return [
'file_manager_create' => '创建目录/文件',
'file_manager_show' => '查看目录/文件',
'file_manager_update' => '重命名',
'file_manager_delete' => '删除目录/文件'
'file_manager_delete' => '删除目录/文件',
'directory_already_exist' => '目录已存在',
'directory_not_empty' => '该目录不为空',
'target_not_exist' => '原始文件或者文件夹不存在',
];

View File

@ -15,4 +15,5 @@ return [
'admin_roles_show' => '角色详情',
'admin_roles_update' => '更新角色',
'admin_roles_delete' => '删除角色',
'select_one_at_least' => '权限不能为空,请选择至少一项'
];

View File

@ -15,4 +15,7 @@ return [
'admin_users_show' => '用户详情',
'admin_users_update' => '更新用户',
'admin_users_delete' => '删除用户',
'verify_code_expired' => '您的验证码已过期10分钟请重新获取',
'verify_code_error' => '您的验证码错误',
'account_not_exist' => '账号不存在',
];