Giter VIP home page Giter VIP logo

beltrachi / automatic_dictionary Goto Github PK

View Code? Open in Web Editor NEW
15.0 4.0 4.0 81.84 MB

A Thunderbird extension to auto-detect spellchecking based on the recipients of the composing mail. (This project is in maintenance mode. Only critical bugs will be fixed, but there is no more feature development.)

License: MIT License

Shell 3.21% JavaScript 75.08% Ruby 19.60% Dockerfile 0.35% HTML 1.76%
maintenance-mode

automatic_dictionary's People

Contributors

arai-a avatar beltrachi avatar denb10 avatar dependabot-preview[bot] avatar dependabot[bot] avatar jobisoft avatar renovate[bot] avatar simonsapin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

automatic_dictionary's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

bundler
test/integration/Gemfile
  • activesupport '~> 7.1'
  • byebug undefined
  • memory_profiler undefined
  • multipart-post undefined
  • rspec '~> 3.11'
  • rtesseract '~> 3.1'
  • simplecov undefined
dockerfile
Dockerfile
  • ruby 3.3.4
github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • docker/setup-buildx-action v3
.github/workflows/lint.yml
  • actions/checkout v4
  • amannn/action-semantic-pull-request v5
.github/workflows/release.yml
  • actions/checkout v4
  • TriPSs/conventional-changelog-action v5
.github/workflows/update-thunderbird.yml
  • actions/checkout v4
  • peter-evans/create-pull-request v6
npm
package.json
  • jest ^29.6.3
  • readdirp ^3.6.0
nvm
.nvmrc
  • node 20.16.0
ruby-version
test/integration/.ruby-version
  • ruby 3.3.4

  • Check this box to trigger a request for Renovate to run again on this repository

function with TB 92 beta

This project is in maintenance mode. No new features will be implemented. Just bugs will be considered.

Expected Behavior

Addon should consider stored language

Current Behavior

It seems to always "fall back" or default to english, also after explicitly storing a preference for german for a given recipient.
This also after restarting TB.

Steps to Reproduce it

  1. use TB 92.x beta
  2. write "new mail" to a recipient that has german language as stored preference

Context (Environment)

  • Thunderbird 92.0b4
  • Fedora Linux Workstation 34

Error log

These lines are logged when I open "new mail":

2021-08-31T07:35:45.933Z [info] WindowId=3 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:46.236Z [info] WindowId=3 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:46.538Z [info] WindowId=3 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:46.601Z [info] WindowId=206 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:46.703Z [info] WindowId=206 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:46.839Z [info] WindowId=3 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:46.902Z [info] WindowId=206 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:47.005Z [info] WindowId=206 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:47.141Z [info] WindowId=3 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:47.204Z [info] WindowId=206 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:47.307Z [info] WindowId=206 "Deferring deduceLanguage because spellchecker is not ready" ad.js:97:13
2021-08-31T07:35:47.443Z [warn] WindowId=3 "spellchecker is not enabled or not running"

Seems to be an underlying issue with TB itself? thanks.

Allow for over-ruling language for multiple addressees

Your add-on is great but I think it misses an easy to add feature. Allow for a "super" language or over-ruling character in the case that people with multiple languages are present. In my case if I would need that if in a group of people one has "English" set as main language that this would automatically select "English" even if all the other recipients are are listed as "German".

Thanks a lot, and keep up the great work!

1.8.2: Notifications inconsistent (maybe a feature not a bug)

Start a new message to a recipient with a saved language.
Notification received: AutomaticDictionary: Remembered .
Start another message to the same recipient.
No notification received.
Start a message to a different recipient with a saved language. Notification received.
Start another message to the first recipient. Notification received.

So the second and subsequent message to the same recipient doesn't receive a notification.
Feature or bug?

Also, the corresponding term to "save" is "restore". To use "remember" for the process of setting the language from a saved preference seems confusing to me. Of course the language was saved (remembered) before, but now it's retrieved from the "memory" and set or restored.

"ignore" button

Hi Jordi,

I was thinking about at a new feature, not really fundamental but hopefully simple to implement. In case you are looking for some ideas to keep developing...

Sometimes it happens to write an e-mail to someone in a language that is not the one you would normally use. For example, sometimes I write in English to my Italian friends, or simply insert a English paragraph in the text and want the spell-check to check that rather than the Italian part of the mail (that I know better!).

So, I was wondering: when the little pop-up comes on notifying that the dictionary association has been updated, would it be possible to have a button there to "undo" the action? It will also require the notification to stay on for a little longer, as right now it's really quick to disappear on my system (basically it slides up and immediately down... i guess what ti says, more than really reading it!).

I realize that having to click on that button doesn't save much compared to simply re-doing the association the next time you write to the same person, but if you have more than one recipients on that e-mail, it might be an advantage.

I hope the request is clear... let me know if not!

Cheers!

Giacomo

Wrong dictionary used when replay

I have a bug in replay. The correct language is selected and shown, but not used. E.g. I set Italian for a contact. When I write a new mail everything work ok, but when I replay to a mail from that contact the Italian is selected but English is used to spellcheck (correct words are underlined with red and English words are suggested). Only when I click on Spellcheck button the correct language is used. TB 78.4.0 x64 on win7 x64.

Ready for TB 115?

Is there a plan to also make this add-on available on Thunderbird 115,1? I recieved that version in my OS update and updating Auto-Dictionary fails as it is only configured for 115.0, yet

Ignore CC recipients when language is different from the one of TO recipients

Hi there. Your idea is great.
I was wondering about something like that since 6-7 years ago. In my mind I was thinking to a field in the address book.

I come with a suggestion for you. I use to write emails in different languages and sometimes I use different languages with the same people :-(
Normally in these cases the people are in CC and they receive the messages in the language of the TO people. So my suggestion is "not to modify the language of the CC recipients".

Example:
recip-A normally receives emails in Italian
recpi-B normally receives emails in English
now if I write in English TO recpi-B and CC recip-A, the language for recip-A is modified (and stored) from Italian to English. It would be better keep Italian for recip-A since he is in CC and receives the message in the language of recip-B just in this case.

Thank you very much and kind regards
Angelo

trigger from window focus failing

Thanks for this great app, however there is an issue when it is used together with Virtual Identity
It only recognizes the language at the first e-mail reply after opening a session, the second time it does not activate at all. This is because there is no [event] window focus it seems triggered the second time when Virtual Identity is active.
Would you be able to trigger on something else?
It stops after:

1517430812369 AutomaticDictionary INFO 2018-01-31T20:33:32.369Z [debug] tos are []
1517430812369 AutomaticDictionary INFO 2018-01-31T20:33:32.369Z [debug] ccss are []

While this should be followed by:

1517430812399 AutomaticDictionary INFO 2018-01-31T20:33:32.399Z [debug] [event] window focus
1517430812487 AutomaticDictionary INFO 2018-01-31T20:33:32.487Z [debug] [event] window blur
1517430813202 AutomaticDictionary INFO 2018-01-31T20:33:33.202Z [debug] recipients found: ["masked-email-0@domain"]
1517430813204 AutomaticDictionary INFO 2018-01-31T20:33:33.204Z [debug] recipients found: []

What I would think is to add a new setListener in compose_window.js, if for some reason there is no window focus we need to trigger the deduceLanguage based on another event. What do you think?
It still triggers if I manually click on the subject for example but it should trigger naturally without clicking I think.

Automatic language detection

Many, many thanks for this addon! I've been waiting for years to have something like this. In fact I've been using the automatic dictionary switcher by Dao Gottwald until it stopped working years ago: https://addons.thunderbird.net/en-US/thunderbird/addon/dictionary-switcher-for-thunde/

It is very nice to bind the language to the recipient. However, for first time contacts (and eventually for selected recipients) it would be nice to automatically detect the language like Dao's switcher did. Or even better like this one: https://addons.thunderbird.net/en-US/thunderbird/addon/markov-dictionary-switcher Just an idea to make a great addon even greater.

Thanks again!

Spell Checking stop working

Under TB 24.0.0 and extension release 1.5.0 spell checking stops working (intermittent).
I'm investigating with release 1.5.4 (found in another issue)

Compatibility with "conversations"

"Conversations" is an plugin for TB that, among other things, allows you to answer e-mails directly in the reading pane. When you do that, the only way of setting the dictionary appears to be the use of the context menu. In this situation, "automatic dictionary" neither automatically select the appropriate dictionary nor record the choice made with the context menu.

I guess a fix for this is not trivial, but it will be very helpful!

Many thanks for the super-useful add-on!

Giacomo

Thunderbird 52.0

Is it possible that the addons stopped working on Thunderbird 52.0? I don't get any response from it when changing the dictionary for a recipient. Moreover, when I go into the settings of the extensions and enable "Save log to file" and restart Thunderbird, compose some messages, and then go back to the extension settings and click "Send log file to dev" nothing happens.

Unfortunately, I was also not able to get the logs from the error console of thunderbird.

Thunderbird portable

The extension can't find previous settings when TB is running in portable mode (profile folder is not at a default location).

Add-on does not work with Thunderbird version 78.4.3

After the last update of Thunderbird to version 78.x the add-on has stopped working.
Thunderbird says that this add-on is not compatible with the current version of Thunderbird.

Screenshot 2020-11-12 11 03 57

Context (Environment)

Thunderbird version 78.4.3
Win 10 Pro

1.8.2: Tabbing into the subject restores ("remembers") the language but fails to set it

Start a new message to a recipient who has a stored language.
Tab into the subject.
Notification arrives: Remembered
Start typing in the subject and notice that the language is in fact not set. Or right click and inspect the language.
Tab into the message and now the language is set.

Note: Maybe the language is set when tabbing into the subject, since making another window current and then returning to the composition does switch the language in the subject. Somehow M-C core doesn't acknowledge the setting until the window is brought forward again. Please contact me for further assistance with this problem.

Firefox support?

Hello all,

This is such an amazing add-on!

Any chance we can implement automatic dictionary switch support directly into Firefox as well? :-)

Doesn't work anymore

Hi,

It seems that the Extension just stopped working some time ago.
I have version 1.10.2 now, but I noticed 1-2 weeks ago, that it just doesn't remember anything anymore. I set a language, the extension informs me about remembering it at the bottom, I send an e-mail. I open another one to this person - default language again.
I checked the log file - no problems at all.

Could you please assist how to deal with the problem?

Thanks,

Wojtek

Homepage URL is not working

(Creating new issue on behalf of @pgnd, extracted from #96)

@beltrachi

quick fyi, the new-version reports:

"Homepage  http://beltrachi.github.com/automatic_dictionary/"

@ visit to

http://beltrachi.github.com

reports

"There isn't a GitHub Pages site here.

Did you mean to visit beltrachi.github.io? Please note that this site belongs to a GitHub user and is not an official GitHub site.

If you're the owner of this site, please update your links to use beltrachi.github.io instead. Subdomains of github.com are deprecated for GitHub Pages. They will not redirect to github.io after April 15, 2021. "

and
@ visit to

https://beltrachi.github.io/

also reports

"There isn't a GitHub Pages site here.

If you're trying to publish one, read the full documentation to learn how to set up GitHub Pages for your repository, organization, or user account."

TB 57.0b2 compatibility

Hello,
your Automatic dictionary addon, v1.10.1, is very, very useful and worked perfectly, until last Thunderbird 57.0b2 update. Now. at least for me, it does not remember any more the language selections...
Regards, Michael

Spotty bahaviour when replaying

Add-on works great when creating new e-mail but hardly ever when replaying. I tried to pin point circumstances when it works or doesn't but I couldn't find any specific conditions.

Guessing

When you guess the language, it's not stored. So the next time the user writes to the same recipient, you guess again. Why?

If you guessed correctly, that is, the user doesn't change the guess, you can store it. If the user changes the guess, you will store that anyway. Conclusion: You can always securely store the guess.

SpellCheck not working after email account change

Using TB 31.7.0 on Ubuntu 14.04, I recently changed my email account (both gmail). Automatic dictionary switcher was working perfectly on the first account, but as soon as I deleted the account, and added the new account, it stopped working: I don't see any notification about saved settings when composing a message. Re-installation doesn't help.

Change language without updating users if more than one

Hi,

if I select many contacts that use different languages, I have to select english to write to them.
The change of language updates all the selected users and this is very annoying because normally I want write to each in other languages than english.

I've set the "Max recipients to process per mail" to 1 but making that it's impossible to change the language of the e-mail if he has more than one recipient. Even selecting another language the editor restores every time the language of the first recipient.

It's better to allow the change of the language even if I have more than one recipient but to not update the user language for all the recipients.

Not working with TB 73.0b1

It's a great add-on but unfortunately stopped working with beta branch of TB (TB 73.0b1 to be exact).

Automatic Dictionary add-on breaks TB 56.0b1

I received the automatic update to TB 56.0b1 yesterday.
Upon restart TB came up with the UI completely screwed and unusable.
What still did work was to get into safe mode. I nailed down the problem
to the Automatic Dictionary add-on.
Happens on both, Linux and Windows.

Heuristic to make automatic_dictionary smarter

Right now, if the recipient's email is found in the database, a dictionary is set. If it is not found, nothing is done.

But I believe we could do better than that.

How about the following algorithm:

Tries to find the email in the database, if found, set dictionary, else
tries to find the domain in the database ( what is after @ ) if found, set dictionary, else
tries to find the domain without it's first subdomain. if found, set dictionary, else
tries to find the domain without it's first and second subdomain. if found, set dictionary, else
tries to find the domain without it's first and second and third subdomain. if found, set dictionary, else
nothing is done.

That means if I try to send an email to

[email protected]
it will first look in the database for
[email protected]
then
bbbb.cccc.com.br
then
cccc.com.br
then
com.br
than
.br

Which means it will probably find a dictionary, as long as I've sent an email to another person with a .br address

Extensive permissions

Hi!

Since new version, the addon requires permission to: "Have full, unrestricted access to Thunderbird, and your computer". I suppose it is caused by some changes in Thunderbird. However from user's perspective it is rather frightening (even though the later part of the sentence is not really true in any reasonable OS). It would be nice be able to use this addon without selling the soul ;)

Compatability with TB60

TB 60 (the current beta) reports incompatibility with this awesome plugin.
I'm not sure whether this affects real functionality or is just a heads-up that some compatibility flag needs to be set.

macOS issues

I just installed the Automatic Dictionary in Thunderbird (version 60.2.1 on macOS High Sierra 10.13.6) and clicking "Tools > Add-on preferences > Automatic Dictionary" does not open the preferences (which is why I cannot create a log to illustrate the second and more important issue). Secondly, although the add-on seems to save the settings fine (I get the small notification when changing a language) it does not actually change the language when writing a new message to the same email address. I've tried restarting Thunderbird but the issue remains. Also, is there supposed to be a notification shown when the add-on recognises an address and switches language?

Thanks,
Martin

Recipients not always read when replying

When replying on messages, almost always the language stays on the default language and not switched to the previously remembered language, whether it's a single recipient or a combination. The database with the address-language combinations are intact, based on the logs of the program it appears it simply cannot read the recipients out of the message.

Attached the log from the add-on, it starts right with the action when I hit the reply button (at 16:31:33) then I wrote an English sentence in the message body which was underlined as not proper Hungarian. Then at 16:31:41 I just clicked into the address field, and that re-triggered the recipient check, found the recipients and set the right language at once. My sentence become correct at once.

image

Sounds like some sort of timing issue, is there no way to put a few ms delay (maybe optional) between opening the email window and reading the recipients?

Remembering or guessing just once

The add-on is just working once after restarting Thunderbird: Just the first reply, first compose and first forward.

  • Click "write message" (or reply or forward)
  • Compose window opens
  • Write receiver address
  • AD sets the locale
  • Close the window
  • Click "write message" again (or reply or forward)
  • Compose window opens
  • Write receiver address
  • AD does nothing

Maybe this post can help because it's the same behavior: A script does its action in compose window just once.
http://stackoverflow.com/questions/7414032/thunderbird-extension-load-event-seems-to-occur-only-once

OS: Windows 8.1
Thunderbird 24.4.0
image

Reply to message does not set language

This project is in maintenance mode. No new features will be implemented. Just bugs will be considered.

Expected Behavior

When replying, use the language associated with the recipient.

Current Behavior

When I reply to an email, the default language is always used.

If I start a new email, enter the same recipient as in the reply, the correct language dictionary is selected.

Steps to Reproduce it

  1. Reply to an email from a sender, where the language is already set.
  2. The language is not selected.

Context (Environment)

Thunderbird: 102.2.2 (64-bit)

Operating System: Linux Mint 20.3

  • Addressbooks Syncronizer
  • Attach from Clipboard
  • Automatic Dictionary
  • BorderColors D
  • CardBook
  • Changelogger
  • Check and Send
  • Display Mail User Agent T
  • Emoji
  • Enhanced Priority Display
  • Expression Search - NG
  • FolderFlag
  • Identity Chooser
  • Jitsi Meet event generator
  • Lightning Invitation Notifier (LIN)
  • LookOut (fix version)
  • Mail Merge
  • Manage Emails/Nostalgy++
  • Markdown Here Revival
  • Maximize Message Pane
  • Message Header Toolbar Customize
  • MoreSnooze
  • New Thread to All
  • No Message Pane Sort
  • Outlook/Teams Appointments
  • PrintingTools NG
  • QuickFolders
  • Quote Colors & Collapse
  • Remove Duplicate Messages
  • Scriptable Notifications
  • ScrollAnywhere
  • Send Later
  • Show InOut
  • SignatureSwitch
  • Simple Mail Redirection
  • Smileyfixer
  • Spam Scores
  • tbkeys-lite
  • ThreadVis
  • ThunderHTMLedit
  • TORPEDO
  • Unmangle Outlook Safelinks

Error log

This is the output in the error console, when replying to a amessage

This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”. blank
MutationObserver.observe: Argument 1 is not an object. composer.js:227
window created background.js:13:11
2022-11-01T09:50:51.198Z [debug] "ad: init" ad.js:62:13
IdentityChooser#initUI -- begin background.js:96:13
IdentityChooser#initUI: window: messageCompose background.js:97:13
IdentityChooser#initUI -- end background.js:123:13
2022-11-01T09:50:51.201Z [debug] "skipping migration 201101010000" ad.js:62:13
2022-11-01T09:50:51.201Z [debug] "skipping migration 202106051955" ad.js:62:13
2022-11-01T09:50:51.201Z [debug] "skipping migration 202209270000" ad.js:62:13
2022-11-01T09:50:51.202Z [debug] "Setting key: migrations_applied" ad.js:62:13
2022-11-01T09:50:51.202Z [debug] ["201101010000","201102130000","201106032254","201210192306","201211112134","202003161545","202003231651","202106051955","202106271139","202209270000"] ad.js:62:13
2022-11-01T09:50:51.216Z [debug] "reusing data structures" ad.js:62:13
2022-11-01T09:50:51.216Z [debug] "events registered" ad.js:62:13
2022-11-01T09:50:51.217Z [debug] "increasing stats.usages" ad.js:62:13
2022-11-01T09:50:51.217Z [debug] "dispatching event " ad.js:62:13
2022-11-01T09:50:51.217Z [debug] "{\"type\":\"load\"}" ad.js:62:13
window.controllers/Controllers is deprecated. Do not use it for UA detection. blank
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”. blank
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
{8f71c6b5-51d5-4906-8588-fecbf919dbaf}
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”. 2 blank
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
MimeMessageUtils.jsm:148:23
Start unmangle links display.js:50:9
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
MimeMessageUtils.jsm:148:23
New compose tab 83 with identity id7 styleswitcher.js:31:15
Object { from: "Me <[email protected]>", to: (1) […], cc: [], bcc: [], overrideDefaultFcc: false, overrideDefaultFccFolder: null, additionalFccFolder: "", type: "reply", relatedMessageId: 15584, replyTo: [], … }
styleswitcher.js:32:15
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>”.
MimeMessageUtils.jsm:148:23
Applying new border style for identity id7 to tab 83 styleswitcher.js:46:13
This page is in Quirks Mode. Page layout may be impacted. For Standards Mode use “<!DOCTYPE html>".

Option to disable pop-up

Hi! Great extension. Really love it.
I am missing an option to disable the pop-up so all the magic happens automatically without notifying me. Is this possible?
Thanks, ByteHamster

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.