Commit c767e282 authored by 孙 楠's avatar 孙 楠

add more i18n messages

parent ee7a9c05
...@@ -8,7 +8,7 @@ export default class NavigatorController extends Controller { ...@@ -8,7 +8,7 @@ export default class NavigatorController extends Controller {
const list = await ctx.service.navigator.getList(pageNo, pageSize, name, author); const list = await ctx.service.navigator.getList(pageNo, pageSize, name, author);
ctx.body = ctx.helper.ok(list); ctx.body = ctx.helper.ok(list);
} catch (e) { } catch (e) {
ctx.logger.info(`获取导航配置数据异常, ${JSON.stringify(e)}`); ctx.logger.info(`${$t('failed.to.get.navigation.config')}${JSON.stringify(e)}`);
ctx.body = ctx.helper.fail({ ctx.body = ctx.helper.fail({
message: $t('data.fetch.error') message: $t('data.fetch.error')
}); });
...@@ -21,7 +21,7 @@ export default class NavigatorController extends Controller { ...@@ -21,7 +21,7 @@ export default class NavigatorController extends Controller {
const list = await ctx.service.navigator.getNavigatorConfigListWithRelation(pageNo, pageSize, name, author, id); const list = await ctx.service.navigator.getNavigatorConfigListWithRelation(pageNo, pageSize, name, author, id);
ctx.body = ctx.helper.ok(list); ctx.body = ctx.helper.ok(list);
} catch (e) { } catch (e) {
ctx.logger.info(`获取导航配置数据异常, ${JSON.stringify(e)}`); ctx.logger.info(`${$t('failed.to.get.navigation.config')}${JSON.stringify(e)}`);
ctx.body = ctx.helper.fail({ ctx.body = ctx.helper.fail({
message: $t('data.fetch.error') message: $t('data.fetch.error')
}); });
...@@ -34,7 +34,7 @@ export default class NavigatorController extends Controller { ...@@ -34,7 +34,7 @@ export default class NavigatorController extends Controller {
await ctx.service.navigator.deleteById(id); await ctx.service.navigator.deleteById(id);
ctx.body = ctx.helper.ok({}); ctx.body = ctx.helper.ok({});
} catch (e) { } catch (e) {
ctx.logger.info(`删除导航配置异常, ${JSON.stringify(e)}`); ctx.logger.info(`${$t('failed.to.delete.navigation.config')}${JSON.stringify(e)}`);
ctx.body = ctx.helper.fail({ ctx.body = ctx.helper.fail({
message: $t('failed.to.delete.nav.config') message: $t('failed.to.delete.nav.config')
}); });
...@@ -63,7 +63,7 @@ export default class NavigatorController extends Controller { ...@@ -63,7 +63,7 @@ export default class NavigatorController extends Controller {
await ctx.service.navigator.saveOrUpdate(pageInfo); await ctx.service.navigator.saveOrUpdate(pageInfo);
ctx.body = ctx.helper.ok({}); ctx.body = ctx.helper.ok({});
} catch (e) { } catch (e) {
ctx.logger.info(`保存导航配置异常, ${JSON.stringify(e)}`); ctx.logger.info(`${$t('failed.to.save.navigation.config')}${JSON.stringify(e)}`);
ctx.body = ctx.helper.fail({ ctx.body = ctx.helper.fail({
message: $t('failed.to.save.nav.config') message: $t('failed.to.save.nav.config')
}); });
...@@ -76,7 +76,7 @@ export default class NavigatorController extends Controller { ...@@ -76,7 +76,7 @@ export default class NavigatorController extends Controller {
const res = await ctx.service.navigator.getDetail(navId); const res = await ctx.service.navigator.getDetail(navId);
ctx.body = ctx.helper.ok(res); ctx.body = ctx.helper.ok(res);
} catch (e) { } catch (e) {
ctx.logger.info(`查询导航配置异常, ${JSON.stringify(e)}`); ctx.logger.info(`${$t('failed.to.query.navigation.config')}${JSON.stringify(e)}`);
ctx.body = ctx.helper.fail({ ctx.body = ctx.helper.fail({
message: $t('failed.to.query.nav.config') message: $t('failed.to.query.nav.config')
}); });
......
This diff is collapsed.
This diff is collapsed.
...@@ -10,7 +10,7 @@ export default class RecordsService extends Service { ...@@ -10,7 +10,7 @@ export default class RecordsService extends Service {
// 操作记录表直接删除一年以上的操作记录 // 操作记录表直接删除一年以上的操作记录
const limitDate = new Date(new Date().getTime() - 365 * 24 * 3600 * 1000).toLocaleDateString().replace(/\//g, '-') const limitDate = new Date(new Date().getTime() - 365 * 24 * 3600 * 1000).toLocaleDateString().replace(/\//g, '-')
try { try {
this.context.logger.info(`开始删除页面历史记录,删除范围为日期在${limitDate}之前的所有记录`); this.context.logger.info(`${$t('deleting.page.history.from.date')}${limitDate}${$t('all.previous.records')}`);
await this.context.model.PageHistory.destroy({ await this.context.model.PageHistory.destroy({
where: { where: {
updated_at: { updated_at: {
...@@ -18,9 +18,9 @@ export default class RecordsService extends Service { ...@@ -18,9 +18,9 @@ export default class RecordsService extends Service {
} }
} }
}); });
this.context.logger.info(`页面历史记录删除成功,删除范围为日期在${limitDate}之前的所有记录`); this.context.logger.info(`${$t('page.history.deleted.from.date')}${limitDate}${$t('all.previous.records')}`);
} catch (err) { } catch (err) {
this.context.logger.info(`页面历史记录删除失败,失败原因: ${JSON.stringify(err)}`); this.context.logger.info(`${$t('failed.to.delete.page.history')}${JSON.stringify(err)}`);
} }
return; return;
} }
......
...@@ -115,7 +115,7 @@ export default { ...@@ -115,7 +115,7 @@ export default {
return !isPhone(this.formData.phoneNo); return !isPhone(this.formData.phoneNo);
}, },
captchaBtnText() { captchaBtnText() {
return this.showCount ? `剩余${this.count}` : $t('get.verification.code'); return this.showCount ? `${$t('remaining')}${this.count}${$t('seconds')}` : $t('get.verification.code');
}, },
btnStyles() { btnStyles() {
return this.btnImage ? { return this.btnImage ? {
......
...@@ -108,7 +108,7 @@ const columns: object[] = [ ...@@ -108,7 +108,7 @@ const columns: object[] = [
key: '', key: '',
hideSearch: true, hideSearch: true,
render: (h, params) => { render: (h, params) => {
const obj = params.row.couponType === 1 ? `${params.row.limitAmt}${params.row.couponAmt}元` : `满${params.row.limitAmt}可用`; const obj = params.row.couponType === 1 ? `${$t('full')}${params.row.limitAmt}${$t('minus')}${params.row.couponAmt}${$t('yuan')}` : `${$t('full')}${params.row.limitAmt}${$t('available')}`;
return h('div', obj); return h('div', obj);
}, },
}, },
......
...@@ -37,8 +37,8 @@ export default class CouponTableModal extends Vue { ...@@ -37,8 +37,8 @@ export default class CouponTableModal extends Vue {
item.useTime = item.useTimeStart item.useTime = item.useTimeStart
? `${item.useTimeStart}-${item.useTimeEnd}` ? `${item.useTimeStart}-${item.useTimeEnd}`
: item.validHours : item.validHours
? `自领取后有效${item.validHours}小时` ? `${$t('valid.since.claim')}${item.validHours}${$t('hours')}`
: `自领取${item.receiverDaysValid}天后生效,有效天数${item.validDays}`; : `${$t('valid.after.claim')}${item.receiverDaysValid}${$t('takes.effect.in.days.valid.for.1.days')}${item.validDays}${$t('days')}`;
// item.useTime = item.useTimeStart ? `${item.useTimeStart}-${item.useTimeEnd}` : `自领取${item.receiverDaysValid}天后生效,有效天数${item.validDays}天`; // item.useTime = item.useTimeStart ? `${item.useTimeStart}-${item.useTimeEnd}` : `自领取${item.receiverDaysValid}天后生效,有效天数${item.validDays}天`;
} }
const selections = this.templates.length ? this.templates : this.coupon; const selections = this.templates.length ? this.templates : this.coupon;
......
...@@ -20,7 +20,7 @@ const groupColumns = function() { ...@@ -20,7 +20,7 @@ const groupColumns = function() {
key: 'validityTime', key: 'validityTime',
hideSearch: true, hideSearch: true,
render: (h, params) => { render: (h, params) => {
const time = `${params.row.startTime}${params.row.endTime}`; const time = `${params.row.startTime}${$t('to')}${params.row.endTime}`;
return h('div', time); return h('div', time);
}, },
}, },
......
...@@ -79,7 +79,7 @@ export default { ...@@ -79,7 +79,7 @@ export default {
invalidArr.map(item => { invalidArr.map(item => {
ids += `${item.id},` ids += `${item.id},`
}) })
this.$Notice.error({ title: $t('hint'), desc: `以下活动id不符合当前活动类型: ${ids}`}); this.$Notice.error({ title: $t('hint'), desc: `${$t('activity.id.does.not.match.current.type')}${ids}`});
return; return;
} }
// 判断填入的活动ID是否存在重复的渠道ID的情况 // 判断填入的活动ID是否存在重复的渠道ID的情况
...@@ -110,7 +110,7 @@ export default { ...@@ -110,7 +110,7 @@ export default {
console.log(channel2Id, 'channel2Id') console.log(channel2Id, 'channel2Id')
for (let i in channel2Id) { for (let i in channel2Id) {
if (channel2Id[i].length > 1) { if (channel2Id[i].length > 1) {
this.$Notice.error({ title: $t('hint'), desc: `${i == 'common' ? '通用渠道' : $t('channel') + i}存在重复的活动ID: ${channel2Id[i].join(',')}`}); this.$Notice.error({ title: $t('hint'), desc: `${i == 'common' ? '通用渠道' : $t('channel') + i}${$t('duplicate.activity.id')}${channel2Id[i].join(',')}`});
return; return;
} }
} }
......
...@@ -80,7 +80,7 @@ export default { ...@@ -80,7 +80,7 @@ export default {
invalidArr.map(item => { invalidArr.map(item => {
ids += `${item.id},` ids += `${item.id},`
}) })
this.$Notice.error({ title: $t('hint'), desc: `以下活动id不符合当前活动类型: ${ids}`}); this.$Notice.error({ title: $t('hint'), desc: `${$t('activity.id.does.not.match.current.type')}${ids}`});
return; return;
} }
// 判断填入的活动ID是否存在重复的渠道ID的情况 // 判断填入的活动ID是否存在重复的渠道ID的情况
...@@ -111,7 +111,7 @@ export default { ...@@ -111,7 +111,7 @@ export default {
console.log(channel2Id, 'channel2Id') console.log(channel2Id, 'channel2Id')
for (let i in channel2Id) { for (let i in channel2Id) {
if (channel2Id[i].length > 1) { if (channel2Id[i].length > 1) {
this.$Notice.error({ title: $t('hint'), desc: `${i == 'common' ? '通用渠道' : $t('channel') + i}存在重复的活动ID: ${channel2Id[i].join(',')}`}); this.$Notice.error({ title: $t('hint'), desc: `${i == 'common' ? '通用渠道' : $t('channel') + i}${$t('duplicate.activity.id')}${channel2Id[i].join(',')}`});
return; return;
} }
} }
......
...@@ -208,13 +208,13 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) { ...@@ -208,13 +208,13 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
let rs = ''; let rs = '';
switch (type) { switch (type) {
case 'edit': case 'edit':
rs = `编辑${this.title}`; rs = `${$t('edit')}${this.title}`;
break; break;
case 'add': case 'add':
rs = `添加${this.title}`; rs = `${$t('add')}${this.title}`;
break; break;
case 'choose': case 'choose':
rs = `选择${this.title}`; rs = `${$t('select')}${this.title}`;
break; break;
} }
return rs; return rs;
......
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
</div> </div>
</div> </div>
<Tabs class="table-tabs" v-if="showSelected" :value="selectedTab"> <Tabs class="table-tabs" v-if="showSelected" :value="selectedTab">
<TabPane name="1" :label="`全部${title}`"> <TabPane name="1" :label="`${$t('all')}${title}`">
<Table <Table
:height="height" :height="height"
@on-select-cancel="selectionCancel" @on-select-cancel="selectionCancel"
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
@on-page-size-change="changePageSize" @on-page-size-change="changePageSize"
/> />
</TabPane> </TabPane>
<TabPane name="2" :label="`已选${title}`"> <TabPane name="2" :label="`${$t('selected')}${title}`">
<Table <Table
:height="height" :height="height"
@on-select-cancel="selectionCancel" @on-select-cancel="selectionCancel"
......
...@@ -114,7 +114,7 @@ export default class GoodsTabsMixin extends Vue { ...@@ -114,7 +114,7 @@ export default class GoodsTabsMixin extends Vue {
if (element.name === 'cs-goods-tabs' || element.name === 'cs-floor-nav') { if (element.name === 'cs-goods-tabs' || element.name === 'cs-floor-nav') {
element.props?.list.forEach(item => { element.props?.list.forEach(item => {
if (item.componentId && selectedComponentIds.includes(item.componentId)) { if (item.componentId && selectedComponentIds.includes(item.componentId)) {
throw new Error(`组件<${element.title}${element.id}>存在重复组件,请修改后继续操作`); throw new Error(`${$t('component')}${element.title}${element.id}${$t('duplicate.component.exists.please.modify')}`);
} else { } else {
selectedComponentIds.push(item.componentId); selectedComponentIds.push(item.componentId);
} }
......
...@@ -146,7 +146,7 @@ export default { ...@@ -146,7 +146,7 @@ export default {
// 删除 // 删除
this.$Modal.confirm({ this.$Modal.confirm({
title: $t('hint'), title: $t('hint'),
content: `是否删除导航 ${row.name}`, content: `${$t('delete.navigation')}${row.name}`,
onOk: async () => { onOk: async () => {
const deleteRes = await navigatorApi.deleteNavigator({ const deleteRes = await navigatorApi.deleteNavigator({
id: row.id id: row.id
......
...@@ -170,7 +170,7 @@ instance.interceptors.response.use( ...@@ -170,7 +170,7 @@ instance.interceptors.response.use(
// 错误提示 // 错误提示
let message = ''; let message = '';
if (err.response) { if (err.response) {
message = ERR_MESSAGE_MAP.status[err.response.status] || `连接错误${err.response.status}`; message = ERR_MESSAGE_MAP.status[err.response.status] || `${$t('connection.error')}${err.response.status}`;
} else { } else {
message = $t('failed.to.connect.to.server'); message = $t('failed.to.connect.to.server');
} }
......
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 to comment