Skip to content

Commit

Permalink
language: update Chinese language
Browse files Browse the repository at this point in the history
- display the correct html language, friendly to translators
  • Loading branch information
betaxab committed Jan 21, 2021
1 parent b0902f4 commit 0a75047
Show file tree
Hide file tree
Showing 52 changed files with 448 additions and 392 deletions.
4 changes: 2 additions & 2 deletions app/Admin/Controllers/CardsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ protected function grid()
$grid->filter(function($filter) use ($commodClass){
// 去掉默认的id过滤器
$filter->disableIdFilter();
$filter->equal('id', '卡密id');
$filter->equal('id', '卡密 ID');
// 在这里添加字段过滤器
$filter->like('card_info', '卡密内容');
$filter->like('card_info', '卡密信息');
$filter->equal('product_id', '所属商品')->select($commodClass);
$filter->equal('card_status', '状态')->select([1 => '未售出', 2 => '已售出']);
});
Expand Down
2 changes: 1 addition & 1 deletion app/Admin/Controllers/CouponsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ protected function grid()
$grid->filter(function($filter) {
// 去掉默认的id过滤器
$filter->disableIdFilter();
$filter->equal('card', '优惠券码');
$filter->equal('card', '优惠码');
$pdlisy = Products::where('pd_type', 1)->get(['id', 'pd_name'])->toArray();
$commod = [];
foreach ($pdlisy as $val)
Expand Down
10 changes: 5 additions & 5 deletions app/Admin/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@ public function index(Content $content)
$head = [
'date' => '日期',
'order_num' => '当日订单总数',
'ord_price' => '当日总销售额',
'ord_price' => '当日销售总额',
];
$echarts = (new Echarts('近七日', '销售数据'))
->setSeriesType('bar')
->setData($orders->toArray())
->bindLegend($head);
return $content
->title('控制台首页')
->title('仪表盘')
->description('welcome to manager...')
->row(self::title())
->body(new Box('销售数据', $echarts))
Expand All @@ -60,16 +60,16 @@ public static function environment()
{
$envs = [
['name' => 'PHP 版本', 'value' => 'PHP/' . PHP_VERSION],
['name' => 'Laravel内核版本', 'value' => app()->version()],
['name' => 'Laravel 框架版本', 'value' => app()->version()],
['name' => 'CGI', 'value' => php_sapi_name()],
['name' => '服务器名称', 'value' => php_uname()],
['name' => '服务器信息', 'value' => php_uname()],
['name' => '网页服务器', 'value' => Arr::get($_SERVER, 'SERVER_SOFTWARE')],

['name' => '缓存配置', 'value' => config('cache.default')],
['name' => 'Session 配置', 'value' => config('session.driver')],
['name' => '消息队列配置', 'value' => config('queue.default')],

['name' => '时区 ', 'value' => config('app.timezone')],
['name' => '时区', 'value' => config('app.timezone')],
['name' => 'Locale', 'value' => config('app.locale')],
['name' => 'Env', 'value' => config('app.env')],
['name' => 'URL', 'value' => config('app.url')],
Expand Down
16 changes: 8 additions & 8 deletions app/Admin/Controllers/OrdersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ protected function grid()
$grid->column('ord_title', __('Ord title'));
$grid->column('product.pd_name', __('Product id'));
$grid->column('coupon.card', __('Coupon id'));
$grid->column('ord_class', __('Ord class'))->using([1 => '自动发卡', 2 => '代充']);
$grid->column('ord_class', __('Ord class'))->using([1 => '自动发货', 2 => '人工发货']);
$grid->column('product_price', __('Product price'))->label('warning');
$grid->column('buy_amount', __('Buy amount'))->label('info');
$grid->column('ord_price', __('Ord price'))->label('success');
$grid->column('account', __('Account'))->copyable();
$grid->column('pay.pay_name', __('Pay way'));
$grid->column('ord_status', __('Ord status'))->editable('select', [1 => '待处理', 2 => '已处理', 3 => '处理成功', 4 => '处理失败']);
$grid->column('ord_status', __('Ord status'))->editable('select', [1 => '待处理', 2 => '已处理', 3 => '已完成', 4 => '已失败']);
$grid->column('created_at', __('Created at'));
$grid->column('updated_at', __('Updated at'));
$grid->disableCreateButton();
Expand All @@ -50,8 +50,8 @@ protected function grid()
$filter->scope('trashed', '回收站')->onlyTrashed();
// 去掉默认的id过滤器
$filter->disableIdFilter();
$filter->equal('order_id', '订单id');
$filter->equal('account', '充值账号');
$filter->equal('order_id', '订单号');
$filter->equal('account', '订单邮箱');
$pdlisy = Products::get(['id', 'pd_name'])->toArray();
$commod = [];
foreach ($pdlisy as $val)
Expand All @@ -60,9 +60,9 @@ protected function grid()
}
$filter->equal('product_id', '所属商品')->select($commod);
// 在这里添加字段过滤器
$filter->equal('ord_status', '订单状态')->select([1 => '待处理', 2 => '已处理', 3 => '已完成', 4 => '处理失败']);
$filter->equal('ord_class', '订单类型')->select([1 => '卡密', 2 => '代充']);
$filter->date('created_at', '订单日期');
$filter->equal('ord_status', '订单状态')->select([1 => '待处理', 2 => '已处理', 3 => '已完成', 4 => '已失败']);
$filter->equal('ord_class', '订单类型')->select([1 => '自动发货', 2 => '人工发货']);
$filter->date('created_at', '创建时间');
});
return $grid;
}
Expand All @@ -81,7 +81,7 @@ protected function form()
$form->display('ord_title', __('Ord title'));
$form->display('product.pd_name', __('Product id'));
$form->display('coupon.card', __('Coupon id'));
$form->radio('ord_class', __('Ord class'))->options([1 => '自动发卡', 2 => '代充'])->disable();
$form->radio('ord_class', __('Ord class'))->options([1 => '自动发货', 2 => '手动发货'])->disable();
$form->display('product_price', __('Product price'))->default(0.00);
$form->display('ord_price', __('Ord price'))->default(0.00);
$form->display('buy_amount', __('Buy amount'));
Expand Down
18 changes: 9 additions & 9 deletions app/Admin/Controllers/ProductsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ protected function grid()
$grid->column('pd_name', __('Pd name'))->label();
$grid->column('pd_picture', __('Pd picture'))->image();
$grid->column('classify.name', __('Pd class'));
$grid->column('pd_type', __('Pd type'))->editable('select', [1 => '卡密', 2 => '代充']);
$grid->column('pd_type', __('Pd type'))->editable('select', [1 => '自动发货', 2 => '人工发货']);
$grid->column('cost_price', __('Cost price'))->editable();
$grid->column('actual_price', __('Actual price'))->editable();
$grid->column('in_stock', __('In stock'));
Expand Down Expand Up @@ -78,20 +78,20 @@ protected function form()
$dataArr[$classify['id']] = $classify['name'];
}
$form->select('pd_class', __('Pd class'))->options($dataArr)->required();
$form->currency('cost_price', __('Cost price'))->rules('required|numeric', ['required' => '不能为空','numeric' => '请正确填写金额,整数或小数']);
$form->currency('actual_price', __('Actual price'))->rules('required|numeric', ['required' => '不能为空','numeric' => '请正确填写金额,整数或小数']);
$form->image('pd_picture', __('Pd picture'))->uniqueName()->help('可以为空');
$form->textarea('wholesale_price', __('Wholesale price'))->help('例如5=3 代表5件或以上每件3元,一行一个');
$form->number('in_stock', __('In stock'))->help('(卡密商品请不要填写库存,服务器自行识别)')->default(0);
$form->currency('cost_price', __('Cost price'))->rules('required|numeric', ['required' => '不能为空','numeric' => '请填写正确的金额,整数或小数']);
$form->currency('actual_price', __('Actual price'))->rules('required|numeric', ['required' => '不能为空','numeric' => '请填写正确的金额,整数或小数']);
$form->image('pd_picture', __('Pd picture'))->uniqueName()->help('可以为空,为空则为默认图片');
$form->textarea('wholesale_price', __('Wholesale price'))->help('例如:填写 5=3 表示客户购买 5 件或以上时,每件价格为 3 元。一行一个');
$form->number('in_stock', __('In stock'))->help('(如商品为自动发货类型请不要填写库存,系统会自动识别)')->default(0);
$form->number('sales_volume', __('Sales volume'))->default(0);
$form->number('ord', __('Ord'))->default(1);
$form->UEditor('buy_prompt', __('Buy prompt'));
$form->UEditor('pd_info', __('Pd info'));
$form->radio('pd_type', __('Pd type'))->options([1=> '自动发卡', 2=> '代充'])
$form->radio('pd_type', __('Pd type'))->options([1=> '自动发货', 2=> '人工发货'])
->rules('required',['请选择类型'])
->default(1);
$form->radio('isopen_coupon', __('Is open coupon'))->options([1 => '开启', 2 => '关闭'])->default(1);
$form->textarea('other_ipu', __('Other ipu'))->help('(仅针对代充商品有效,一行一个) 例如:qqpwd=QQ密码=true 代表多一个qqpwd输入框,需要输入的内容是QQ密码,true为必填 false为可空');
$form->radio('isopen_coupon', __('Is open coupon'))->options([1 => '', 2 => ''])->default(1);
$form->textarea('other_ipu', __('Other ipu'))->help('例如:填写 qqpwd=QQ 密码=true 表示产品详情页会新增一个 qqpwd 输入框,客户可在其中输入 QQ 密码,true 为必填,false 为选填(仅对人工发货类商品有效,一行一个)');
$form->radio('pd_status', __('Pd status'))
->options([1=> '上架', 2=> '下架'])
->rules('required',['请选择状态'])
Expand Down
10 changes: 5 additions & 5 deletions app/Admin/Forms/CreateCoupons.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CreateCoupons extends Form
*
* @var string
*/
public $title = '优惠码生成';
public $title = '生成优惠码';

/**
* Handle the form request.
Expand Down Expand Up @@ -46,9 +46,9 @@ public function handle(Request $request)
}
$posts = Coupons::insert($coupon);
if (!$posts) {
admin_error('提醒', '数据处理成功失败.');
admin_error('提示', '数据处理失败');
}
admin_success('提醒', '生成优惠券成功');
admin_success('提示', '优惠码生成成功');

return redirect(config('admin.route.prefix') . '/coupons');
}
Expand All @@ -68,8 +68,8 @@ public function form()
$this->select('product_id', __('Product id'))->options($commodClass)->rules('required',['请选择商品'])->default(key($commodClass));
$this->radio('c_type', __('C type'))->options([1 => '一次性使用', 2 => '重复使用'])->default(1);
$this->currency('discount', __('Discount'))->rules('required|numeric', ['required' => '优惠金额不能为空','numeric' => '请正确填写金额,整数或小数'])->default(1);
$this->text('ret', __('Ret'))->default(1)->help('当类型为一次性时,系统默认可用次数为1');
$this->text('number', __('Number'))->default(1)->help('当类型为重复使用时,系统只创建一张');
$this->text('ret', __('Ret'))->default(1)->help('当类型为一次性时,系统默认可用次数为 1');
$this->text('number', __('Number'))->default(1)->help('当类型为重复使用时,系统只创建一个优惠码');
return $this;
}

Expand Down
12 changes: 6 additions & 6 deletions app/Admin/Forms/ImportCards.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ public function handle(Request $request)
'product_id' => 'required',
'card_info' => 'required',
);
$messages = ['product_id.required' => '请选择商品', 'card_info.required' => '请输入卡密内容'];
$messages = ['product_id.required' => '请选择商品', 'card_info.required' => '请输入卡密信息'];
$validator = Validator::make($data, $rules, $messages);
if ($validator->fails()) {
return admin_error('提醒', $validator->errors()->first());
return admin_error('提示', $validator->errors()->first());
} else {
$cardList = explode(PHP_EOL, $data['card_info']);
$kamiList = [];
Expand All @@ -50,12 +50,12 @@ public function handle(Request $request)
}
$posts = Cards::insert($kamiList);
if (!$posts) {
return admin_error('提醒', '导入失败,请检查格式');
return admin_error('提示', '导入失败,请检查格式');
}
}
// 增加库存
Products::where('id', '=', $data['product_id'])->increment('in_stock', count($kamiList));
admin_success('提醒', '操作成功本次共导入:'.count($kamiList).'条卡密');
admin_success('提示', '操作成功本次共导入 '.count($kamiList).' 条卡密信息');

return redirect(config('admin.route.prefix') . '/cards');
}
Expand All @@ -72,8 +72,8 @@ public function form()
$commodClass[$val['id']] = $val['pd_name'];
}
$this->select('product_id', __('Product id'))->options($commodClass)->rules('required',['请选择商品'])->default(key($commodClass));
$this->textarea('card_info', __('Card info'))->rules('required',['请输入卡密内容'])->rows(20)->help('一行一个,回车分隔');
$this->radio('checkm', '是否去掉重复卡密')->options([1 => '', 2 => ''])->default(1);
$this->textarea('card_info', __('Card info'))->rules('required',['请输入卡密信息'])->rows(20)->help('一行一个,用回车键分隔');
$this->radio('checkm', '是否去除重复卡密')->options([1 => '', 2 => ''])->default(1);
return $this;
}

Expand Down
8 changes: 4 additions & 4 deletions app/Admin/Forms/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,19 @@ public function handle(Request $request)
public function form()
{
$this->text('title', __('Sys title'))->rules('required');
$this->image('img_logo', __('Sys img logo'))->help('网站logo');
$this->image('img_logo', __('Sys img logo'))->help('网站 Logo');
$this->text('text_logo', __('Sys text logo'))->rules('required');
$this->text('keywords', __('Sys keywords'))->rules('required');
$this->textarea('description', __('Sys description'))->rules('required');
$this->select('tpl_sign', __('Sys templates'))->options(config('dujiao.templates'))->rules('required');
$this->email('manage_email', __('Sys manage email'))->rules('required')->help("用于接收待处理订单提示");
$this->select('langs', __('Sys Langs'))->options(config('dujiao.language'))->rules('required')->help('默认为简体中文zh-CN,不会翻译语言包不要改');
$this->email('manage_email', __('Sys manage email'))->rules('required')->help("用于接收待处理订单提醒");
$this->select('langs', __('Sys Langs'))->options(config('dujiao.language'))->rules('required')->help('默认为简体中文 zh-CN不会翻译语言包不要改');
$this->radio('verify_code', __('Verify Code'))->options([1 => '开启', 2 => '关闭'])->default(1);
$this->radio('isopen_searchpwd', __('Is open searchpwd'))->options([1 => '开启', 2 => '关闭'])->default(1);
$this->radio('isopen_serverj', __('Is open serverj'))->options([1 => '开启', 2 => '关闭'])->default(1);
$this->text('serverj_token', __('Serverj token'));
$this->UEditor('notice', __('Sys notice'));
$this->textarea('footer', __('Sys footer'))->help('可以填写一些统计代码或者icp备案信息');
$this->textarea('footer', __('Sys footer'))->help('可填写统计代码或 ICP 备案信息');

}

Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/Home/OrderController.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class OrderController extends Controller
private $productService;

/**
* 优惠券服务层
* 优惠码服务层
* @var
*/
private $couponService;
Expand Down Expand Up @@ -111,7 +111,7 @@ public function createOrder(Request $request)
'pd_type' => $product['pd_type'],
'actual_price' => $product['actual_price'],
'buy_amount' => intval($data['order_number']), // 订单个数
'account' => $data['account'], // 充值账号
'account' => $data['account'], // 订单邮箱
'search_pwd' => $data['search_pwd'] ?? 'dujiaoka',
'buy_ip' => $request->getClientIp(),
'other_ipu' => ''
Expand All @@ -122,10 +122,10 @@ public function createOrder(Request $request)
// 计算订单总价
$this->orderService->calculateThePrice();
/**
* 这里是优惠券处理逻辑.
* 这里是优惠码处理逻辑.
*/
if (isset($data['coupon_code']) && $product['isopen_coupon'] == 1) {
// 先查出有没有优惠券
// 先查出有没有优惠码
$coupon = $this->couponService->couponByProduct($data['pid'], $data['coupon_code']);
if (!$coupon) throw new AppException(__('prompt.coupon_does_not_exist'));
$this->orderService->setCoupon($coupon);
Expand Down
2 changes: 1 addition & 1 deletion app/Jobs/ReleaseOrder.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public function handle()
// 已经过期 释放库存
$res = Products::where('id', '=', $this->productId)->increment('in_stock', $this->stock);
$orderCache = json_decode($orderCache, true);
// 如果存在优惠券,就将优惠券次数+1
// 如果存在优惠码,就将优惠码次数+1
if (isset($orderCache['coupon_id'])) {
Coupons::where('id', '=', $orderCache['coupon_id'])->increment('ret', 1);
if ($orderCache['coupon_type'] == 1) {
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function product()
}

/**
* 关联优惠券.
* 关联优惠码.
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function coupon()
Expand Down
6 changes: 3 additions & 3 deletions app/Services/CouponService.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class CouponService
{

/**
* 根据优惠券和商品获得优惠券详情
* 根据优惠码和商品获得优惠码详情
* @param int $productId
* @param string $coupon
* @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null
Expand All @@ -21,7 +21,7 @@ public function couponByProduct(int $productId, string $coupon)
}

/**
* 设置优惠券已使用
* 设置优惠码已使用
* @param string $coupon
* @return int
*/
Expand All @@ -33,7 +33,7 @@ public function used(string $coupon)
}

/**
* 设置优惠券-1
* 设置优惠码-1
* @param string $coupon
*/
public function numberDecr(string $coupon)
Expand Down
Loading

0 comments on commit 0a75047

Please sign in to comment.