Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>gk-i18n-allyNew to Visual Studio Code? Get it now.
gk-i18n-ally

gk-i18n-ally

yuanguolu

|
3 installs
| (1) | Free
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

GK i18n 功能插件

目前只支持单文件结构,如 lang.json: { 'zh-cn': { ... }; 'en': { ... } }

功能

  • 跳转功能

    跳转到语言 json 定义文件单词位置,如 t('aa.bb') 点击 bb 时跳转,点击 aa 不会跳转
  • hover 功能

    鼠标移入时显示字符,如 t('aa.bb') 鼠标移入字符 bb 时显示中文,鼠标移入字符 aa 不显示
  • 显示中文

    在编辑器内会显示对应中文,如 t('aa.bb') 会显示成 t('aa.bb' 对应中文文字)
  • 查找引用功能

    在 json 文件里右键菜单引用功能,能找到使用引用的地方,如 t('aa.bb')

匹配规则

{
  "gk-i18n-ally.matchRules": {
    // key 表示要匹配的函数名称
    "t1": {},
    // 不包含局部匹配的只从全局文件 gk-i18n-ally.globalFiles 查找
    "t": {},
    "$t": {},
    "tgk": {
      // prefix 表示匹配时加上前缀,如 tgk = (key: any, ...args: any[]) = t('gk.' + key, ...args)
      "prefix": "gk."
    },
    "lang": {
      // objectCall 对象调用模式,如 lang.aa.bb
      "objectCall": true
    }
  }
}
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft