i18n: replace hardcoded strings with language translations
批量将项目中多处硬编码的文本替换为多语言翻译条目,统一项目文案管理,提升多语言适配效率,包括导航提示、操作反馈、空状态提示、表单占位符等各类文本内容。
This commit is contained in:
@@ -123,14 +123,14 @@ export default {
|
||||
if (this.goodsData.id) {
|
||||
this.isAWait = true;
|
||||
uni.setNavigationBarTitle({
|
||||
title: '编辑商品'
|
||||
title: this.$lang('merch.editGoods')
|
||||
});
|
||||
await this.editGetGoodsInfo();
|
||||
} else {
|
||||
|
||||
this.isAWait = false;
|
||||
uni.setNavigationBarTitle({
|
||||
title: '添加商品'
|
||||
title: this.$lang('merch.addGoods')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ export default {
|
||||
if(res.result.detail){
|
||||
this.goodsData = res.result.detail
|
||||
this.$util.showToast({
|
||||
title: '商品不存在',
|
||||
title: this.$lang('merch.goodsNotExist'),
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_goods/list', {}, 'redirectTo');
|
||||
@@ -265,7 +265,7 @@ export default {
|
||||
this.$forceUpdate();
|
||||
} else {
|
||||
this.$util.showToast({
|
||||
title: '商品不存在',
|
||||
title: this.$lang('merch.goodsNotExist'),
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.$util.redirectTo('/pages_goods/list', {}, 'redirectTo');
|
||||
@@ -493,7 +493,7 @@ export default {
|
||||
addShopCategory() {
|
||||
if (this.shopCategoryNumber == 10) {
|
||||
this.$util.showToast({
|
||||
title: '商品可以属于多个分类,最多10个'
|
||||
title: this.$lang('merch.maxCategoryLimit')
|
||||
});
|
||||
return;
|
||||
}
|
||||
@@ -568,21 +568,21 @@ export default {
|
||||
|
||||
if (this.goodsData.goodsname.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请输入商品名称'
|
||||
title: this.$lang('merch.inputGoodsName')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.goodsData.subtitle.length > 100) {
|
||||
this.$util.showToast({
|
||||
title: '商品简介不能超过100个字符'
|
||||
title: this.$lang('merch.subtitleMaxLength')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (this.goodsData.goods_image.length == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请上传商品图片'
|
||||
title: this.$lang('merch.uploadGoodsImage')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -632,7 +632,7 @@ export default {
|
||||
if (this.goodsData.price == 0) {
|
||||
|
||||
this.$util.showToast({
|
||||
title: '请输入销售价'
|
||||
title: this.$lang('merch.inputPrice')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
@@ -655,26 +655,26 @@ export default {
|
||||
// 总库存
|
||||
if (this.goodsData.total == 0) {
|
||||
this.$util.showToast({
|
||||
title: '请输入库存'
|
||||
title: this.$lang('merch.inputStock')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
if (isNaN(this.goodsData.total) || !this.$util.data().regExp.number.test(this.goodsData.total)) {
|
||||
this.$util.showToast({
|
||||
title: '[库存]格式输入错误'
|
||||
title: this.$lang('merch.stockFormatError')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (isNaN(this.goodsData.goods_start_count) || !this.$util.data().regExp.number.test(this.goodsData.goods_start_count)) {
|
||||
this.$util.showToast({
|
||||
title: '[起售]格式输入错误'
|
||||
title: this.$lang('merch.startCountFormatError')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
if (this.goodsData.goods_start_count < 0) {
|
||||
this.$util.showToast({
|
||||
title: '起售数量不能小于0'
|
||||
title: this.$lang('merch.startCountNotNegative')
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user