We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const translate = require('translate-api'); let transText = 'hello world'; translate.getText(transText, { to: 'en' }).then(function(text) { console.log(text) }).catch(err => { console.log(err) // {Error code: 'BAD_NETWORK' } });
真实错误信息是
TypeError: Cannot read property '0' of null
api.js修改成这样就好了
// if (body[5] !== undefined && body[5][0] !== undefined && body[5][0][0] !== undefined) { if (body[5] && body[5][0] && body[5][0][0]) { let str = body[5][0][0]; str = str.replace(/<b><i>/g, '['); str = str.replace(/<\/i><\/b>/g, ']'); result.from.text.value = str; if (body[5][0][5] === 1) { result.from.text.autoCorrected = true; } else { result.from.text.didYouMean = true; } }
直接判断是否存在就可以
The text was updated successfully, but these errors were encountered:
No branches or pull requests
真实错误信息是
api.js修改成这样就好了
直接判断是否存在就可以
The text was updated successfully, but these errors were encountered: