Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>火山翻译(Hi宝版)New to Visual Studio Code? Get it now.
火山翻译(Hi宝版)

火山翻译(Hi宝版)

Hi 宝

|
9 installs
| (1) | Free
简单、高效、自定义替换、自定义生成key、收集翻译文案,高效完成国际化开发。
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

使用

选中想要翻译的文案,连按两次 ctrl+e ctrl+e

说明

  • 中->英,才会执行替换操作,会在本地生成一个 local-translate.json 的文件,方便你去后续用 nodejs 加工整理
  • 英->中,会将翻译后的中文提醒在右下角(Trae 需要在右下角关闭勿扰才会弹出提醒)
  • 可以使用默认的 key,也可以自定义生成 key

内置的配置(可以自己配置)

module.exports = {
  accessKeyId: '********', //作者自己申请的
  secretKey: '********',//作者自己申请的
  replaceText: '【key】',
  underline: true, // 启用下划线拼接
  prefix: 'i18n_key', // 前缀
  writeFile:false // 不开启记录文件
}

自己配置

需要在项目根目录下,配置 translate.config.js 文件,修改配置文件后需要重新加载

module.exports = {
  accessKeyId: '********', // 你自己申请的,可不填,不填还是用作者的,但是你的翻译记录会会记录在作者那里哦~
  secretKey: '********',
  replaceText: 'i18n.t(`【key】`)', // 此处的“【key】”用作替换key的,同理,还有before、after
  underline: true, // 启用下划线拼接,如果不满足,用generateKey你可以自定义
  prefix: 'text_', // 几乎每个项目都有一些前缀
  generateKey:(path, before, key)=>void, // 这里的path为路径参数,此函数优先级高于underline、prefix配置
  writeFile:boolean, // 是否写入文件,默认false
}

申请

需要申请火山翻译的:accessKeyId、secretKey

火山翻译申请地址:https://www.volcengine.com/docs/4640/130872

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