Change ltex-ls settings

Hi all,

I am trying to change the language setting for the ltex-ls language server.
I’m using the nvim-lspconfig and nvim-lsp-installer plugins (having used the latter to install ltex-ls).

Following these instructions, I did:

local lsp_installer = require("nvim-lsp-installer")

-- Create tables with changed server options if you want to deviate from the
-- default settings

local server_opts = {
    -- Provide settings that should only apply to "server-name" server
    ["ltex-ls"] = function(opts)
        opts.settings = {
        ltex =  {
            language = "en-GB"
        },
    }
    end,
}

-- Register a handler that will be called for all installed servers.
-- Alternatively, you may also register handlers on specific server instances instead (see example below).
lsp_installer.on_server_ready(function(server)
    -- Cpecify the default options which we'll use to setup all servers
    local opts = {
        on_attach = on_attach,
    }

    if server_opts[server.name] then
        -- Enhance the default opts with the server-specific ones
        server_opts[server.name](opts)
    end

    -- This setup() function is exactly the same as lspconfig's setup function.
    -- Refer to https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md
    server:setup(opts)
end)

I’m probably doing something silly, but I’m not sure what!

On that note, would it be possible to add multiple languages to ltex-ls, or switch the selected language easier than by editing the configs?

Any help would be appreciated! Thanks.

I know this is a bit late, but I came across this today so I thought I would share my findings.
There is this blog that explains how to configure ltex-ls with nvim.

On that note, would it be possible to add multiple languages to ltex-ls, or switch the selected language easier than by editing the configs?

Note that you can set language to auto for auto but it’s not recommend since it will not give spelling advice. (I’m also still looking for a way to quickly switch the language)