DEV Community

zupffwhy
zupffwhy

Posted on • Updated on

Talk about Yet another dictionary look up and text translator – Extension for 🦊 Firefox

Talk about Yet another dictionary look up and text translator – Get this Extension for 🦊 Firefox.
Yet another dictionary look up and text translatorに぀いて話す。

If you post JSON codes, please surround the codes with "```json" and "```".
JSONγ‚³γƒΌγƒ‰γ‚’γƒγ‚Ήγƒˆγ™γ‚‹ε ΄εˆγ―γ€γ‚³γƒΌγƒ‰γ‚’ ```json と ``` で囲む。

Example δΎ‹:
Source γ‚½γƒΌγ‚Ή

```json
{
    "name": "Google translate",
    "url": "translate.google.com/#view=home&op...",
    "tooltip": true,
    "action": "fetch",
    "viewin": "tooltip"
}
```

Result 葨瀺

{
    "name": "Google translate",
    "url": "translate.google.com/#view=home&op...",
    "tooltip": true,
    "action": "fetch",
    "viewin": "tooltip"
}
Enter fullscreen mode Exit fullscreen mode

Top comments (2)

Collapse
 
ig8r profile image
iG8R • Edited

Hi.

Could you, please, help me to resolve an issue which I've stumble with?
I added the following service:
{
"name": "Google translate",
"url": "translate.google.com/#view=home&op...",
"tooltip": true,
"action": "fetch",
"viewin": "tooltip"
}
But all I get is a tooltip with only a header of the Google Translate page :(

And one more question, is it possible to make a service for Google Translate which allows to listen pronunciation of the selected word or phrase without showing tooltip but only when clicking on a bubbletip?
I've tried using the following URL:
translate.google.com/translate_tts...
But it didn't work at all.

Best regards,
Igor.

Collapse
 
zupffwhy profile image
zupffwhy • Edited

Google translation doesn't work with fetch because the translation is fetched by JavaScript after displaying the page. Using this add-on requires some knowledge of the behavior of the page. So it would be better to display Google translations in the browser panel. Or if you set the action to direct, it will work. For Google translation, it is more convenient to get the JSON and display it in a tooltip than to use the URL. An example is provided in the documentation for this.
Regarding the second question, it is not possible to play audio without displaying it anywhere with this add-on. I think other add-ons probably add audio elements to the page as invisible elements and play the audio. It is possible to add that feature to this add-on if you pay for the development costs. ;-)