Comments (4)
Hi alvapatrice, I just force build and its passing the tests. Maybe its something with your implementation. Can you give me more details in how you're working with that?
from node-google-translate-skidz.
here are the source code
'use strict';
Object.defineProperty(exports, "__esModule", {
value: true
});
var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };
var _vuex = require('vuex');
var _nodeGoogleTranslateSkidz = require('node-google-translate-skidz');
var _nodeGoogleTranslateSkidz2 = _interopRequireDefault(_nodeGoogleTranslateSkidz);
var _languages = require('../utils/languages');
var _languages2 = _interopRequireDefault(_languages);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = {
template: '
data: function data() {
return {
sourceText: '',
targetText: '',
languages: _languages2.default,
sourceSelectedLang: 'en',
targetSelectedLang: 'tr',
transLoader: false
};
},
methods: {
translate: function translate() {
var _this = this;
if (this.sourceText) {
this.transLoader = true;
try {
(0, _nodeGoogleTranslateSkidz2.default)({
text: this.sourceText,
source: this.sourceSelectedLang,
target: this.targetSelectedLang
}, function (result) {
if (result.translation) {
_this.targetText = result.translation;
_this.transLoader = false;
} else _this.transLoader = false;
});
} catch (error) {
this.transLoader = false;
}
}
},
switchLangs: function switchLangs() {
var temp = this.sourceSelectedLang;
this.sourceSelectedLang = this.targetSelectedLang;
this.targetSelectedLang = temp;
temp = this.sourceText;
this.sourceText = this.targetText;
this.targetText = temp;
},
clearText: function clearText() {
this.sourceText = this.targetText = '';
}
},
computed: _extends({}, (0, _vuex.mapGetters)({
showTranslate: 'showTranslate'
}))
};
I think there is no usage mistake.
from node-google-translate-skidz.
while trying to find where the problem is, I have tried to to make a request on the API url used in your lib/translate.js using Postman.
So can you figure out where should be the source of the problem? For me I think as long as with postman its self can't get a valid response, the API url might have a problem.
from node-google-translate-skidz.
@alvapatrice you're using old library version, please update to 1.1.1 in your package.json
from node-google-translate-skidz.
Related Issues (14)
- Library name changed on npm? HOT 1
- Too restrictive? Return additional info from google?
- Error: Couldn't retrieve a valid JSON response. Perhaps the API has changed, please let us know.
- Offline supprt HOT 1
- new version with request not uploaded to npm
- Proxy support?
- Unable to translate not-default text HOT 2
- Perhaps the API has changed, please let us know: Different results on different machines HOT 3
- Add TypeScript definitions
- Problem with japanese strings HOT 7
- Problem with Chinese text HOT 2
- Does not work anymore? HOT 4
- Promise support?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-google-translate-skidz.