Commit c767e282 authored by 孙 楠's avatar 孙 楠

add more i18n messages

parent ee7a9c05
......@@ -8,7 +8,7 @@ export default class NavigatorController extends Controller {
const list = await ctx.service.navigator.getList(pageNo, pageSize, name, author);
ctx.body = ctx.helper.ok(list);
} 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({
message: $t('data.fetch.error')
});
......@@ -21,7 +21,7 @@ export default class NavigatorController extends Controller {
const list = await ctx.service.navigator.getNavigatorConfigListWithRelation(pageNo, pageSize, name, author, id);
ctx.body = ctx.helper.ok(list);
} 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({
message: $t('data.fetch.error')
});
......@@ -34,7 +34,7 @@ export default class NavigatorController extends Controller {
await ctx.service.navigator.deleteById(id);
ctx.body = ctx.helper.ok({});
} 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({
message: $t('failed.to.delete.nav.config')
});
......@@ -63,7 +63,7 @@ export default class NavigatorController extends Controller {
await ctx.service.navigator.saveOrUpdate(pageInfo);
ctx.body = ctx.helper.ok({});
} 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({
message: $t('failed.to.save.nav.config')
});
......@@ -76,7 +76,7 @@ export default class NavigatorController extends Controller {
const res = await ctx.service.navigator.getDetail(navId);
ctx.body = ctx.helper.ok(res);
} 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({
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 {
// 操作记录表直接删除一年以上的操作记录
const limitDate = new Date(new Date().getTime() - 365 * 24 * 3600 * 1000).toLocaleDateString().replace(/\//g, '-')
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({
where: {
updated_at: {
......@@ -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) {
this.context.logger.info(`页面历史记录删除失败,失败原因: ${JSON.stringify(err)}`);
this.context.logger.info(`${$t('failed.to.delete.page.history')}${JSON.stringify(err)}`);
}
return;
}
......
......@@ -115,7 +115,7 @@ export default {
return !isPhone(this.formData.phoneNo);
},
captchaBtnText() {
return this.showCount ? `剩余${this.count}` : $t('get.verification.code');
return this.showCount ? `${$t('remaining')}${this.count}${$t('seconds')}` : $t('get.verification.code');
},
btnStyles() {
return this.btnImage ? {
......
......@@ -108,7 +108,7 @@ const columns: object[] = [
key: '',
hideSearch: true,
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);
},
},
......
......@@ -37,8 +37,8 @@ export default class CouponTableModal extends Vue {
item.useTime = item.useTimeStart
? `${item.useTimeStart}-${item.useTimeEnd}`
: item.validHours
? `自领取后有效${item.validHours}小时`
: `自领取${item.receiverDaysValid}天后生效,有效天数${item.validDays}`;
? `${$t('valid.since.claim')}${item.validHours}${$t('hours')}`
: `${$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}天`;
}
const selections = this.templates.length ? this.templates : this.coupon;
......
......@@ -20,7 +20,7 @@ const groupColumns = function() {
key: 'validityTime',
hideSearch: true,
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);
},
},
......
......@@ -79,7 +79,7 @@ export default {
invalidArr.map(item => {
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;
}
// 判断填入的活动ID是否存在重复的渠道ID的情况
......@@ -110,7 +110,7 @@ export default {
console.log(channel2Id, 'channel2Id')
for (let i in channel2Id) {
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;
}
}
......
......@@ -80,7 +80,7 @@ export default {
invalidArr.map(item => {
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;
}
// 判断填入的活动ID是否存在重复的渠道ID的情况
......@@ -111,7 +111,7 @@ export default {
console.log(channel2Id, 'channel2Id')
for (let i in channel2Id) {
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;
}
}
......
......@@ -208,13 +208,13 @@ export default class DynamicForm extends Mixins(DynamicFormMixin) {
let rs = '';
switch (type) {
case 'edit':
rs = `编辑${this.title}`;
rs = `${$t('edit')}${this.title}`;
break;
case 'add':
rs = `添加${this.title}`;
rs = `${$t('add')}${this.title}`;
break;
case 'choose':
rs = `选择${this.title}`;
rs = `${$t('select')}${this.title}`;
break;
}
return rs;
......
......@@ -28,7 +28,7 @@
</div>
</div>
<Tabs class="table-tabs" v-if="showSelected" :value="selectedTab">
<TabPane name="1" :label="`全部${title}`">
<TabPane name="1" :label="`${$t('all')}${title}`">
<Table
:height="height"
@on-select-cancel="selectionCancel"
......@@ -49,7 +49,7 @@
@on-page-size-change="changePageSize"
/>
</TabPane>
<TabPane name="2" :label="`已选${title}`">
<TabPane name="2" :label="`${$t('selected')}${title}`">
<Table
:height="height"
@on-select-cancel="selectionCancel"
......
......@@ -114,7 +114,7 @@ export default class GoodsTabsMixin extends Vue {
if (element.name === 'cs-goods-tabs' || element.name === 'cs-floor-nav') {
element.props?.list.forEach(item => {
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 {
selectedComponentIds.push(item.componentId);
}
......
......@@ -146,7 +146,7 @@ export default {
// 删除
this.$Modal.confirm({
title: $t('hint'),
content: `是否删除导航 ${row.name}`,
content: `${$t('delete.navigation')}${row.name}`,
onOk: async () => {
const deleteRes = await navigatorApi.deleteNavigator({
id: row.id
......
......@@ -170,7 +170,7 @@ instance.interceptors.response.use(
// 错误提示
let message = '';
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 {
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