Jump to content
Nikersify

Polyglot - yet another Google Translate workflow

Recommended Posts

On 2/21/2018 at 12:35 AM, Nikersify said:

 

Can you send more log output? What's your node.js version?

didn't work at all, type in "trans test",nothing happend, i can find the workflow in the alfred settings

Share this post


Link to post

Hello.

 

Been having trouble w/ this one. I downloaded Node.js and ran "$ npm install --global alfred-polyglot" in Terminal. It seemed like it was doing something and then got the errors below. I'm not sure if I was supposed to, but based on the resulting text below, I then ran: `chsh -s /bin/zsh`

 

If I try to run "$ npm install --global alfred-polyglot" again I get: zsh: command not found: $.

 

As this workflow doesn't show up in Alfred, I don't' know how to debug it.

 

Assuming this doesn't work for me, how do I undo whatever I did in Terminal as well as uninstall Node.js (can I install it in any case or do I need it on my system after the install)?

 

Thanks!

 

Last login: Mon Jan 20 21:16:45 on console

The default interactive shell is now zsh.
To update your account to use zsh, please run `chsh -s /bin/zsh`.
For more details, please visit https://support.apple.com/kb/HT208050.
Foxs-MacBook-Pro:~ fox$ npm I alfred-polyglot

> alfred-polyglot@1.4.0 postinstall /Users/fox/node_modules/alfred-polyglot
> alfy-init

npm WARN saveError ENOENT: no such file or directory, open ‘/Users/fox/package.json’
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open ‘/Users/fox/package.json’
npm WARN fox No description
npm WARN fox No repository field.
npm WARN fox No README data
npm WARN fox No license field.

+ alfred-polyglot@1.4.0
added 238 packages from 86 contributors and audited 462 packages in 25.518s

3 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

Foxs-MacBook-Pro:~ fox$ trans !set default-language (language)
-bash: !set: event not found
Foxs-MacBook-Pro:~ fox$ trans !set default-language (en)
-bash: !set: event not found
Foxs-MacBook-Pro:~ fox$ trans !set default-language (English)
-bash: !set: event not found
Foxs-MacBook-Pro:~ fox$ trans !set default-language (en)
-bash: !set: event not found
Foxs-MacBook-Pro:~ fox$

 

 

 

Share this post


Link to post
2 hours ago, romebot said:

If I try to run "$ npm install --global alfred-polyglot" again I get: zsh: command not found: $.

 

You're just supposed to run npm install --global alfred-polyglot

 

The $ represents your shell prompt. It's a convention to show that "this is a shell command".

 

2 hours ago, romebot said:

As this workflow doesn't show up in Alfred, I don't' know how to debug it.

 

It's not so much a workflow as a Node module that contains a workflow. It won't show up in Alfred if the npm installation doesn't work.

Edited by deanishe

Share this post


Link to post

Hi and thanks! so I did what you said, and it started loading something. and then the terminal says this:

 

Last login: Wed Jan 22 10:01:19 on ttys000
fox@Foxs-MacBook-Pro ~ % $ npm install --global alfred-polyglot
zsh: command not found: $
fox@Foxs-MacBook-Pro ~ % npm install --global alfred-polyglot
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! syscall access
npm ERR! path /usr/local/lib/node_modules
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  [Error: EACCES: permission denied, access '/usr/local/lib/node_modules'] {
npm ERR!   stack: "Error: EACCES: permission denied, access '/usr/local/lib/node_modules'",
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/fox/.npm/_logs/2020-01-22T11_54_44_700Z-debug.log
fox@Foxs-MacBook-Pro ~ %

 

Share this post


Link to post
6 hours ago, romebot said:

npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules

 

You don't have permission to install the Node module. You may have accidentally run npm with admin permissions. Or it might be something to do with Catalina. Don't know.

 

You'll have to ask @Nikersify. He's the expert.

Share this post


Link to post
[~]$ npm install --global alfred-polyglot

> alfred-polyglot@1.4.0 postinstall /usr/local/opt/nvm/current/lib/node_modules/alfred-polyglot
> alfy-init

+ alfred-polyglot@1.4.0
added 238 packages from 86 contributors in 5.207s
[drwatson@zoro](06:36:50)(5.646s)
[~]$ trans !set default-language vietnamese
fish: Unknown command: trans

package.json doesn't even have a "bin" section so how could trans get installed ?

The doc doesn't really explain how the workflow gets installed either. How does this thing work ?

Edited by drwatson

Share this post


Link to post
36 minutes ago, drwatson said:

[~]$ npm install --global alfred-polyglot

> alfred-polyglot@1.4.0 postinstall /usr/local/opt/nvm/current/lib/node_modules/alfred-polyglot
> alfy-init

+ alfred-polyglot@1.4.0
added 238 packages from 86 contributors in 5.207s
[drwatson@zoro](06:36:50)(5.646s)
[~]$ trans !set default-language vietnamese
fish: Unknown command: trans

package.json doesn't even have a "bin" section so how could trans get installed ?

The doc doesn't really explain how the workflow gets installed either. How does this thing work ?

 

type “trans” in alfred not the console bud

Share this post


Link to post
2 hours ago, Nikersify said:

 

type “trans” in alfred not the console bud

 

I had tried that too. but it worked now for some reason. thanks

Share this post


Link to post

I am suffering exactly the same problem. The translation dialogue pops up but when I starting to write my words the google, amazon search suggestions appear. I deactivated the standard translation dialogue and changed the initiation phrase. Nothing helped. Do you have an Idea what I could try? Thanks in advance

Share this post


Link to post
2 hours ago, Bo-Frost-Mann said:

I am suffering exactly the same problem. The translation dialogue pops up but when I starting to write my words the google, amazon search suggestions appear. I deactivated the standard translation dialogue and changed the initiation phrase. Nothing helped. Do you have an Idea what I could try? Thanks in advance

 

do you see the workflow in the workflows tab of your alfred settings?

Share this post


Link to post

thanks for the quick answer.

 

Yes I do and it is also activated. Initially it always looks like everything is working well (when I start the workflow by typing the starting phrase) but when I type the word that should be translated the searches appear.

 

 

Share this post


Link to post
9 minutes ago, Bo-Frost-Mann said:

thanks for the quick answer.

 

Yes I do and it is also activated. Initially it always looks like everything is working well (when I start the workflow by typing the starting phrase) but when I type the word that should be translated the searches appear.

 

 

can you go into the workflow's settings and paste the debug output? you can show the output by clicking this bug icon:

YannkKP.png

Share this post


Link to post
Posted (edited)

Hi, right after I press space after trans it redirects me to google or amazon search... Any ideas on how to fix that? here's the debug:

 

[01:12:32.755] Google Translate[Script Filter] Queuing argument ''
[01:12:33.573] Google Translate[Script Filter] Script with argv '' finished
[01:12:33.574] ERROR: Google Translate[Script Filter] Code 1: {
	"items": [
		{
			"title": "Error: command.match is not a function",
			"subtitle": "Activate this item to try again. | ⌘L to see the stack trace",
			"autocomplete": "",
			"icon": {
				"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
			},
			"valid": false,
			"text": {
				"largetype": "TypeError: command.match is not a function\n    at module.exports (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/lib/index.js:16:15)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:7:21\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:36:3\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:38:3)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:251206)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245054\n    at Generator.next (<anonymous>)\n    at bl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245412)\n    at kl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:247659)\n    at Object.u (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:287740)",
				"copy": "TypeError: command.match is not a function\n    at module.exports (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/lib/index.js:16:15)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:7:21\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:36:3\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:38:3)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:251206)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245054\n    at Generator.next (<anonymous>)\n    at bl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245412)\n    at kl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:247659)\n    at Object.u (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:287740)"
			}
		}
	]
}
{
	"items": [
		{
			"title": "/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:1\nError: EACCES: permission denied, open '/Users/marcosfavero/.config/configstore/google-translate-api.json'\nYou don't have access to this file.\n\n    at Object.openSync (fs.js:461:3)\n    at Object.readFileSync (fs.js:364:35)\n    at Configstore.get (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:35:26)\n    at new Configstore (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:28:45)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/@vitalets/google-translate-token/index.js:70:14)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)",
			"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
			"valid": false,
			"text": {
				"copy": "```\n/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:1\nError: EACCES: permission denied, open '/Users/marcosfavero/.config/configstore/google-translate-api.json'\nYou don't have access to this file.\n    at Configstore.get (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:35:26)\n    at new Configstore (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:28:45)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/@vitalets/google-translate-token/index.js:70:14)\n```\n\n-\nGoogle Translate 1.4.0\nAlfred 4.1\ndarwin 19.5.0",
				"largetype": "/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:1\nError: EACCES: permission denied, open '/Users/marcosfavero/.config/configstore/google-translate-api.json'\nYou don't have access to this file.\n    at Configstore.get (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:35:26)\n    at new Configstore (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:28:45)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/@vitalets/google-translate-token/index.js:70:14)"
			},
			"icon": {
				"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
			}
		}
	]
}
[01:12:33.577] ERROR: Google Translate[Script Filter] JSON error: Garbage at end. in JSON:
{
	"items": [
		{
			"title": "Error: command.match is not a function",
			"subtitle": "Activate this item to try again. | ⌘L to see the stack trace",
			"autocomplete": "",
			"icon": {
				"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
			},
			"valid": false,
			"text": {
				"largetype": "TypeError: command.match is not a function\n    at module.exports (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/lib/index.js:16:15)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:7:21\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:36:3\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:38:3)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:251206)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245054\n    at Generator.next (<anonymous>)\n    at bl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245412)\n    at kl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:247659)\n    at Object.u (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:287740)",
				"copy": "TypeError: command.match is not a function\n    at module.exports (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/lib/index.js:16:15)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:7:21\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:36:3\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/index.js:38:3)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:251206)\n    at /usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245054\n    at Generator.next (<anonymous>)\n    at bl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:245412)\n    at kl (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:247659)\n    at Object.u (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/esm/esm.js:1:287740)"
			}
		}
	]
}
{
	"items": [
		{
			"title": "/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:1\nError: EACCES: permission denied, open '/Users/marcosfavero/.config/configstore/google-translate-api.json'\nYou don't have access to this file.\n\n    at Object.openSync (fs.js:461:3)\n    at Object.readFileSync (fs.js:364:35)\n    at Configstore.get (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:35:26)\n    at new Configstore (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:28:45)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/@vitalets/google-translate-token/index.js:70:14)\n    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1220:10)",
			"subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
			"valid": false,
			"text": {
				"copy": "```\n/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:1\nError: EACCES: permission denied, open '/Users/marcosfavero/.config/configstore/google-translate-api.json'\nYou don't have access to this file.\n    at Configstore.get (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:35:26)\n    at new Configstore (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:28:45)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/@vitalets/google-translate-token/index.js:70:14)\n```\n\n-\nGoogle Translate 1.4.0\nAlfred 4.1\ndarwin 19.5.0",
				"largetype": "/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:1\nError: EACCES: permission denied, open '/Users/marcosfavero/.config/configstore/google-translate-api.json'\nYou don't have access to this file.\n    at Configstore.get (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:35:26)\n    at new Configstore (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/configstore/index.js:28:45)\n    at Object.<anonymous> (/usr/local/Cellar/node/14.4.0/lib/node_modules/alfred-polyglot/node_modules/@vitalets/google-translate-token/index.js:70:14)"
			},
			"icon": {
				"path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
			}
		}
	]
}

 

Edited by favero_
Correct code

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...