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
5 stars 0 forks source link

Proposal for localization and other comments #11

Open DenB10 opened 2 weeks ago

DenB10 commented 2 weeks ago

@akvedi

Hi Aaditya

As promised, I'm sending you my Lexicon localization proposal. For html files, I've used the TinyWebEx Localizer. I've based Lexicon on version 1.3.0 online on AMO and haven't taken into account the few modifications you made on Github last month. Two locales are currently available: "en" and "fr". I'm giving it to you as a zip file and not as a pull request because I'm not comfortable with that. I hope it works out, take a look:

lexicon-1.3.0-mod.zip

In the course of this work, I've put this extension through its paces, and have a few comments to make if you like.

First a list of what I consider to be anomalies.

  1. Trigger action option " Highlight and right click" For a long time I wondered what this option meant. I first expected that selecting a word and right-clicking would trigger a search for the word's definition. Eventually I realized that right-clicking normally opens the browser's context menu, and that I should then choose the menu item "Look up ... in Dictionary". Am I correct? If so, why does this menu item also appear in the context menu along with the other trigger actions? Either the right-click choice option serves no purpose and should be removed from the select box, or only this option should make the context menu item appear. My humble opinion: rename the "Hightlight and right click" trigger option to "Use the context menu item" and make this the only option that brings up the context menu item.
  2. "Longest Word" in the toolbar button pop-up panel The previous longest word remains in storage after the history has been cleared, which makes no sense since the history is empty. I've taken the liberty of adding a line to the options.js file so that the longest word is also removed from storage.

At the same time, I have a few requests for improvement:

  1. Currently, the "Look up in Dictionary" context menu item accepts the selection of several words, and this is the case, no definition is of course found. It would be nice if this menu item only appeared if only one word was selected, or if an error message indicated that only one word should be selected.
  2. Implement the dark theme for the personal dictionary page and the toolbar button pop-up panel
  3. Add an "Auto" or "System" option for theme selection This option allows you to follow the theme chosen for the browser. Explanation: I'm currently using the Dark Reader extension with day-night automation. It would be nice if Lexicon could automatically switch its theme according to the browser theme.

I hope I haven't been too annoying with my comments. Greetings,

@DenB10

DenB10 commented 2 weeks ago

@akvedi

No reply to my previous message?

Nevertheless, I'm sending you a second version of my zip with the implementation of the dark theme and the system theme for all views (popup, personal dictionary and options). lexicon-1.3.0-mod.zip

Wishing you good reception!

DenB

akvedi commented 1 week ago

Hi @DenB10,

I am sorry for not replying earlier.

Thank you so much for testing this extension and for taking the time to report the issue and even fix it yourself. I truly appreciate it. Also, big thanks for adding localization and dark mode. I'll include these in the next update.

Regarding the "Highlight and right click" option in the trigger action menu, you're right—it is confusing and needs a name change. However, I believe it shouldn't be removed or only appear when the trigger action is set to "Highlight and Right Click".

There are words that are separated but need to be selected together to make sense, like "Right Click" or "Look Up". Double-clicking to select these words isn't possible. In such cases, having the option of using the context menu along with other triggers is very convenient.

I think renaming it to something like "Context Menu Only" would be helpful. This would clarify that selecting this option will only trigger the definition via the context menu.

DenB10 commented 1 week ago

@akvedi

Thank you for your reply.

I understand your clearly justified opinion about the "Highlight and right click" trigger action. As you say, the solution is certainly to rename it to make it more understandable.

akvedi commented 6 days ago

Added dark mode and system option in v1.4.0. Will add localization in next update.

DenB10 commented 6 days ago

On, no problem but about the issue https://github.com/akvedi/lexicon/issues/10 which is really very annoying?

akvedi commented 6 days ago

"Yeah, I've found the problem and I'm working on it. Will update it in a few days. Also, could you please take a moment to review the extension on the add-on page? I'm hoping to get it recommended by Firefox to help more people discover it. Just put in the request today, so let's see how it goes."

DenB10 commented 5 days ago

I don't mind writing a review on AMO, but I don't see how it serves your goal of getting Firefox's recommendation?

On the other hand, I think Lexikon still needs improvement. I'm doing a lot of testing, and there are a few things that bother me about language management.

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). What's your opinion?

A question: what's the purpose of 'CountryCode', since Google always returns 'gl=undefined' in the url when the 'More' button is pressed?

Then, in version 1.4.0, you added the language selector at the bottom of the definition popup. It's a good idea if you want to search in another language. But once you've searched in another language, the selector always returns to the default language chosen in the options. This is annoying because you can't search for the same word in the default language from the selector, unless you double-click the word again. What's more, when you listen to the pronunciation of the word, the two voices overlap. Moreover, this word is only memorized once in the history: in the first language. Wouldn't it be nice if it appeared twice?

This brings me to a comment about the history (personal dictionary). It works on an all-or-nothing basis. You can't choose which words are to appear in it, nor can you delete a single word, which, in my opinion, is a hindrance to its use. I've tested other 'Dictionary Anywhere' forks. Yours is the best, which is why I chose it. But another has implemented the ability to choose what the personal dictionary can contain. It's called Dictionary Plus.

These few comments are only intended to help improve Lexikon.

akvedi commented 4 days ago

Hey @DenB10 thanks for the feedback. You are right it need a lot of improvement but for me it is really harder to find out what to improve than actually improving it 😀.

And about the define word. I too think it would be better to change it depending on the language. Will add it in next update.

Meanwhile fixed the voice overlap, language switcher and more link problem. Personal dictionary and other improvements need some big changes so will take longer to be fixed.

I personally use this extension a lot and I want to improve it as much as possible. Just keep the feedback coming really appreciate all the effort you did to find these bugs.

DenB10 commented 4 days ago

@akvedi Thank you for your responsiveness. The bugs (voice overlap, language switcher, more link) I mentioned seem to be solved but it is difficult to test many times in a row because of Google blocking access with the message: Our systems have detected unusual traffic from your computer network...

The most important thing is that things are moving in the right direction and improvements will come gradually as you seem motivated to do so. For my part, I'd like to make more contributions to the code, but I can't, I'm just a nosy translator :wink: But you can count on me to test future releases if you like.

Edit: I answered a little too quickly. Bugs remain in version 1.5.0.

  1. The language selector still has a bug. It remains set to the last selected language when searching for a new word, whereas it should return to the default language (set in the options).
  2. There's no voice overlay anymore, but 'autoplay pronunciation' doesn't work at all now. What's more, it's not reset to 'false' when you reset the options (easy to fix).
akvedi commented 3 days ago

Great to hear 😃 just keep testing, finding bugs and suggesting improvements. Also keep recommending to others.

The google problem currently has no solution until there is a backend server. But it happen rarely and only if you look up a lot of words than you do regularly.

Also The autoplay problem has been fixed.

And about the language selector bug I think it's not a bug but a feature. I call it language persistence. It is page specific and remembers the switched language of the current page until the page is refreshed. You see whenever I switch language on any page for example from English to Spanish there is a good chance that the page is in Spanish. Now if I look up another word on the same page I do not have to switch the language again and again. What do you think?

DenB10 commented 2 days ago

@akvedi

The google problem currently has no solution until there is a backend server. But it happen rarely and only if you look up a lot of words than you do regularly.

Yes, I know, but it's a pain in the ass during a mass test.

Also The autoplay problem has been fixed.

It's working fine now, thanks! Note: it's also good to have added the word's part of speech (noun, adjective, ...)

And about the language selector bug I think it's not a bug but a feature. I call it language persistence. It is page specific and remembers the switched language of the current page until the page is refreshed. You see whenever I switch language on any page for example from English to Spanish there is a good chance that the page is in Spanish. Now if I look up another word on the same page I do not have to switch the language again and again. What do you think?

Your explanation convinced me :wink:

Greetings,

@DenB10

DenB10 commented 1 day ago

@akvedi

I post my remarks and ideas in this thread, but perhaps I should open a new one? Tell me what you prefer.

Again, I have two comments to make:

  1. Currently, the definitions popup is closed by clicking on the page. Perhaps a close button would be nice?
  2. When a word is added to the word history and the personal dictionary tab is already open, it is not updated. Is it possible for it to be updated automatically? Or does a warning message appear asking you to reload it manually?

@DenB10

akvedi commented 14 hours ago

There is new discussion panel. It would be better to discuss thing there and then open an issue if needed.

Also thanks for these suggestions.

Yes it is possible to add new words without a page refresh. Will add it in the next update. For now added a popup asking to refresh the page when the new words are saved. Also improved the UI a little bit and added a delete button too. Do comment what you think about that?

And about the close button, I too think it would be nice to have one. I have noticed on some websites it gets stuck and there is no way to close it other than the page refresh.