Code Monkey home page Code Monkey logo

Comments (4)

statickidz avatar statickidz commented on June 22, 2024

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.

alvapatrice avatar alvapatrice commented on June 22, 2024

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: '

\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t {{lang.text}} \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<button id="switch-languages" title="Switch Languages" @click="switchLangs">\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t {{lang.text}} \n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t<textarea v-model="sourceText" placeholder="Source Text" maxlength="1000" @keyup.enter="translate"></textarea>\n\t\t\t\t\t\t\t\t\t {{ sourceText.length }} / 1000 \n\t\t\t\t\t\t\t\t\t<textarea v-model="targetText" placeholder="Target Text">{{targetText}}</textarea>\n\t\t\t\t\t\t\t\t\t<button id="clear-translate-btn" class="fl" @click="clearText">Clear\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t<button id="translate-btn" class="fr royal" @click="translate">Translate',
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.

alvapatrice avatar alvapatrice commented on June 22, 2024

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.

  1. here is my post request header
    image2

  2. Here is the body part
    image3

  3. And it returns the not found error
    image1

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.

statickidz avatar statickidz commented on June 22, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.