platers / obsidian-linter

An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
https://platers.github.io/obsidian-linter/
MIT License
1.23k stars 81 forks source link

Bug: MisspellingToCorrection not check correctly if my default language in OS settings is English #1073

Closed DHERRADOR closed 6 months ago

DHERRADOR commented 6 months ago

I have verified that I am on the latest version of the Linter. 1.23.2

Describe the Bug

"MisspellingToCorrection" setting not check correctly if my default language in OS settings is English, so it correct Spanish words in English words when I close my note. It use this table: https://github.com/platers/obsidian-linter/blob/master/src/utils/auto-correct-misspellings.ts to correct words even when the language is not English.

How to Reproduce

Steps to reproduce the behavior:

  1. Config Obsidian in Spanish language
  2. Go to 'Linter Settings'
  3. Click on 'General tab'
  4. Click on 'Override locale' and select "Same as system (es)". Obviusly, I am working in my OS with spanish language. Even deleted the English language from the spell corrector of my Mac OS Sonoma.
  5. Click on 'Content tab'
  6. Activate the first setting: "Auto-correct Common Missplelings"

Example to reproduce issue:

Write in a note this text:

"Vender con éxito muchas veces depende de hacerlo en el momento oportuno, y esto te hace sentir bien".

After to save the note and quit from it, if you return to it, you will see this phrase with substitutions of words. Like that:

"Vendor con éxito muchas veces depende de hacerlo en el memento oportuno, y esto te have sentir bien"

I don't think you need I send you Linter logs, because this bug is easily reproducible.

Expected Behavior

A clear and concise description of what you expected to happen.

Expected output if applicable:

Not to change any Spanish word, because I have selected Spanish language in my spell checking of my OS. I have selected Spanish language in obsidian, and I haved selected Linter Setting: "Override locale' as "Same as system (es)".

This setting only have sense if I have selected English language in my OS settings, or if I would select in the "Linter Setting/Override local" the setting 'en'. Because all these words of your table are valid only for English language.

What it would be a good idea is to bring that table to Linter settings to the user could decide if use that words or another different words.

Device

pjkaufman commented 6 months ago

Hey @DHERRADOR , thanks for the feedback. Autocorrect misspellings is just a list of mispellings to their corrections. Most of the words are from English, but there are others that are French and from other languanges.

Currently the Linter has no way to know what language you intend to write in (the locale is just for the date locale). It sounds like you wanted to use this setting to determine whether or not to run the auto corrections for any file. Is that correct?

DHERRADOR commented 6 months ago

It sounds like you wanted to use this setting to determine whether or not to run the auto corrections for any file. Is that correct? Yes

In any case, understanding your message, I would suggest that you at least explain in that section of the settings, which can produce unwanted effects in some language (especially Spanish).

If you allow me, I will explain my odyssey with this problem, which, more than a bug, I now understand is a misunderstanding on my part.

For me, the title of this adjustment: "Auto-correct Common Misspelling", makes me think that it will improve the correction of my writing (in my language Spanish), not in others. Even more so when you consider that I don't read "Auto-correct Common Misspelling" but rather"Corrección automática de errores ortográficos comunes" in my language.

Obviously I didn't click on your link "Auto-correct map of words" link. And I didn't, because your plugin is so extensive in functions, that user is normal to mark some of the settings only thinking they are going to do.

The only thing I can tell you is that I have been driving myself crazy for approximately 15 days to understand why the words kept changing in Obsidian. Luckily I have some control over regular expressions, and with Visual Studio Code I have been able to restore the changed words. I use Obsidian for work, and my research time on Obsidian is limited. I'm a relatively new Obsidian user, approx. 3 weeks of use, and since installing Linter, without knowing this was the problem, I have been researching solutions.

Of course from here, I narrowed down my problem until I reached Linter.

Aside from making it clear how clumsy I was in my research, what I want to show with my story, is that it has made me waste a lot of time. Not because it was your fault. I have learned that I should read a little more before activating features in the hundreds of plugins that Obsidian has.

But constructively, I would suggest explaining this setup a bit more. Surely you could avoid such a waste of time for any other Spanish user. Since some of the words indicated in the list of "words to replace" are well-spelled words in my language.

In any case, it's a suggestion, and you should modify my case as such. Since it is not a bug.

And I take this opportunity to congratulate you for your work and for this excellent plugin that offers such great versatility to my dear Obsidian.

pjkaufman commented 6 months ago

I have made the wording changes for Autocorrect Mispellings. It should be present in the next release.