Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change dict loading mechanism from internal static to server extension #74

Merged
merged 10 commits into from
Jun 1, 2021

Conversation

krassowski
Copy link
Collaborator

@krassowski krassowski commented May 31, 2021

Builds upon #70

Closes #31

  • dictionaries now have an ID allowing to distinguish multiple dictionaries from different locations for the same language/code
  • OS-specific locations are now searched to discover pre-installed dictionaries
  • use babel to resolve the language/locale name for given locale code (as it is already a dependency of JupyterLab) - we can revisit this in the future

In the follow up PR: split the existing dictionaries into separate packages so that one does not need to install the dictionaries they don't need

@krassowski krassowski requested a review from ocordes May 31, 2021 16:11
@github-actions
Copy link

Binder 👈 Launch a binder notebook on branch krassowski/jupyterlab_spellchecker/ocordes-server-ext

@ocordes
Copy link
Collaborator

ocordes commented Jun 1, 2021

This looks good! I agree to look for dictionaries manually, without a lang.json file. But how can we implement a language description which is able to load files directly from the network? With lang.json this is easy, okay, one can argue "download everything you need" is sufficient ;-)

Copy link
Collaborator

@ocordes ocordes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very good :-)

@krassowski
Copy link
Collaborator Author

But how can we implement a language description which is able to load files directly from the network? With lang.json this is easy, okay, one can argue "download everything you need" is sufficient ;-)

I have mixed feelings here. I did think about making another setting for "online dictionaries" so that one would go to the advanced settings and add something like:

{
    "ignore": ["JupyterLab", "Notebook", "Notatnik"],
    "language": "pl_PL-online",
    "onlineDictionaries": [
        {
            "id": "pl_PL-online",
            "aff": "http://some-url/pl_PL.aff",
            "dic": "http://some-url/pl_PL.dic",
            "name": "polski (Polska)"
        }
    ]
}

I'm not convinced that this is necessary now, given that the dictionaries loaded locally to the disk are more reliable, but I see that for some very specific use cases this might be useful. I will open a new issue to track this one.

@krassowski krassowski merged commit 024ff06 into jupyterlab-contrib:master Jun 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

How can I add a portuguese dictionary?
2 participants