Code Monkey home page Code Monkey logo

Comments (8)

PerfectSlayer avatar PerfectSlayer commented on May 21, 2024

Isn't the same as #16 ?

from gtranslate.

mote0230 avatar mote0230 commented on May 21, 2024

yes it seems there is overlap

from gtranslate.

z87 avatar z87 commented on May 21, 2024

Using this crude fix atm to show more translations:
\resources\gtranslate\lib\providers\google-translate.js at line 26

  const translation = (
    result[1] ? result[1].map(chunk => chunk[0] + ': ' + chunk[1].join(', ')).join('; ') : 
    result[0] && result[0].map(chunk => chunk[0]).join(' ')
  ) || null

The result is like noun: noun1, noun2; verb: verb1, verb2

from gtranslate.

mote0230 avatar mote0230 commented on May 21, 2024

created a new branch: https://github.com/bpierre/gtranslate/tree/dictionary
6e5538e
For now alternative translations are implemented, but:
-should we show a sign in the non-mouseover text to show there is more in the mouseover?
-should we limit the amount of alternatives? How? The mouseover text can get quite large.
-The text column align didn't work as well as expected

from gtranslate.

bpierre avatar bpierre commented on May 21, 2024

@mote0230 I am just trying, that’s great!

-should we show a sign in the non-mouseover text to show there is more in the mouseover?

To indicate that we are in single word mode, maybe we could take the most popular one and display it directly in the menuitem:

maison (noun, synonyms: maison, chambre, famille…)

-should we limit the amount of alternatives? How? The mouseover text can get quite large.
-The text column align didn't work as well as expected

Yes tooltips are really limited to format text, and highly depend on the OS. Maybe we could limit the alternatives to 10 or something like that, and each alternative to 10 words max.

from gtranslate.

mote0230 avatar mote0230 commented on May 21, 2024

Looks like I'm not the only one who's "test word" is house ;)
For limiting to 10, map() doesn't support continue and break, so I think I would have to change it to use for loops, or do you know of a more functional style way to do this?

from gtranslate.

bpierre avatar bpierre commented on May 21, 2024

You could use sort() to order the results, then slice(). You may have to associate the groups (noun, adjective) with each result before doing that, depending on how the data is structured. I am also OK with a for loop (you can use for…of in Firefox).

Looks like I'm not the only one who's "test word" is house ;)

Yes it’s from your example ;-)

from gtranslate.

bpierre avatar bpierre commented on May 21, 2024

🆒 https://github.com/bpierre/gtranslate/releases/tag/v0.12.0

from gtranslate.

Related Issues (20)

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.