Skip to content

[FEATURE]: Per-language words #297

Open

Description

@matterhorn103

Feature Description

Thanks to all who've worked on this project, it's a big part of making it practical to work on LaTeX or Typst documents in Zed!

The ability to have multiple dictionaries active at the same time is very useful, but there's no way to add words to the dictionary only for a specific language – it would be great to have this.

Currently, the words list unfortunately ends up being a mixture of different languages:

dictionaries = ["en_gb", "de"]

words = ["redox", "upstreamed", "quelloffen"]

Unless I'm mistaken this means that "quelloffen" becomes an acceptable (and presumably also suggested) word when writing in English, even if there's a project configuration file that sets the dictionary for the project to be exclusively English, or even if an LSP overrides the dictionary setting based on a markup tag in the file.

Use Case

I feel that for people who regularly work in more than one language this is fairly essential, to avoid false negatives and incorrect suggestions.

Proposed Solution

words could, rather than being a list, simply be a table with the applicable language tag as keys, and the correct one is selected based on the active language:

dictionaries = ["en_gb", "de"]

words.global = ["redox"]
words.en_gb = ["upstreamed"]
words.de = ["quelloffen"]

Alternative Solutions

You could just rely on per-project configuration, but that loses the convenience of the global configuration.

Examples

No response

Additional Context

No response

Activity

  1. blopker commented on Jul 22, 2026

    @blopker
    Owner

    Hey! Thanks for the kind words. From what I've seen, people that tend to have mixed spoken language files, also tend to bifurcate those files in the filesystem hierarchy, e.g. keep them in separate folders. Think a multilanguage documentation site. After a bit of user research, I could not find anyone that wanted multiple spoken languages in the same file (multiple programming languages in one file, sadly, is a different story).

    With that in mind, I designed the config 'Scoped Overrides' for this use case: https://github.com/blopker/codebook#scoped-overrides

    This will let you add or replace values for the top level config based on file globs. Let me know if that helps!

  2. matterhorn103 commented on Jul 24, 2026

    @matterhorn103
    Author

    That's definitely useful and makes it possible to do it, and is something I wasn't aware of, so thanks for the response and for pointing it out!

    It still remains not all that convenient though, since configuration has to be set up per-project or per-file manually every time, either with additional config files, or by adding a glob pattern to the top level, rather than just being able to apply automatically to all files in that language.

    If you want a concrete use-case to have in mind, the need for this arose for me because I am writing cover letters for job applications in both English and German, and the letters live side-by-side in a folder. Splitting them up by language would work but having the tree structure of a project dictated by spellchecking seems a bit extreme, that's all! 😄

  3. blopker commented on Jul 24, 2026

    @blopker
    Owner

    Thanks for the use case, this is helpful, I'll keep it in mind. Although, since the files can't be named the same, there must be some naming convention? The globs can be something like *.de.md or similar.

    The proposed solution could work, but would require a significant rework of internals, and maybe some breaking changes in the config format, which is why I'm invested in finding a workaround...

  4. matterhorn103 commented on Jul 25, 2026

    @matterhorn103
    Author

    Although, since the files can't be named the same, there must be some naming convention? The globs can be something like *.de.md or similar.

    Currently not, but yes, that's also an option, good suggestion.

    The proposed solution could work, but would require a significant rework of internals, and maybe some breaking changes in the config format, which is why I'm invested in finding a workaround...

    That's fair enough, it's not urgent in any case, just something that'd be nice to have – something to be added if you ever happen to be making breaking changes anyway, for example. No stress.

    Perhaps there's a way to do it that wouldn't be breaking, maybe by something similar to the overrides mechanism:

    dictionaries = ["en_gb"]
    words = ["redox"]
    
    [[langs]]
    lang = "de"
    dictionaries = ["de"]
    extra_words = ["quelloffen"]

    Or langs could be a table to make it less verbose, of course, i.e. you'd then do [langs.de].

    Or, as what would tbh be the simplest solution, you could even just build on the [[overrides]] mechanism and add the language as an additional optional filter that is applied additionally to any file glob:

    dictionaries = ["en_gb"]
    words = ["redox"]
    
    [[overrides]]
    langs = ["de"]
    dictionaries = ["de"]
    extra_words = ["quelloffen"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions