Commit 3299b342 by 宁成龙

完善翻译

parent 6b80ce3e
...@@ -21,16 +21,16 @@ class UserAddressCreateAction extends AbstractTool ...@@ -21,16 +21,16 @@ class UserAddressCreateAction extends AbstractTool
protected $action; protected $action;
protected $htmlClasses = ['btn btn-sm btn-primary']; protected $htmlClasses = ['btn btn-sm btn-primary'];
// 注意action的构造方法参数一定要给默认值 // 注意action的构造方法参数一定要给默认值
public function __construct($title = null, $action = 1) public function __construct()
{ {
$this->title = $title; $this->title = trans("user-address.labels.create_user_address");
$this->action = $action; $this->action = 1;
} }
public function render() public function render()
{ {
$form = SaveUserAddressHandle::make(['user_id'=>$this->getKey()]); $form = SaveUserAddressHandle::make(['user_id'=>$this->getKey()]);
$buttonName = trans('user.labels.handle'); $buttonName = trans("user-address.labels.create_user_address");
return Modal::make()->lg()->title($this->title)->body($form->payload(['user_id'=>$this->getKey()]))->onLoad return Modal::make()->lg()->title($this->title)->body($form->payload(['user_id'=>$this->getKey()]))->onLoad
($this->getModalScript())->button('<button style="margin-right: 5px" class="btn btn-sm btn-primary"> ($this->getModalScript())->button('<button style="margin-right: 5px" class="btn btn-sm btn-primary">
<i class="feather icon-check-circle"></i><span class="d-none d-sm-inline" style="margin-left: 5px">' . <i class="feather icon-check-circle"></i><span class="d-none d-sm-inline" style="margin-left: 5px">' .
......
...@@ -30,7 +30,7 @@ class UserAddressDeleteAction extends RowAction ...@@ -30,7 +30,7 @@ class UserAddressDeleteAction extends RowAction
*/ */
public function title() public function title()
{ {
$buttonName = "删除"; $buttonName = trans("user-address.labels.delete_user_address");
return $buttonName; return $buttonName;
} }
...@@ -54,8 +54,7 @@ class UserAddressDeleteAction extends RowAction ...@@ -54,8 +54,7 @@ class UserAddressDeleteAction extends RowAction
*/ */
public function confirm() public function confirm()
{ {
$buttonName = "删除"; return admin_trans("confirm");
return ["是否确认 {$buttonName} ?"];
} }
/** /**
...@@ -73,7 +72,7 @@ class UserAddressDeleteAction extends RowAction ...@@ -73,7 +72,7 @@ class UserAddressDeleteAction extends RowAction
} catch (\Throwable $e) { } catch (\Throwable $e) {
return $this->response()->error($e->getMessage()); return $this->response()->error($e->getMessage());
} }
return $this->response()->success('操作成功')->refresh(); return $this->response()->success(admin_trans("succeeded"))->refresh();
} }
/** /**
......
...@@ -21,16 +21,16 @@ class UserAddressEditAction extends RowAction ...@@ -21,16 +21,16 @@ class UserAddressEditAction extends RowAction
protected $htmlClasses = ['btn btn-sm btn-primary']; protected $htmlClasses = ['btn btn-sm btn-primary'];
// 注意action的构造方法参数一定要给默认值 // 注意action的构造方法参数一定要给默认值
public function __construct($title = null, $action = 1) public function __construct()
{ {
$this->title = $title; $this->title = trans("user-address.labels.edit_user_address");
$this->action = $action; $this->action = 1;
} }
public function render() public function render()
{ {
$form = SaveUserAddressHandle::make(['address_id' => $this->getRow()['address_id']]); $form = SaveUserAddressHandle::make(['address_id' => $this->getRow()['address_id']]);
$buttonName = trans('user.labels.handle'); $buttonName = trans("user-address.labels.edit_user_address");
return Modal::make()->lg()->title($this->title)->body($form->payload(['address_id' => $this->getRow()['address_id']])) return Modal::make()->lg()->title($this->title)->body($form->payload(['address_id' => $this->getRow()['address_id']]))
->onLoad ->onLoad
($this->getModalScript())->button('<button style="margin-right: 5px" class="btn btn-sm btn-primary"> ($this->getModalScript())->button('<button style="margin-right: 5px" class="btn btn-sm btn-primary">
......
...@@ -33,7 +33,7 @@ class UserAddress extends \Dcat\Admin\Support\LazyRenderable ...@@ -33,7 +33,7 @@ class UserAddress extends \Dcat\Admin\Support\LazyRenderable
$grid->disableEditButton(); $grid->disableEditButton();
UserAddressService::listField($grid); UserAddressService::listField($grid);
$userAddressCreateAction = new UserAddressCreateAction("新增用户地址"); $userAddressCreateAction = new UserAddressCreateAction();
$userAddressCreateAction->setKey($this->key); $userAddressCreateAction->setKey($this->key);
$grid->tools([ $grid->tools([
$userAddressCreateAction, $userAddressCreateAction,
......
...@@ -4,6 +4,9 @@ return [ ...@@ -4,6 +4,9 @@ return [
'labels' => [ 'labels' => [
'UserAddress' => 'UserAddress', 'UserAddress' => 'UserAddress',
'user-address' => 'UserAddress', 'user-address' => 'UserAddress',
'create_user_address' => 'Create user address',
'edit_user_address' => 'Edit',
'delete_user_address' => 'Delete',
], ],
'fields' => [ 'fields' => [
"address_id" => "用户用户地址ID", "address_id" => "用户用户地址ID",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment