xfslove / alfred-google-translate

Alfred 3 workflow - translate with google api💵🚫
MIT License
619 stars 65 forks source link

Doesn't seem to work with Hebrew #53

Open kyrsquir opened 4 years ago

kyrsquir commented 4 years ago

Try it on any Hebrew word, for example "ברוך"

xfslove commented 4 years ago

please try with trc iw&en. it seems he no working again.

kyrsquir commented 4 years ago

Won't work for me. While it is configured to iw or he it behaves as if it encounters an error and crashes internally every time a translation is attempted. It won't show any results even when trying to translate an untranslatable special character like ✟ (which works if set to any other language).

xfslove commented 4 years ago

would you please paste the version of the node, alfred, workflow?

and if the workflow shown any errors paste the stack trace too.

kyrsquir commented 4 years ago

Node 12.13.0 Alfred 4.0.7 Workflow - main 2.0.8 and config 1.0.4

Also noticed that configured language doesn't matter, it crashes on Hebrew words even when other languages are set.

[06:23:54.082] ERROR: Google Translate (no Hebrew)[Script Filter] Code 1: {
    "items": [
        {
            "title": "העדפת",
            "subtitle": "Phonetic: ",
            "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=iw&tl=en&text=%D7%94%D7%A2%D7%93%D7%A4%D7%AA",
            "arg": "/var/folders/x7/kgxp3j9j5rx70lpkb0ls4jzr0000gn/T/706b175a-fb56-4246-8834-b1c35c9dbc60.mp3",
            "text": {
                "copy": "העדפת",
                "largetype": "העדפת"
            },
            "icon": {
                "path": "tts.png"
            }
        },
        {
            "title": "Preference",
            "subtitle": "Phonetic: ",
            "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=en&tl=iw&text=Preference",
            "arg": "/var/folders/x7/kgxp3j9j5rx70lpkb0ls4jzr0000gn/T/d2ff3cdc-79ed-4133-a562-a1dae8a6a75e.mp3",
            "text": {
                "copy": "Preference",
                "largetype": "Preference"
            },
            "icon": {
                "path": "tts.png"
            }
        }
    ]
}
{
    "items": [
        {
            "title": "HTTPError: Response code 404 (Not Found)\nUrl: https://translate.google.com/translate_tts?client=gtx&tl=iw&ie=UTF-8&idx=0&total=1&textlen=5&q=%D7%94%D7%A2%D7%93%D7%A4%D7%AA&tk=701164.793847\n    at /usr/local/lib/node_modules/alfred-google-translate/node_modules/got/index.js:123:13\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)",
            "subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
            "valid": false,
            "text": {
                "copy": "```\nHTTPError: Response code 404 (Not Found)\nUrl: https://translate.google.com/translate_tts?client=gtx&tl=iw&ie=UTF-8&idx=0&total=1&textlen=5&q=%D7%94%D7%A2%D7%93%D7%A4%D7%AA&tk=701164.793847\n    at /usr/local/lib/node_modules/alfred-google-translate/node_modules/got/index.js:123:13\n```\n\n-\nGoogle Translate (no Hebrew) 2.0.8\nAlfred 4.0.7\ndarwin 18.7.0",
                "largetype": "HTTPError: Response code 404 (Not Found)\nUrl: https://translate.google.com/translate_tts?client=gtx&tl=iw&ie=UTF-8&idx=0&total=1&textlen=5&q=%D7%94%D7%A2%D7%93%D7%A4%D7%AA&tk=701164.793847\n    at /usr/local/lib/node_modules/alfred-google-translate/node_modules/got/index.js:123:13"
            },
            "icon": {
                "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
            }
        }
    ]
}
[06:23:54.087] ERROR: Google Translate (no Hebrew)[Script Filter] JSON error: Garbage at end. in JSON:
{
    "items": [
        {
            "title": "העדפת",
            "subtitle": "Phonetic: ",
            "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=iw&tl=en&text=%D7%94%D7%A2%D7%93%D7%A4%D7%AA",
            "arg": "/var/folders/x7/kgxp3j9j5rx70lpkb0ls4jzr0000gn/T/706b175a-fb56-4246-8834-b1c35c9dbc60.mp3",
            "text": {
                "copy": "העדפת",
                "largetype": "העדפת"
            },
            "icon": {
                "path": "tts.png"
            }
        },
        {
            "title": "Preference",
            "subtitle": "Phonetic: ",
            "quicklookurl": "https://translate.google.com/#view=home&op=translate&sl=en&tl=iw&text=Preference",
            "arg": "/var/folders/x7/kgxp3j9j5rx70lpkb0ls4jzr0000gn/T/d2ff3cdc-79ed-4133-a562-a1dae8a6a75e.mp3",
            "text": {
                "copy": "Preference",
                "largetype": "Preference"
            },
            "icon": {
                "path": "tts.png"
            }
        }
    ]
}
{
    "items": [
        {
            "title": "HTTPError: Response code 404 (Not Found)\nUrl: https://translate.google.com/translate_tts?client=gtx&tl=iw&ie=UTF-8&idx=0&total=1&textlen=5&q=%D7%94%D7%A2%D7%93%D7%A4%D7%AA&tk=701164.793847\n    at /usr/local/lib/node_modules/alfred-google-translate/node_modules/got/index.js:123:13\n    at processTicksAndRejections (internal/process/task_queues.js:93:5)",
            "subtitle": "Press ⌘L to see the full error and ⌘C to copy it.",
            "valid": false,
            "text": {
                "copy": "```\nHTTPError: Response code 404 (Not Found)\nUrl: https://translate.google.com/translate_tts?client=gtx&tl=iw&ie=UTF-8&idx=0&total=1&textlen=5&q=%D7%94%D7%A2%D7%93%D7%A4%D7%AA&tk=701164.793847\n    at /usr/local/lib/node_modules/alfred-google-translate/node_modules/got/index.js:123:13\n```\n\n-\nGoogle Translate (no Hebrew) 2.0.8\nAlfred 4.0.7\ndarwin 18.7.0",
                "largetype": "HTTPError: Response code 404 (Not Found)\nUrl: https://translate.google.com/translate_tts?client=gtx&tl=iw&ie=UTF-8&idx=0&total=1&textlen=5&q=%D7%94%D7%A2%D7%93%D7%A4%D7%AA&tk=701164.793847\n    at /usr/local/lib/node_modules/alfred-google-translate/node_modules/got/index.js:123:13"
            },
            "icon": {
                "path": "/System/Library/CoreServices/CoreTypes.bundle/Contents/Resources/AlertStopIcon.icns"
            }
        }
    ]
}
xfslove commented 4 years ago

I saw that, its the tts problem. I'll take a look.

you could config the voice:none temporarily.

kyrsquir commented 4 years ago

That worked, thanks!

Is there a way to disable it only for Hebrew? Instant voice is one of the best features of this workflow :)

xfslove commented 4 years ago

perhaps no. sorry for that. but I'll fix this as soon as possible.

xfslove commented 4 years ago

I found that the Google not support Hebrew voice. look at this:

1

I'll find a way to give tips on workflow.

xfslove commented 4 years ago

Remark: I'm not sure which field of response body represents the voice available or not.

udiNur commented 3 years ago

there is any update?

xfslove commented 3 years ago

there is any update?

Sorry, Not yet.