后台国家省份多语言

This commit is contained in:
pushuo 2022-08-31 08:42:48 +08:00
parent b01903b8c6
commit f636ffc08d
7 changed files with 96 additions and 49 deletions

View File

@ -1,6 +1,6 @@
@extends('admin::layouts.master') @extends('admin::layouts.master')
@section('title', '国家管理') @section('title', __('admin/common.country'))
@section('content') @section('content')
<div id="tax-classes-app" class="card" v-cloak> <div id="tax-classes-app" class="card" v-cloak>
@ -12,13 +12,13 @@
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>名称</th> <th>{{ __('common.name') }}</th>
<th>编码</th> <th>{{ __('currency.code') }}</th>
<th>创建时间</th> <th>{{ __('common.created_at') }}</th>
<th>修改时间</th> <th>{{ __('common.updated_at') }}</th>
<th>排序</th> <th>{{ __('common.sort_order') }}</th>
<th>状态</th> <th>{{ __('common.status') }}</th>
<th class="text-end">操作</th> <th class="text-end">{{ __('common.action') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -34,8 +34,8 @@
<span v-else class="text-secondary">{{ __('common.disable') }}</span> <span v-else class="text-secondary">{{ __('common.disable') }}</span>
</td> </td>
<td class="text-end"> <td class="text-end">
<button class="btn btn-outline-secondary btn-sm" @click="checkedCreate('edit', index)">编辑</button> <button class="btn btn-outline-secondary btn-sm" @click="checkedCreate('edit', index)">{{ __('common.edit') }}</button>
<button class="btn btn-outline-danger btn-sm ml-1" type="button" @click="deleteCustomer(country.id, index)">删除</button> <button class="btn btn-outline-danger btn-sm ml-1" type="button" @click="deleteCustomer(country.id, index)">{{ __('common.delete') }}</button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -45,29 +45,29 @@
:total="country.total"></el-pagination> :total="country.total"></el-pagination>
</div> </div>
<el-dialog title="国家管理" :visible.sync="dialog.show" width="500px" <el-dialog title="{{ __('admin/common.country') }}" :visible.sync="dialog.show" width="600px"
@close="closeCustomersDialog('form')" :close-on-click-modal="false"> @close="closeCustomersDialog('form')" :close-on-click-modal="false">
<el-form ref="form" :rules="rules" :model="dialog.form" label-width="100px"> <el-form ref="form" :rules="rules" :model="dialog.form" label-width="130px">
<el-form-item label="国家名称" prop="name"> <el-form-item label="{{ __('admin/country.country_name') }}" prop="name">
<el-input v-model="dialog.form.name" placeholder="名称"></el-input> <el-input v-model="dialog.form.name" placeholder="名称"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="排序"> <el-form-item label="{{ __('common.sort_order') }}">
<el-input v-model="dialog.form.sort_order" placeholder="排序"></el-input> <el-input v-model="dialog.form.sort_order" placeholder="{{ __('common.sort_order') }}"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="编码"> <el-form-item label="{{ __('currency.code') }}">
<el-input v-model="dialog.form.code" placeholder="编码"></el-input> <el-input v-model="dialog.form.code" placeholder="{{ __('currency.code') }}"></el-input>
</el-form-item> </el-form-item>
<el-form-item label=" 状态"> <el-form-item label="{{ __('common.status') }}">
<el-switch v-model="dialog.form.status" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="dialog.form.status" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item> </el-form-item>
<el-form-item class="mt-5"> <el-form-item class="mt-5">
<el-button type="primary" @click="addFormSubmit('form')">保存</el-button> <el-button type="primary" @click="addFormSubmit('form')">{{ __('common.save') }}</el-button>
<el-button @click="closeCustomersDialog('form')">取消</el-button> <el-button @click="closeCustomersDialog('form')">{{ __('common.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
@ -99,7 +99,7 @@
}, },
rules: { rules: {
name: [{required: true,message: '请输入国家名称',trigger: 'blur'}, ], name: [{required: true,message: '{{ __('common.error_required', ['name' => __('admin/country.country_name')]) }}',trigger: 'blur'}, ],
} }
}, },
@ -141,7 +141,7 @@
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (!valid) { if (!valid) {
this.$message.error('请检查表单是否填写正确'); this.$message.error('{{ __('common.error_form') }}');
return; return;
} }

View File

@ -1,6 +1,6 @@
@extends('admin::layouts.master') @extends('admin::layouts.master')
@section('title', '省份管理') @section('title', __('admin/common.zone'))
@section('content') @section('content')
<div id="tax-classes-app" class="card" v-cloak> <div id="tax-classes-app" class="card" v-cloak>
@ -12,13 +12,13 @@
<thead> <thead>
<tr> <tr>
<th>ID</th> <th>ID</th>
<th>名称</th> <th>{{ __('common.name') }}</th>
<th>编码</th> <th>{{ __('currency.code') }}</th>
<th>创建时间</th> <th>{{ __('common.created_at') }}</th>
<th>修改时间</th> <th>{{ __('common.updated_at') }}</th>
<th>排序</th> <th>{{ __('common.sort_order') }}</th>
<th>状态</th> <th>{{ __('common.status') }}</th>
<th class="text-end">操作</th> <th class="text-end">{{ __('common.action') }}</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -34,8 +34,8 @@
<span v-else class="text-secondary">{{ __('common.disable') }}</span> <span v-else class="text-secondary">{{ __('common.disable') }}</span>
</td> </td>
<td class="text-end"> <td class="text-end">
<button class="btn btn-outline-secondary btn-sm" @click="checkedCreate('edit', index)">编辑</button> <button class="btn btn-outline-secondary btn-sm" @click="checkedCreate('edit', index)">{{ __('common.edit') }}</button>
<button class="btn btn-outline-danger btn-sm ml-1" type="button" @click="deleteCustomer(zone.id, index)">删除</button> <button class="btn btn-outline-danger btn-sm ml-1" type="button" @click="deleteCustomer(zone.id, index)">{{ __('common.delete') }}</button>
</td> </td>
</tr> </tr>
</tbody> </tbody>
@ -45,20 +45,20 @@
:total="zones.total"></el-pagination> :total="zones.total"></el-pagination>
</div> </div>
<el-dialog title="省份管理" :visible.sync="dialog.show" width="500px" <el-dialog title="{{ __('admin/common.zone') }}" :visible.sync="dialog.show" width="620px"
@close="closeCustomersDialog('form')" :close-on-click-modal="false"> @close="closeCustomersDialog('form')" :close-on-click-modal="false">
<el-form ref="form" :rules="rules" :model="dialog.form" label-width="100px"> <el-form ref="form" :rules="rules" :model="dialog.form" label-width="148px">
<el-form-item label="省份名称" prop="name"> <el-form-item label="{{ __('admin/zone.zone_name') }}" prop="name">
<el-input v-model="dialog.form.name" placeholder="名称"></el-input> <el-input v-model="dialog.form.name" placeholder="{{ __('admin/zone.zone_name') }}"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="编码"> <el-form-item label="{{ __('currency.code') }}">
<el-input v-model="dialog.form.code" placeholder="编码"></el-input> <el-input v-model="dialog.form.code" placeholder="{{ __('currency.code') }}"></el-input>
</el-form-item> </el-form-item>
<el-form-item label="所属国家" prop="country_id"> <el-form-item label="{{ __('admin/zone.country_of_origin') }}" prop="country_id">
<el-select v-model="dialog.form.country_id" placeholder="请选择"> <el-select v-model="dialog.form.country_id" placeholder="{{ __('admin/zone.country_of_origin') }}">
<el-option <el-option
v-for="item in countries" v-for="item in countries"
:key="item.id" :key="item.id"
@ -68,18 +68,18 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="排序"> <el-form-item label="{{ __('common.sort_order') }}">
<el-input v-model="dialog.form.sort_order" placeholder="排序"></el-input> <el-input v-model="dialog.form.sort_order" placeholder="{{ __('common.sort_order') }}"></el-input>
</el-form-item> </el-form-item>
<el-form-item label=" 状态"> <el-form-item label="{{ __('common.status') }}">
<el-switch v-model="dialog.form.status" :active-value="1" :inactive-value="0"></el-switch> <el-switch v-model="dialog.form.status" :active-value="1" :inactive-value="0"></el-switch>
</el-form-item> </el-form-item>
<el-form-item class="mt-5"> <el-form-item class="mt-5">
<el-button type="primary" @click="addFormSubmit('form')">保存</el-button> <el-button type="primary" @click="addFormSubmit('form')">{{ __('common.save') }}</el-button>
<el-button @click="closeCustomersDialog('form')">取消</el-button> <el-button @click="closeCustomersDialog('form')">{{ __('common.cancel') }}</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-dialog> </el-dialog>
@ -114,8 +114,8 @@
}, },
rules: { rules: {
name: [{required: true, message: '请输入省份名称', trigger: 'blur'}, ], name: [{required: true, message: '{{ __('common.error_required', ['name' => __('admin/zone.zone_name')]) }}', trigger: 'blur'}, ],
country_id: [{required: true, message: '请选择国家', trigger: 'blur'}, ], country_id: [{required: true, message: '{{ __('admin/zone.error_country') }}', trigger: 'blur'}, ],
} }
}, },
@ -157,7 +157,7 @@
this.$refs[form].validate((valid) => { this.$refs[form].validate((valid) => {
if (!valid) { if (!valid) {
this.$message.error('请检查表单是否填写正确'); this.$message.error('{{ __('common.error_form') }}');
return; return;
} }

View File

@ -37,6 +37,8 @@ return [
'tax_class' => 'Tax Class', 'tax_class' => 'Tax Class',
'currency' => 'Currency', 'currency' => 'Currency',
'language' => 'Language', 'language' => 'Language',
'zone' => 'Zone',
'country' => 'Country',
'file_manager' => 'File Manager', 'file_manager' => 'File Manager',
'access_frontend' => 'Frontend', 'access_frontend' => 'Frontend',

View File

@ -0,0 +1,18 @@
<?php
/**
* country.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author TL <mengwb@opencart.cn>
* @created 2022-08-29 17:21:38
* @modified 2022-08-29 17:21:38
*/
return [
'country_name' => 'Country Name',
'countries_index' => 'Country List',
'countries_create' => 'Create Country',
'countries_update' => 'Update Country',
'countries_delete' => 'Delete Country',
];

View File

@ -0,0 +1,21 @@
<?php
/**
* zone.php
*
* @copyright 2022 opencart.cn - All Rights Reserved
* @link http://www.guangdawangluo.com
* @author TL <mengwb@opencart.cn>
* @created 2022-08-29 17:21:38
* @modified 2022-08-29 17:21:38
*/
return [
'zone_name' => 'Province Name',
'country_of_origin' => 'Country Of Origin',
'zones_index' => 'Province List',
'zones_create' => 'Create Province',
'zones_update' => 'Update Province',
'zones_delete' => 'Delete Province',
'error_country' => 'Please select a country',
];

View File

@ -9,8 +9,9 @@
* @modified 2022-08-29 17:21:38 * @modified 2022-08-29 17:21:38
*/ */
return [ return [
'country_name' => '国家名称',
'countries_index' => '国家列表', 'countries_index' => '国家列表',
'countries_create' => '创建国家', 'countries_create' => '创建国家',
'countries_update' => '更新国家', 'countries_update' => '更新国家',
'countries_delete' => '删除国家',
]; ];

View File

@ -9,8 +9,13 @@
* @modified 2022-08-29 17:21:38 * @modified 2022-08-29 17:21:38
*/ */
return [ return [
'zone_name' => '省份名称',
'country_of_origin' => '所属国家',
'zones_index' => '省份列表', 'zones_index' => '省份列表',
'zones_create' => '创建省份', 'zones_create' => '创建省份',
'zones_update' => '更新省份', 'zones_update' => '更新省份',
'zones_delete' => '删除省份', 'zones_delete' => '删除省份',
'error_country' => '请选择国家',
]; ];