Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Starling Assistant【薪酬】New to Visual Studio Code? Get it now.
Starling Assistant【薪酬】

Starling Assistant【薪酬】

xuruitao

|
10 installs
| (0) | Free
starling 翻译插件,适用于商业化薪酬团队
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

starling-assistant

Starling 自动上传、发布文案、自动同步到本地插件

https://bytedance.larkoffice.com/docx/EmyGdonwXoEfENxiJsecWYWdnOh

特性

  • 支持自动补全替换
  • 支持新词条直接添加到 Starling 任务中,且允许撤销
  • 支持 monorepo 项目,自动初始化配置
  • 支持上传文案后执行本地指令

设置

在.vscode/settings.json添加配置:https://bytedance.larkoffice.com/wiki/J7wmwhqSCi3Xm4kHHqycoKfDnPg

interface StarlingConfig {
  ak: string; // 从 https://starling.bytedance.net/personal_center#aksk 获取
  sk: string; // 从 https://starling.bytedance.net/personal_center#aksk 获取
  interval?: number; // 定时更新文案到插件空间时间,默认 5min,不能低于 1 分钟
  afterUploadCMD?: string; // 上传完成后执行的指令,会在 interval 期间执行一次,如"emo run starling"
  template?: string; // 要生成的翻译函数,可根据业务实际内容进行配置 i18n.t('${key}', ${variable}, '${value}')
  prefillLocales?: string[]; // 需要预填充的语言,即将源文案填充为目标文案,有配置时才会自动预填充
  reportTag?: boolean; // 是否要求上传 tag,tag 在 starling 平台配置,默认为 false
  projectId: number; // starling 项目 id
  namespaceId: number[]; // 关联的空间id
  conflictKeyPrefix?: string; // 冲突时添加的前缀
  keyGenerate?: {
    type: 'source' | 'stringHash' | 'MT'; // MT : 机翻生成,stringHash : hash生成, source: 源文案
    prefix?: string;
    suffix?: string;
    // slot 插槽,可在 key 中指定位置插入自定义内容
    slot?: Array<{
      location: 'before prefix' | 'after prefix' | 'before suffix' | 'after suffix';
      value:
        | {
            type: 'select';
            placeHolder?: string;
            options: Array<{
              label: string;
              value: string;
            }>;
          }
        | string;
    }>;
  };
  folderConfig?: {
    [folderName: string]: {}; // 与外层一致,除了 ak sk interval 外的配置
  };
}

const config: StarlingConfig = {
  ak: "",
  sk: "",
  interval: 5,
  template: "i18n.intl('${key}')",
  prefillLocales: ["zh"],
  reportTag: true,
  keyGenerate: {
    type: "source"
  },
  projectId: 665,
  namespaceId: [123],
  conflictKeyPrefix: "resolve.",
  folderConfig: {
    calculate: {
      namespaceId: [123],
      conflictKeyPrefix: "calculate."
    }
  }
};

使用

  • 中文:输入中文后,按下空格,会有自动补全提示
  • 非中文:高亮选中文案,右键选择“[starling] 添加文案”,会自动添加到 starling 任务中

快捷方式

  • ctrl + f11 添加文案(可在 vscode 快捷方式中更改)

参考

starling 错误码:https://starling.bytedance.net/open/content/10573/165924 接口&接口测试:https://starling.bytedance.net/open/content/9163/274789

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