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

[Bug]: cspell-eslint-plugin does not work with Russian language #5232

Closed
1 task done
v-v-belikov opened this issue Feb 7, 2024 · 3 comments · Fixed by #5251
Closed
1 task done

[Bug]: cspell-eslint-plugin does not work with Russian language #5232

v-v-belikov opened this issue Feb 7, 2024 · 3 comments · Fixed by #5251

Comments

@v-v-belikov
Copy link

Kind of Issue

Change in behavior / Regression

Tool or Library

cspell/eslint-plugin

Version

No response

Supporting Library

No response

OS

Windows

OS Version

10

Description

When specifying the Russian language in the cspell-eslint-plugin config (using cspell.import = ["@cspell/dict-ru_ru/cspell-ext.json"]), all words of the Russian language (even those written correctly) are still underlined as unknown.

Steps to Reproduce

No response

Expected Behavior

No response

Additional Information

No response

cspell.json

// Rules part of .eslintrc.js
"@cspell/spellchecker": [
      "warn", {
        "cspell": {
          "import": ["@cspell/dict-ru_ru/cspell-ext.json"],
        }
      }
    ]

cspell.config.yaml

No response

Example Repository

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@Jason3S
Copy link
Collaborator

Jason3S commented Feb 15, 2024

@v-v-belikov,

It is necessary to enable the language locale for the Russian dictionary to be used.

To test if the dictionary is loaded, add a comment containing cspell:locale en,ru to one of your files.

I took a look at the cspell eslint config, it looks like the language setting was missed. I'll fix that.

Opitons:

  1. Add the cspell directive to files that need to be in Russian: cspell:locale ru.
  2. Add a cspell.json file to the directory with Russian files:
    { "language": "ru" }

@Jason3S
Copy link
Collaborator

Jason3S commented Feb 15, 2024

Once cspell 8.4.0 is published, it should be possible to do this:

// Rules part of .eslintrc.js
"@cspell/spellchecker": [
      "warn", {
        "cspell": {
          "import": ["@cspell/dict-ru_ru", "@cspell/dict-fr-fr"],
          "language": "fr,en,ru",  // <-- to enable French, English and Russian
        }
      }
    ]

It is recommended to use a cspell.json or cspell.config.yaml file for more control.

cspell.config.yaml

import:
  - '@cspell/dict-fr-fr'
  - '@cspell/dict-ru_ru'
  - '@cspell/dict-de-de'
overrides:
  - filename: 'i18n/ru/**'
    language: 'ru'
  - filename: 'i18n/fr/**'
    language: 'fr'

Copy link
Contributor

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants