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

Setting default_source and default_target does not work. #17

Closed
atishdhu opened this issue Jul 15, 2023 · 2 comments
Closed

Setting default_source and default_target does not work. #17

atishdhu opened this issue Jul 15, 2023 · 2 comments

Comments

@atishdhu
Copy link

atishdhu commented Jul 15, 2023

My config

I want to set default engine to google and its default_source to english and default_target to french. I have the following config in plugins.lua:

{
    "potamides/pantran.nvim",
    event = "VimEnter",
    config = function()
      require("pantran").setup({
        default_engine = "google",
        engines = {
          google = {
            default_source = "auto",
            default_target = "fr"
          },
        },
      })
    end
  },

I also tried with:

{
    "potamides/pantran.nvim",
    event = "VimEnter",
    config = function()
      require("pantran").setup({
        default_engine = "google",
        engines = {
          google = {
            config = {
              default_source = "auto",
              default_target = "fr"
            }
          },
        },
      })
    end
  },

Expectation

Source is auto and target is french when i execute :Pantran.

Actual Result

Source is auto and target is english when i execute :Pantran.

@potamides
Copy link
Owner

You are probably using the fallback endpoint, so you need to use the following configuration keys. On a side note, this seems to be a reoccurring point of confusion, so this should be documented better.

@atishdhu
Copy link
Author

I updated the config and it works now, thank you.

{
    "potamides/pantran.nvim",
    event = "VimEnter",
    config = function()
      require("pantran").setup({
        default_engine = "google",
        engines = {
          google = {
            fallback = {
              default_source = "auto",
              default_target = "fr"
            }
          },
        },
      })
    end
  },

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

No branches or pull requests

2 participants