{"id":44826026,"url":"https://github.com/noir4y/comment-translate.nvim","last_synced_at":"2026-04-15T19:00:47.967Z","repository":{"id":331641978,"uuid":"1131655535","full_name":"noir4y/comment-translate.nvim","owner":"noir4y","description":"Translate code comments and strings in Neovim using online or local LLMs and external translators.","archived":false,"fork":false,"pushed_at":"2026-02-15T02:42:53.000Z","size":485,"stargazers_count":11,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-04T14:06:06.709Z","etag":null,"topics":["developer-tools","llm","local-llm","localllm","neovim","neovim-plugin","ollama","translation","treesitter"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/noir4y.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-10T12:50:38.000Z","updated_at":"2026-03-30T09:40:13.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/noir4y/comment-translate.nvim","commit_stats":null,"previous_names":["noir4y/comment-translate.nvim"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/noir4y/comment-translate.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noir4y%2Fcomment-translate.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noir4y%2Fcomment-translate.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noir4y%2Fcomment-translate.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noir4y%2Fcomment-translate.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/noir4y","download_url":"https://codeload.github.com/noir4y/comment-translate.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/noir4y%2Fcomment-translate.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31855432,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-15T15:24:51.572Z","status":"ssl_error","status_checked_at":"2026-04-15T15:24:39.138Z","response_time":63,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["developer-tools","llm","local-llm","localllm","neovim","neovim-plugin","ollama","translation","treesitter"],"created_at":"2026-02-16T22:00:42.455Z","updated_at":"2026-04-15T19:00:47.961Z","avatar_url":"https://github.com/noir4y.png","language":"Lua","readme":"# comment-translate.nvim\n\n[![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n[![Neovim](https://img.shields.io/badge/Neovim-%3E=0.8-blue)](https://neovim.io)\n\nTranslate comments and strings directly in Neovim using hover or immersive inline views.\nSupports classic translation APIs as well as LLM backends, including fully local models via Ollama.\n\n![Hover translation demo](assets/demo.gif)\n\n## Why This Plugin\n\nMany translation plugins rely on external services only. `comment-translate.nvim` is designed for teams and individuals who want a practical choice:\n\n- Use hosted providers when you want quality and speed.\n- Use local LLMs when you need stronger privacy and control.\n- Keep your translation workflow inside Neovim.\n\n## Key Benefits\n\n- LLM translation support (`openai`, `anthropic`, `gemini`, `ollama`)\n- Local LLM workflow via Ollama (no source text sent to cloud APIs)\n- Hover translation for quick understanding\n- Immersive inline translation mode\n- Replace selected text with translation\n- Tree-sitter aware comment/string detection\n\n## Security and Privacy\n\nThis plugin gives you control over where your text goes:\n\n- `translate_service = 'google'` or hosted `llm` providers: text is sent to the configured remote service.\n- `llm.provider = 'ollama'` with the default local endpoint keeps translation local; if `llm.endpoint` is set to a remote host, text is sent there.\n- Cache is in-memory only and is not persisted to disk by this plugin.\n\nFor sensitive repositories, local Ollama models are the recommended setup.\n\n## Requirements\n\n- Neovim 0.8+\n- `curl`\n- [plenary.nvim](https://github.com/nvim-lua/plenary.nvim) (required)\n- Tree-sitter parser support for the languages you want to inspect (recommended)\n\nNote: Internet is not required when you use local translation only (for example, Ollama running locally).\n\nParsers may come from bundled Neovim parsers, manual installation, or\nparser-providing plugin setups such as `nvim-treesitter`.\n`comment-translate.nvim` uses Neovim's built-in Tree-sitter APIs and does not\nrequire the `nvim-treesitter` plugin itself.\n\n## Installation\n\n### lazy.nvim\n\n```lua\n{\n  'noir4y/comment-translate.nvim',\n  dependencies = {\n    'nvim-lua/plenary.nvim',\n  },\n  config = function()\n    require('comment-translate').setup({})\n  end,\n}\n```\n\n### packer.nvim\n\n```lua\nuse {\n  'noir4y/comment-translate.nvim',\n  requires = {\n    'nvim-lua/plenary.nvim',\n  },\n  config = function()\n    require('comment-translate').setup({})\n  end,\n}\n```\n\nIf you already manage parsers through `nvim-treesitter`, you can keep doing so.\n\n## Usage\n\n### Hover Translation\n\n```lua\nvim.keymap.set('n', '\u003cleader\u003eth', '\u003ccmd\u003eCommentTranslateHover\u003cCR\u003e', { silent = true })\n```\n\n### Immersive Translation\n\n```vim\n:CommentTranslateToggle\n```\n\n### Replace Selected Text\n\n```vim\n:CommentTranslateReplace\n```\n\n## Configuration\n\n```lua\nrequire('comment-translate').setup({\n  target_language = 'ja',\n  translate_service = 'google', -- 'google' or 'llm'\n\n  hover = {\n    enabled = true,\n    delay = 500,\n    auto = true,\n  },\n\n  immersive = {\n    enabled = false,\n  },\n\n  cache = {\n    enabled = true,\n    max_entries = 1000,\n  },\n\n  targets = {\n    comment = true,\n    string = true,\n  },\n\n  llm = {\n    provider = 'ollama', -- 'openai' | 'anthropic' | 'gemini' | 'ollama'\n    model = 'translategemma:4b',\n    api_key = nil, -- not required for ollama\n    timeout = 20,\n    endpoint = 'http://localhost:11434/api/chat', -- optional\n  },\n\n  keymaps = {\n    hover = '\u003cleader\u003eth',\n    hover_manual = '\u003cleader\u003etc',\n    replace = '\u003cleader\u003etr',\n    toggle = '\u003cleader\u003ett',\n  },\n})\n```\n\n## LLM Provider Examples\n\n### Local (Ollama)\n\n```lua\nrequire('comment-translate').setup({\n  translate_service = 'llm',\n  llm = {\n    provider = 'ollama',\n    model = 'translategemma:4b',\n  },\n})\n```\n\n### Hosted (OpenAI)\n\n```lua\nrequire('comment-translate').setup({\n  translate_service = 'llm',\n  llm = {\n    provider = 'openai',\n    api_key = vim.env.OPENAI_API_KEY,\n    model = 'gpt-5.2',\n  },\n})\n```\n\n## Commands\n\n- `:CommentTranslateHover`       — Display translation under cursor\n- `:CommentTranslateHoverToggle` — Toggle auto hover on/off\n- `:CommentTranslateReplace`     — Replace selected text with translation\n- `:CommentTranslateToggle`      — Toggle immersive translation globally\n- `:CommentTranslateUpdate`      — Update immersive translation for current buffer\n- `:CommentTranslateSetup`       — Setup plugin with default settings\n- `:CommentTranslateHealth`      — Health check, including parser availability for the buffer that invoked it\n\nUse `:checkhealth comment-translate` for general dependency and configuration checks.\nUse `:CommentTranslateHealth` from the file buffer you want to inspect when you\nalso want parser availability checked for that buffer.\n\n## Development\n\n- Format: `make fmt`\n- Format check: `make fmt-check`\n- Lint: `make lint`\n- Test: `make test`\n\n## License\n\nMIT\n","funding_links":[],"categories":["Language"],"sub_categories":["Assembly"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoir4y%2Fcomment-translate.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnoir4y%2Fcomment-translate.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnoir4y%2Fcomment-translate.nvim/lists"}