Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Intl Hover HelperNew to Visual Studio Code? Get it now.
Intl Hover Helper

Intl Hover Helper

Blacklake-BF

|
2 installs
| (0) | Free
Show Chinese text hints for intl.get() calls by hovering over the code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Intl Hover Helper

一个 VSCode 插件,用于在鼠标悬停时显示 intl.get('xxx') 对应的中文文案。

功能

  • 自动检测代码中的 intl.get('xxx') 模式
  • 从 i18n/config.json 配置文件中读取多语言文件路径
  • 在中文 JSON 文件中查找对应的 key
  • 鼠标悬停时显示中文文案提示

使用方法

1. 配置文件结构

在项目根目录创建 i18n/config.json 文件,配置多语言文件路径:

{
  "zh-CN": "i18n/locales/zh-CN.json",
  "en-US": "i18n/locales/en-US.json"
}

2. 多语言文件

创建对应的多语言 JSON 文件,例如 i18n/locales/zh-CN.json:

{
  "common": {
    "confirm": "确认",
    "cancel": "取消"
  },
  "welcome": "欢迎"
}

3. 代码中使用

在代码中编写 intl.get('xxx') 时,将鼠标悬停在代码上即可看到对应的中文文案:

const text = intl.get('common.confirm'); // 悬停显示: 确认
const welcome = intl.get('welcome'); // 悬停显示: 欢迎

发布到 VSCode 插件商店

1. 安装 vsce

npm install -g @vscode/vsce

2. 登录到 Visual Studio Marketplace

vsce login <your-publisher-name>

3. 打包插件

vsce package

4. 发布插件

vsce publish

开发

# 安装依赖
npm install

# 编译
npm run compile

# 监听模式编译
npm run watch

许可证

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft