Home

Awesome

<div align="center"> <b>English</b> | <a href="./README-ja.md">日本語(原文|Original)</a> </div> <br />

⚠︎ This file is translated and updated by ChatGPT based on the original text.

<br />

🌐 js-i18n.nvim

GitHub Release tests

js-i18n.nvim is a Neovim plugin that supports JavaScript i18n libraries.

<div> <video src="https://github.com/user-attachments/assets/abcd728d-42d1-46d2-8d18-072102b1cf71" type="video/mp4" /> </div>

🚧 Status

[!WARNING] This plugin is still under development and is optimized for the developer's use cases.

✨ Features

Supported Libraries

i18next, react-i18next

i18next-screenshot

next-intl

next-intl-screenshot

✅ Requirements

📦 Installation

lazy.nvim

{
  "nabekou29/js-i18n.nvim",
  dependencies = {
    "neovim/nvim-lspconfig",
    "nvim-treesitter/nvim-treesitter",
    "nvim-lua/plenary.nvim",
  },
  event = { "BufReadPre", "BufNewFile" },
  opts = {}
}

📚 Usage

Commands

⚙️ Configuration

The default settings are as follows. For omitted parts, refer to config.lua.

{
  primary_language = {}, -- The default language to display (initial setting for displaying virtual text, etc.)
  translation_source = { "**/{locales,messages}/*.json" }, -- Pattern for translation resources
  detect_language = ..., -- Function to detect the language. By default, a function that detects the language heuristically from the file name is used.
  key_separator = ".", -- Key separator
  virt_text = {
    enabled = true, -- Enable virtual text display
    format = ..., -- Format function for virtual text
    conceal_key = false, -- Hide keys and display only translations
    fallback = false, -- Fallback if the selected virtual text cannot be displayed
    max_length = 0, -- Maximum length of virtual text. 0 means unlimited.
    max_width = 0, -- Maximum width of virtual text. 0 means unlimited. (`max_length` takes precedence.)
  },
  diagnostic = {
    enabled = true, -- Enable the display of diagnostic information
    severity = vim.diagnostic.severity.WARN, -- Severity level of diagnostic information
  },
}

⬆️ Roadmap