提交 867b3c6d 编写于 作者: Q qiang

fix: 修改部分中文报错信息

上级 0be095bf
......@@ -20,9 +20,9 @@ export function getProvider ({
isFn(success) && success(res)
} else {
res = {
errMsg: 'getProvider:fail:服务[' + service + ']不存在'
errMsg: 'getProvider:fail service not found'
}
isFn(fail) && fail(res)
}
isFn(complete) && complete(res)
}
}
......@@ -19,7 +19,7 @@ function createTodoApi (name) {
complete
}) {
const res = {
errMsg: `${name}:fail:暂不支持 ${name} 方法`
errMsg: `${name}:fail method '${name}' not supported`
}
isFn(fail) && fail(res)
isFn(complete) && complete(res)
......
......@@ -35,7 +35,7 @@ function processArgs (methodName, fromArgs, argsOption = {}, returnValue = {}, k
keyOption = keyOption(fromArgs[key], fromArgs, toArgs)
}
if (!keyOption) { // 不支持的参数
console.warn(`__PLATFORM_TITLE__ ${methodName}暂不支持${key}`)
console.warn(`The '${methodName}' method of platform '__PLATFORM_TITLE__' does not support option '${key}'`)
} else if (isStr(keyOption)) { // 重写参数 key
toArgs[keyOption] = fromArgs[key]
} else if (isPlainObject(keyOption)) { // {name:newName,value:value}可重新指定参数 key:value
......@@ -70,7 +70,7 @@ export default function wrapper (methodName, method) {
const protocol = protocols[methodName]
if (!protocol) { // 暂不支持的 api
return function () {
console.error(`__PLATFORM_TITLE__ 暂不支持${methodName}`)
console.error(`Platform '__PLATFORM_TITLE__' does not support '${methodName}'.`)
}
}
return function (arg1, arg2) { // 目前 api 最多两个参数
......@@ -98,4 +98,4 @@ export default function wrapper (methodName, method) {
}
}
return method
}
}
......@@ -226,9 +226,7 @@ function checkColor (e) {
a = a >= 0 ? a : 255
return [n, o, r, a]
}
console.group('非法颜色: ' + e)
console.error('不支持颜色:' + e)
console.groupEnd()
console.error('unsupported color:' + e)
return [0, 0, 0, 255]
}
......
......@@ -27,5 +27,5 @@ onMethod('onUIStyleChange', function (res) {
export function onUIStyleChange (callbackId) {
callbacks.push(callbackId)
console.log('API uni.onUIStyleChange 已过时,请使用 uni.onThemeChange,详情:https://uniapp.dcloud.net.cn/api/system/theme')
console.warn('The "uni.onUIStyleChange" API is deprecated, please use "uni.onThemeChange". Learn more: https://uniapp.dcloud.net.cn/api/system/theme.')
}
......@@ -69,11 +69,11 @@ class LivePusherContext {
export function createLivePusherContext (id, vm) {
if (!vm) {
return console.warn('uni.createLivePusherContext 必须传入第二个参数,即当前 vm 对象(this)')
return console.warn('uni.createLivePusherContext: 2 arguments required, but only 1 present')
}
const elm = findElmById(id, vm)
if (!elm) {
return console.warn('Can not find `' + id + '`')
}
return new LivePusherContext(id, elm)
}
}
......@@ -17,7 +17,7 @@ export function openDocument ({
})
}, err => {
invoke(callbackId, {
errMsg: 'openDocument:fail 文件[' + filePath + ']读取失败:' + err.message
errMsg: 'openDocument:fail ' + err.message
})
})
}
......@@ -53,14 +53,14 @@ const Recorder = {
pause () {
if (recorder) {
publishRecorderStateChange('error', {
errMsg: '暂不支持录音pause操作'
errMsg: 'Unsupported operation: pause'
})
}
},
resume () {
if (recorder) {
publishRecorderStateChange('error', {
errMsg: '暂不支持录音resume操作'
errMsg: 'Unsupported operation: resume'
})
}
}
......
......@@ -70,7 +70,7 @@ export function getProvider ({
})
} else {
invoke(callbackId, {
errMsg: 'getProvider:fail 服务[' + service + ']不支持'
errMsg: 'getProvider:fail service not found'
})
}
}
......@@ -16,7 +16,7 @@ export function requestPayment (params, callbackId) {
}) => id === provider)
if (!service) {
invoke(callbackId, {
errMsg: 'requestPayment:fail 支付服务[' + provider + ']不存在'
errMsg: 'requestPayment:fail service not found'
})
} else {
plus.payment.request(service, params.orderInfo, res => {
......
......@@ -154,7 +154,7 @@ export function share (params, callbackId, method = 'share') {
}) => id === provider)
if (!service) {
invoke(callbackId, {
errMsg: method + ':fail 分享服务[' + provider + ']不存在'
errMsg: method + ':fail service not found'
})
} else {
if (service.authenticated) {
......
......@@ -57,7 +57,7 @@ export function getApp ({
return defaultApp
}
console.error(
'[warn]: getApp() 操作失败,v3模式加速了首页 nvue 的启动速度,当在首页 nvue 中使用 getApp() 不一定可以获取真正的 App 对象。详情请参考:https://uniapp.dcloud.io/collocation/frame/window?id=getapp'
'[warn]: getApp() failed. Learn more: https://uniapp.dcloud.io/collocation/frame/window?id=getapp.'
)
}
......@@ -236,4 +236,4 @@ export function registerApp (appVm) {
__uniConfig.ready = true
process.env.NODE_ENV !== 'production' && perf('registerApp')
}
}
......@@ -23,7 +23,7 @@ export function navigate (path, callback, isAppLaunch) {
plus.navigator.closeSplashscreen()
}
if (!isAppLaunch && todoNavigator) {
return console.error(`已存在待跳转页面${todoNavigator.path},请不要连续多次跳转页面${path}`)
return console.error(`Waiting to navigate to: ${todoNavigator.path}, do not operate continuously: ${path}.`)
}
if (__uniConfig.renderer === 'native') { // 纯原生无需wait逻辑
// 如果是首页还未初始化,需要等一等,其他无需等待
......@@ -88,4 +88,4 @@ export function navigateFinish () {
? todoNavigator.navigate()
: registerWebviewReady(preloadWebview.id, todoNavigate)
}
}
}
......@@ -29,8 +29,8 @@ export function consumePlusMessage (type, args) {
*/
export function registerPlusMessage (type, callback, keepAlive = true) {
if (callbacks[type]) {
return console.warn(`${type} 已注册:` + (callbacks[type].toString()))
return console.warn(`'${type}' registered: ` + (callbacks[type].toString()))
}
callback.keepAlive = !!keepAlive
callbacks[type] = callback
}
}
......@@ -72,7 +72,7 @@ function initSubNVue (subNVue, routeOptions, webview) {
delete style.type
if (isPopup && !subNVue.id) {
console.warn('subNVue[' + subNVue.path + '] 尚未配置 id')
console.warn('subNVue[' + subNVue.path + '] is missing id')
}
// TODO lazyload
......
......@@ -17,9 +17,7 @@ export function getFileInfo ({
})
}).catch((err) => {
invoke(callbackId, {
errMsg: 'getFileInfo:fail 文件[' +
filePath +
'] getFileInfo 失败:' + err.message
errMsg: 'getFileInfo:fail ' + err.message
})
})
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册