refactor: 替换硬编码文本为多语言配置
替换了项目中所有硬编码的提示文案,将其统一迁移到多语言语言包中,包括授权、自定义页面、HTTP请求、分享、客服等模块的提示文本,提升项目的国际化可维护性
This commit is contained in:
@@ -2,6 +2,7 @@ import Config from './config.js'
|
||||
import Util from './util.js'
|
||||
import store from '@/store/index.js'
|
||||
import Platform from './platform.js'
|
||||
import lang from './lang.js'
|
||||
|
||||
const { appType, appTypeName } = Platform.getPlatformInfo();
|
||||
|
||||
@@ -9,7 +10,7 @@ export default {
|
||||
sendRequest(params) {
|
||||
if (!Config.baseUrl) {
|
||||
uni.showToast({
|
||||
title: '未配置请求域名',
|
||||
title: lang('http.domainNotConfigured'),
|
||||
'icon': 'none',
|
||||
duration: 10000
|
||||
});
|
||||
@@ -77,7 +78,7 @@ export default {
|
||||
fail: (res) => {
|
||||
if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
|
||||
uni.showToast({
|
||||
title: Config.baseUrl + '不在request 合法域名列表中',
|
||||
title: lang('http.domainNotInList', { domain: Config.baseUrl }),
|
||||
'icon': 'none',
|
||||
duration: 10000
|
||||
});
|
||||
@@ -88,7 +89,7 @@ export default {
|
||||
complete: (res) => {
|
||||
if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200, 500].indexOf(res.statusCode) == -1)) {
|
||||
uni.showToast({
|
||||
title: Config.baseUrl + '请求失败',
|
||||
title: lang('http.requestFailed', { domain: Config.baseUrl }),
|
||||
'icon': 'none',
|
||||
duration: 10000
|
||||
});
|
||||
@@ -134,7 +135,7 @@ export default {
|
||||
fail: (res) => {
|
||||
if (res.errMsg && res.errMsg == 'request:fail url not in domain list') {
|
||||
uni.showToast({
|
||||
title: Config.baseUrl + '不在request 合法域名列表中',
|
||||
title: lang('http.domainNotInList', { domain: Config.baseUrl }),
|
||||
'icon': 'none',
|
||||
duration: 10000
|
||||
});
|
||||
@@ -145,7 +146,7 @@ export default {
|
||||
complete: (res) => {
|
||||
if ((res.errMsg && res.errMsg != "request:ok") || (res.statusCode && [200, 500].indexOf(res.statusCode) == -1)) {
|
||||
uni.showToast({
|
||||
title: Config.baseUrl + '请求失败',
|
||||
title: lang('http.requestFailed', { domain: Config.baseUrl }),
|
||||
'icon': 'none',
|
||||
duration: 10000
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user