-
Notifications
You must be signed in to change notification settings - Fork 122
Add a way to choose the current language #21
Comments
Related to #11. |
IMHO, language selection is bad. Many people write texts in their native language and document their programs in English. Thus one needs to switch the language regularly, which is tedious. For example as a German native speaker who also writes a lot of text in English (like this post) I have given up on reconfiguring the spell checking language In Chrome. I brought that up before in #25. |
@Bengt In multi-language documents, being able to use the spell-checker on all languages at once is certainly a nice-to-have feature, but not relevant to this issue, which is that there is currently no way to switch languages from within the editor. |
Do you have anything to support that? My impression is that it is quite feasible. Especially, LangID claims to be robust against text being mixed with programming language syntax.
In my experience, users do not follow language guidelines strictly, even if they set them themselves. For example some people comment code in multiple languages in the same project. So users might select a language because they have a policy of writing in a that language but spellchecking might still fail on comments that violate that policy. I see two solutions to that: Either detect the different language and spell check it anyways or detect the violation of the policy. Such a policy could be formally defined and checked by a Linter, but talking Atom Spell Check, I think it should do it's best to spell check as much text as possible. Ignoring mixed languages seems like a one-size-fits-all approach to a problem where this really isn't true. |
Personal experience with mixed Dutch-English documents, and Dutch documents containing a lot of technical jargon in English. In any case, it is hard — and often impossible if there is not much text to work with — to automatically detect the desired dictionary when languages have multiple variants (as almost all do). When I edit a Dutch manual page, I want the spell-check to use Dutch as written in the Netherlands (and not as written in Belgium, or the Netherlands Antilles), and for the corresponding English page I prefer English, as written in the United Kingdom (explicitly In my opinion software helpfully selecting not quite the right dictionary is anathema to a good user experience. This is also one of the reasons why web browsers offer the language selection menu, and word-processors such as LibreOffice Writer allow you to set the locale for a specific text-style.
This issue suggests adding a language selection option, similar to that found in Firefox and Chrome. It fixes the problem of editing text in Atom in one language, whilst your system locale is set to another. For your suggestion of automatic language detection, you should probably open a new issue or pull request. |
I think it is far better to guess the right dictionary in most cases, than to force selecting it in every case. To stick with your example, language/locale detection might detect So this should happen far more seldomly than switching back and forward between your native and your secondary language. I think we need to accept some glitches when working on natural language with computers. For example, my Chrome is currently spellchecking
I oppose building a language selection dialogue, now because it might prohibit implementing language detection, in the future. Language detection would also work with texts written in different languages than the system locale and avoid (IMHO at least) the usability fail of forcing the user to switch languages manually. Perhaps this conflict isn't one though. With a language selection dialogue as suggested here, language detection could preselect a language in said dialogue and the user could override that preselection when language detection fails or just to be sure the right locale is enforced. That way, the language selection dialogue could be implemented now and augmented with a language-detection-based preselection in the future. |
I use Atom to take notes in markdown format. I have to do so in different languages. |
Some of my files in English and others in a different language (although I'm trying to keep all of them in English). It would be nice if I could select the language used for the spell check in individual files. Auto detecting them would be better, but I don't know if that solution would be problematic, as previously discussed. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This isn't true, node-cld2 will very very accurately detect text as long as it is more than a sentence. |
@paulcbetts Unfortunately, an algorithm cannot reliably distinguish between language variants. In fact, Also, such local lingual idiosyncrasies are precisely why we like having spell-checkers in the first place. It is not very helpful if your editor claims "Nice color!" is correct English when you are actually writing text meant for a British audience. 😃 |
lol, let's run before we can walk, right now Atom doesn't even do anything other than English |
Hello, I've written few lines that add a rough multi-language support, here is the repo. (wich I don't know if I created correctly, quite new here...) https://github.com/ihatetothink/spell-check Right now uses the status bar to choose from the system languages. I'm still testing by the way... any word will be appreciated. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The above (now merged) PR changes the default spell check language to your system default - i.e. your So while we still can't change the language on the fly, this has been a vast improvement for me, as I only really wanted my system |
@OJFord Thank you! When will that PR be realed as an update to spell-check? |
@OJFord This is already a big improvement, cool. I couldn't find this in the docs: is there a way to run multiple Atom instances in parallel? It's not an ideal solution, but at least it would make it possible to run them with different |
@sbrl No idea I'm afraid; hopefully the dependency will be updated in the next release.. you could modify it yourself to read @darobin Yes, just export |
As of atom/node-spellchecker#33 (v3.2.3), the default language used is that of the `LANG` environment variable. This is an (non-closing) improvement for those subscribed to atom#21.
@OJFord Ah right. I'm not that desperate (although it sounds like a terribly useful change) - hopefully the next release isn't too far away. |
I've submitted a PR to specifically address it, otherwise I suppose there may be no reason for anyone to think it was worth updating it for some time. |
This is now merged and released in v0.67.0 - @sbrl |
@OJFord Awesome, thanks! |
* Changed the package to allow for external packages to provide additional checking. (Closes atom#74) - Diabled the task-based handling because of passing plugins. - Two default plugins are included: system-based dictionaries and "known words". - Suggestions and "add to dictionary" are also provided via interfaces. (Closes atom#11) - Modified various calls so they are aware of the where the buffer is located. * Modified system to allow for multiple plugins/checkers to identify correctness. - Incorrect words must be incorrect for all checkers. - Any checker that treats a word as valid is considered valid for the buffer. * Extracted system-based dictionary support into separate checker. - System dictionaries can now check across multiple system locales. - Locale selection can be changed via package settings. (Closes atom#21) - External search paths can be used for Linux and OS X. - Default language is based on Chromium settings. * Extracted hard-coded approved list into a separate checker. - User can add additional "known words" via settings. - Added an option to add more known words via the suggestion dialog. * Updated ignore files and added EditorConfig settings for development. * Various coffee-centric formatting.
* Changed the package to allow for external packages to provide additional checking. (Closes atom#74) - Disabled the task-based handling because of passing plugins. - Two default plugins are included: system-based dictionaries and "known words". - Suggestions and "add to dictionary" are also provided via interfaces. (Closes atom#11) - Modified various calls so they are aware of the where the buffer is located. * Modified system to allow for multiple plugins/checkers to identify correctness. - Incorrect words must be incorrect for all checkers. - Any checker that treats a word as valid is considered valid for the buffer. * Extracted system-based dictionary support into separate checker. - System dictionaries can now check across multiple system locales. - Locale selection can be changed via package settings. (Closes atom#21) - External search paths can be used for Linux and OS X. - Default language is based on Chromium settings. * Extracted hard-coded approved list into a separate checker. - User can add additional "known words" via settings. - Added an option to add more known words via the suggestion dialog. * Updated ignore files and added EditorConfig settings for development. * Various coffee-centric formatting.
* Changed the package to allow for external packages to provide additional checking. (Closes atom#74) - Disabled the task-based handling because of passing plugins. - Two default plugins are included: system-based dictionaries and "known words". - Suggestions and "add to dictionary" are also provided via interfaces. (Closes atom#11) - Modified various calls so they are aware of the where the buffer is located. * Modified system to allow for multiple plugins/checkers to identify correctness. - Incorrect words must be incorrect for all checkers. - Any checker that treats a word as valid is considered valid for the buffer. * Extracted system-based dictionary support into separate checker. - System dictionaries can now check across multiple system locales. - Locale selection can be changed via package settings. (Closes atom#21) - External search paths can be used for Linux and OS X. - Default language is based on Chromium settings. * Extracted hard-coded approved list into a separate checker. - User can add additional "known words" via settings. - Added an option to add more known words via the suggestion dialog. * Updated ignore files and added EditorConfig settings for development. * Various coffee-centric formatting.
* Changed the package to allow for external packages to provide additional checking. (Closes atom#74) - Disabled the task-based handling because of passing plugins. - Two default plugins are included: system-based dictionaries and "known words". - Suggestions and "add to dictionary" are also provided via interfaces. (Closes atom#11) - Modified various calls so they are aware of the where the buffer is located. * Modified system to allow for multiple plugins/checkers to identify correctness. - Incorrect words must be incorrect for all checkers. - Any checker that treats a word as valid is considered valid for the buffer. * Extracted system-based dictionary support into separate checker. - System dictionaries can now check across multiple system locales. - Locale selection can be changed via package settings. (Closes atom#21) - External search paths can be used for Linux and OS X. - Default language is based on Chromium settings. * Extracted hard-coded approved list into a separate checker. - User can add additional "known words" via settings. - Added an option to add more known words via the suggestion dialog. * Updated ignore files and added EditorConfig settings for development. * Various coffee-centric formatting.
* Changed the package to allow for external packages to provide additional checking. (Closes atom#74) - Disabled the task-based handling because of passing plugins. - Two default plugins are included: system-based dictionaries and "known words". - Suggestions and "add to dictionary" are also provided via interfaces. (Closes atom#10) - Modified various calls so they are aware of the where the buffer is located. * Modified system to allow for multiple plugins/checkers to identify correctness. - Incorrect words must be incorrect for all checkers. - Any checker that treats a word as valid is considered valid for the buffer. * Extracted system-based dictionary support into separate checker. - System dictionaries can now check across multiple system locales. - Locale selection can be changed via package settings. (Closes atom#21) - Multiple locales can be selected. (Closes atom#11) - External search paths can be used for Linux and OS X. - Default language is based on the process environment, with a fallback to the browser, before finally using `en-US` as a fallback. * Extracted hard-coded approved list into a separate checker. - User can add additional "known words" via settings. - Added an option to add more known words via the suggestion dialog. * Updated ignore files and added EditorConfig settings for development. * Various coffee-centric formatting.
* Changed the package to allow for external packages to provide additional checking. (Closes atom#74) - Disabled the task-based handling because of passing plugins. - Two default plugins are included: system-based dictionaries and "known words". - Suggestions and "add to dictionary" are also provided via interfaces. (Closes atom#10) - Modified various calls so they are aware of the where the buffer is located. * Modified system to allow for multiple plugins/checkers to identify correctness. - Incorrect words must be incorrect for all checkers. - Any checker that treats a word as valid is considered valid for the buffer. * Extracted system-based dictionary support into separate checker. - System dictionaries can now check across multiple system locales. - Locale selection can be changed via package settings. (Closes atom#21) - Multiple locales can be selected. (Closes atom#11) - External search paths can be used for Linux and OS X. - Default language is based on the process environment, with a fallback to the browser, before finally using `en-US` as a fallback. * Extracted hard-coded approved list into a separate checker. - User can add additional "known words" via settings. - Added an option to add more known words via the suggestion dialog. * Updated ignore files and added EditorConfig settings for development. * Various coffee-centric formatting.
@OJFord Thanks! I'm using stable. Not too long now! |
I installed the current beta right now, but I am not able to find any language suggestions... |
I have Atom 1.23.0, and I still can't switch languages manually. |
Here is how I manually switch between system default language (English for me) and others (French for example) on Ubuntu/Atom
|
When you're a software developer and your native language is not English, chances are that you will be switching a lot between English and your native language. I would like to be able to choose the language from my available spell check dictionaries.
The current workaround is to change the system dictionary, but that is cumbersome and most of the time I only want to change the language for the application I am working in at that moment.
On GNU/Linux graphical desktop environments applications that work with text all provide a way to either set the language of the text (Libre/OpenOffice) or to select the current language (Gedit, web browsers, etc.).
Firefox does this very nicely for example:
Can we get this functionality in Atom? On GNU/Linux (I don't know about Windows, does it use Hunspell as well?) changing the user's locale is the only way to change the default dictionary language. This means that Atom's spell check is basically stuck in one language, even though multiple dictionaries are available.
It looks like https://github.com/atom/node-spellchecker provides an OS-agnostic interface for spell-checking (using either Hunspell or the system spell checker if you are using Mac OS X). Perhaps it is possible to add a call for a list of available languages as well?
The text was updated successfully, but these errors were encountered: