akvedi / lexicon

An efficiant Dictionary add-on. Double-click any word and instantly view its definition in a pop-up bubble
GNU General Public License v3.0
8 stars 0 forks source link

Definition problem occurs when a word with similar spelling is found in two different languages #15

Closed akvedi closed 4 months ago

akvedi commented 4 months ago

11

For example, the word 'site' exists in both French and English, but no definition is available in French. I think it comes from the fetching url: https://www.google.com/search?hl=${lang}&q=define+${word.replace(/·/g, '')}&gl=${countryCode} In this url, the word 'define' is in English. If you add some code to the 'background.js' file, as you did for the Hindi language:

if (lang == "fr"){ return url = https://www.google.com/search?hl=${lang}&q=définir+${word.replace(/·/g, '')}&gl=${countryCode}; }

the French definition of the word site is then found. I think this addition should be made for all supported languages (en, fr, de, es, pt, pt-br).

akvedi commented 4 months ago

Fixed in v1.5.5