Commit 3299b342 by 宁成龙

完善翻译

parent 6b80ce3e
......@@ -21,16 +21,16 @@ class UserAddressCreateAction extends AbstractTool
protected $action;
protected $htmlClasses = ['btn btn-sm btn-primary'];
// 注意action的构造方法参数一定要给默认值
public function __construct($title = null, $action = 1)
public function __construct()
{
$this->title = $title;
$this->action = $action;
$this->title = trans("user-address.labels.create_user_address");
$this->action = 1;
}
public function render()
{
$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
($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">' .
......
......@@ -30,7 +30,7 @@ class UserAddressDeleteAction extends RowAction
*/
public function title()
{
$buttonName = "删除";
$buttonName = trans("user-address.labels.delete_user_address");
return $buttonName;
}
......@@ -54,8 +54,7 @@ class UserAddressDeleteAction extends RowAction
*/
public function confirm()
{
$buttonName = "删除";
return ["是否确认 {$buttonName} ?"];
return admin_trans("confirm");
}
/**
......@@ -73,7 +72,7 @@ class UserAddressDeleteAction extends RowAction
} catch (\Throwable $e) {
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
protected $htmlClasses = ['btn btn-sm btn-primary'];
// 注意action的构造方法参数一定要给默认值
public function __construct($title = null, $action = 1)
public function __construct()
{
$this->title = $title;
$this->action = $action;
$this->title = trans("user-address.labels.edit_user_address");
$this->action = 1;
}
public function render()
{
$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']]))
->onLoad
($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
$grid->disableEditButton();
UserAddressService::listField($grid);
$userAddressCreateAction = new UserAddressCreateAction("新增用户地址");
$userAddressCreateAction = new UserAddressCreateAction();
$userAddressCreateAction->setKey($this->key);
$grid->tools([
$userAddressCreateAction,
......
......@@ -4,6 +4,9 @@ return [
'labels' => [
'UserAddress' => 'UserAddress',
'user-address' => 'UserAddress',
'create_user_address' => 'Create user address',
'edit_user_address' => 'Edit',
'delete_user_address' => 'Delete',
],
'fields' => [
"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