Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Add a way to choose the current language #21

Closed

Description

@jdhoek

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:

switch_language

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?

Activity

  1. jdhoek commented on May 22, 2014

    @jdhoek
    Author

    Related to #11.

  2. Bengt commented on Oct 30, 2014

    @Bengt

    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.

  3. jdhoek commented on Oct 30, 2014

    @jdhoek
    Author

    @Bengt
    Detecting languages automatically is quite error prone, especially in a programming context. The user is the only one who can reliably indicate which language should be the primary target of the spell-checker.

    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.

  4. Bengt commented on Oct 30, 2014

    @Bengt

    Detecting languages automatically is quite error prone, especially in a programming context.

    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.

    The user is the only one who can reliably indicate which language should be the primary target of the spell-checker.

    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.

  5. jdhoek commented on Oct 30, 2014

    @jdhoek
    Author

    Do you have anything to support that?

    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 en_GB, rather than en_US). LangID detects only language, not locale.

    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.

    Ignoring mixed languages seems like a one-size-fits-all approach

    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.

  6. Bengt commented on Nov 14, 2014

    @Bengt

    In my opinion software helpfully selecting not quite the right dictionary is anathema to a good user experience.

    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 en_US while you misspell the british "meagre" as "meager". That should but only happen when there is no text with other words that are written differently among these locales and are correctly spelled in their en_GB variant.

    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 en_GB and marks "seldomly" as a misspelling in the sentence previous to the previous sentence.

    Ignoring mixed languages seems like a one-size-fits-all approach

    This issue [...] fixes the problem of editing text in Atom in one language, whilst your system locale is set to another.

    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.

  7. dpagano commented on Jul 15, 2015

    @dpagano

    I use Atom to take notes in markdown format. I have to do so in different languages.
    Changing the system language when switching between two files?? No way.
    So currently I have to live with the curly lines and copy the "finished" document over to a different tool to do my checking. I think there are better ways.

  8. BujiasBitwise commented on Sep 12, 2015

    @BujiasBitwise

    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.
    Actually, I would like to see project files that I could store, where this settings were saved. But that would be a different discussion.

  9. danielschmitz commented on Oct 5, 2015

    @danielschmitz
  10. hellboy81 commented on Oct 6, 2015

    @hellboy81
  11. louis-etne commented on Oct 24, 2015

    @louis-etne
  12. anaisbetts commented on Oct 24, 2015

    @anaisbetts

    Detecting languages automatically is quite error prone, especially in a programming context.

    This isn't true, node-cld2 will very very accurately detect text as long as it is more than a sentence.

  13. jdhoek commented on Oct 24, 2015

    @jdhoek
    Author

    @paulcbetts

    Unfortunately, an algorithm cannot reliably distinguish between language variants. In fact, cld makes no attempt to so from what I can tell. It only detects the language (e.g., 'English' or en), it does not distinguish between language variants (e.g., en_GB and en_US). This is not good enough for a spell-checker, because spelling dictionaries are language-variant-specific.

    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. 😃

  14. anaisbetts commented on Oct 24, 2015

    @anaisbetts

    lol, let's run before we can walk, right now Atom doesn't even do anything other than English

  15. 12 remaining items

  16. OJFord commented on Feb 19, 2016

    @OJFord
    Contributor

    This is now merged and released in v0.67.0 - @sbrl

  17. sbrl commented on Feb 20, 2016

    @sbrl

    @OJFord Awesome, thanks!

  18. added 6 commits that reference this issue on Mar 12, 2016
    3854bd9
    b58196f
    5c318b1
    c02e3f7
    e95f999
    833330f
  19. OJFord commented on Mar 20, 2016

    @OJFord
    Contributor

    FYI @sbrl @darobin this is in Atom 1.7.x, so you can use it now in the beta releases, or hopefully not wait too much longer before stable reaches 1.7.

  20. sbrl commented on Mar 20, 2016

    @sbrl

    @OJFord Thanks! I'm using stable. Not too long now!

  21. added a commit that references this issue on May 2, 2016
    8b7ab9c
  22. MAWSpitau commented on May 12, 2016

    @MAWSpitau

    I installed the current beta right now, but I am not able to find any language suggestions...

  23. ThomasPietrzak commented on Dec 15, 2017

    @ThomasPietrzak

    I have Atom 1.23.0, and I still can't switch languages manually.
    Automatic detection can be useful in some cases. But most of the time, I'm damn better than any algorithm at knowing what language I would like to spell check.

  24. x0s commented on Jan 23, 2019

    @x0s

    Here is how I manually switch between system default language (English for me) and others (French for example) on Ubuntu/Atom

    • If you don't already have dictionary in your system:
      • look for it here
      • Install it browsing this URL (example with french): apt://hunspell-fr
    • Add new locale in Locales field under spell-check settings in Atom. The new locale to write is the hunspell suffix (fr in our example)
    • Open a text file(markdown for instance), and the curly lines should be gone except for your typing errors ;)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions