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

Search $DICPATH and $XDG_DATA_DIRS for dictionaries #316

Open
puppe opened this issue Sep 16, 2019 · 4 comments
Open

Search $DICPATH and $XDG_DATA_DIRS for dictionaries #316

puppe opened this issue Sep 16, 2019 · 4 comments

Comments

@puppe
Copy link

puppe commented Sep 16, 2019

Summary

The automatic discovery of installed dictionaries could be improved if the environment variables $DICPATH and $XDG_DATA_DIRS were evaluated.

Motivation

On NixOS and possibly on other platforms and Linux distributions, non-English users are greeted with the following dialog:

warning

The proposed feature would make Atom Spell Check search for dictionaries in additional directories, thereby improving the out-of-the-box experience for users.

Describe alternatives you've considered

An alternative would be to add the directories in question to the list of locale paths in the settings page for Atom Spell Check. This has the downside of requiring the user to take additional steps in order to enable spell-checking. It may not be obvious to all users which paths have to be added.

Another "solution" would be to uncheck "Use Locales". The obvious downside is that system dictionaries are not used for spell checking. If I understand it correctly, spell checking would then be only available for English.

A third alternative would be to include dictionaries for additional languages in Atom. But most users would probably not need dictionaries for more than two or three languages. Including dictionaries for more languages by default would be a waste of resources.

Additional context

$DICPATH is also supported by hunspell to search for dictionaries [1][2].

$XDG_DATA_DIRS is specified by the Cross-Desktop Group as "a set of preference ordered base directories relative to which data files should be searched" [3]. It typically contains directories such as /usr/share, or—in the case of NixOS—/run/current-system/sw/share and $HOME/.nix-profile/share, where dictionaries can be found in a subdirectory like hunspell or myspell.

I would be willing to provide a pull request if you are interested in this feature.

Edit (2019-09-24): Its $DICPATH, not $DIC_PATH.

@lee-dohm
Copy link
Contributor

@dmoonfire do you have any feedback or thoughts on this?

@puppe puppe changed the title Search $DIC_PATH and $XDG_DATA_DIRS for dictionaries Search $DICPATH and $XDG_DATA_DIRS for dictionaries Sep 25, 2019
@dmoonfire
Copy link
Contributor

@lee-dohm: I think this is a good idea and would be very helpful. It's easy enough to explode that list into the array we build in code and it should just do the right thing with a focused change.

@puppe: A patch would be good, otherwise I'll stick it on my queue.

@puppe
Copy link
Author

puppe commented Jun 10, 2020

@dmoonfire: I would like to provide a patch. Sadly, I don't have much time at the moment. I will also have to "stick in on my queue". I will report here, when I start working on this, in order to avoid any duplicated effort.

@dmoonfire
Copy link
Contributor

@puppe: Sounds good. I have it also in my queue, but I want to decaffinate the project first (switch to JS from Coffee) before I do it. If you start your effort, I'll hold off on decaffination until you get it in since everything is going to be a merge conflict after that. :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants