Skip to content

Configuration

Overview

SettingTypeDefaultDescription
enableFileTranslationbooleantrueEnable file path translation
translationServicestring"copilot"Current translation service (copilot maps to Pinyin)
servicePrioritystring"copilot,openai,google,bing,deeplx,baidu,tencent"Service priority for fallback (high to low, comma-separated)
copyToClipboardbooleanfalseAuto-copy the result to the clipboard after translation
clipboardFormatsstring[][]Naming formats to write to the clipboard history
servicesobject{}API keys / endpoints per service

All settings are prefixed with variableTranslator. — search variableTranslator in VSCode Settings (Ctrl+,).

Settings in Detail

enableFileTranslation

  • Type: boolean
  • Default: true
  • Description: Enables file path translation (translate on file/folder creation). Also toggled via Alt+Shift+D
json
{
  "variableTranslator.enableFileTranslation": true
}

translationService

  • Type: string
  • Default: "copilot"
  • Values: "copilot" | "openai" | "google" | "bing" | "deeplx" | "baidu" | "tencent"
  • Description: The translation service to use. Also switched via Alt+Shift+S

copilot means Pinyin

copilot is a legacy value that actually maps to the Pinyin service (zero configuration, works offline). It shows up as "拼音 (Pinyin)" in the service picker.

json
{
  "variableTranslator.translationService": "openai"
}

servicePriority

  • Type: string
  • Default: "copilot,openai,google,bing,deeplx,baidu,tencent"
  • Description: Fallback priority (high to low, comma-separated). When the current service fails, the next one is tried in this order; invalid names are filtered out
json
{
  "variableTranslator.servicePriority": "openai,google,bing,deeplx,baidu,tencent"
}

copyToClipboard

  • Type: boolean
  • Default: false
  • Description: Auto-copy the result to the clipboard after translation (applies to both selection and file path translation)
json
{
  "variableTranslator.copyToClipboard": true
}

clipboardFormats

  • Type: string[]
  • Default: []
  • Description: Naming formats written to the clipboard history in order (the format you pick goes first)

Values:

  • camelCase
  • PascalCase
  • snake_case
  • CONSTANT_CASE
  • param-case
  • Header-Case
  • Capital Case
  • no case
  • originalValue — the pre-translation text
json
{
  "variableTranslator.clipboardFormats": [
    "camelCase",
    "originalValue",
    "PascalCase",
    "no case",
    "snake_case",
    "CONSTANT_CASE",
    "param-case",
    "Header-Case",
    "Capital Case"
  ]
}

services

  • Type: object
  • Default: {}
  • Description: Per-service configuration (services that need no configuration can be omitted — Pinyin and DeepLX work without any)
json
{
  "variableTranslator.services": {
    "openai": {
      "apiKey": "sk-xxx",
      "baseUrl": "https://api.openai.com",
      "model": "gpt-3.5-turbo"
    },
    "google": {
      "apiKey": "your-google-api-key"
    },
    "bing": {
      "apiKey": "your-api-key",
      "region": "global"
    },
    "deeplx": {
      "baseUrl": "http://127.0.0.1:1188"
    },
    "baidu": {
      "appId": "xxx",
      "secretKey": "xxx"
    },
    "tencent": {
      "secretId": "xxx",
      "secretKey": "xxx",
      "region": "ap-guangzhou"
    }
  }
}

Service Configuration

OpenAI

json
{
  "variableTranslator.services": {
    "openai": {
      "apiKey": "your-api-key",
      "baseUrl": "https://api.openai.com",
      "model": "gpt-3.5-turbo"
    }
  }
}
ParameterDescriptionDefaultWhere to get
apiKeyOpenAI API Key (required)-https://platform.openai.com/api-keys
baseUrlAPI base URLhttps://api.openai.comAny OpenAI-compatible API
modelModel namegpt-3.5-turboAny OpenAI-compatible model

Google Translate

json
{
  "variableTranslator.services": {
    "google": {
      "apiKey": "your-google-api-key"
    }
  }
}
ParameterDescriptionWhere to get
apiKeyGoogle Cloud Translation API Key (required)Enable the Cloud Translation API in Google Cloud Console, then create a key

Bing / Azure Translator

json
{
  "variableTranslator.services": {
    "bing": {
      "apiKey": "your-api-key",
      "region": "global"
    }
  }
}
ParameterDescriptionDefaultWhere to get
apiKeyAzure Translator API Key (required)-https://portal.azure.com/
regionAzure Translator regionglobalYour Azure resource region

DeepLX

json
{
  "variableTranslator.services": {
    "deeplx": {
      "baseUrl": "http://127.0.0.1:1188"
    }
  }
}
ParameterDescriptionDefault
baseUrlDeepLX endpointhttp://127.0.0.1:1188

Baidu Translate

json
{
  "variableTranslator.services": {
    "baidu": {
      "appId": "your-app-id",
      "secretKey": "your-secret-key"
    }
  }
}
ParameterDescriptionWhere to get
appIdBaidu Translate APP_ID (required)https://fanyi-api.baidu.com/
secretKeyBaidu Translate Secret Key (required)https://fanyi-api.baidu.com/

Tencent Translator

json
{
  "variableTranslator.services": {
    "tencent": {
      "secretId": "your-secret-id",
      "secretKey": "your-secret-key",
      "region": "ap-guangzhou"
    }
  }
}
ParameterDescriptionDefaultWhere to get
secretIdTencent Cloud SecretId (required)-https://console.cloud.tencent.com/cam/capi
secretKeyTencent Cloud SecretKey (required)-https://console.cloud.tencent.com/cam/capi
regionService regionap-guangzhouSee Tencent region docs

Services Requiring No Configuration

  • Pinyin (copilot): zero configuration, works offline, converts CJK characters to pinyin — the final safety net when all services fail
  • DeepLX: default endpoint http://127.0.0.1:1188 with automatic health checks (60s cache); just deploy it locally

Full Example

Copy what you need into settings.json:

json
{
  // Enable file path translation (translate on file creation)
  "variableTranslator.enableFileTranslation": true,

  // Translation service: copilot(Pinyin) | openai | google | bing | deeplx | baidu | tencent
  "variableTranslator.translationService": "openai",

  // Fallback priority (high to low, comma-separated)
  "variableTranslator.servicePriority": "copilot,openai,google,bing,deeplx,baidu,tencent",

  // Auto-copy the result to the clipboard after translation
  "variableTranslator.copyToClipboard": true,

  // Naming formats written to the clipboard history in order
  "variableTranslator.clipboardFormats": [
    "camelCase",
    "originalValue",
    "PascalCase",
    "no case",
    "snake_case",
    "CONSTANT_CASE",
    "param-case",
    "Header-Case",
    "Capital Case"
  ],

  // Per-service configuration (omit services you don't use)
  "variableTranslator.services": {
    "openai": {
      "apiKey": "sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
      "baseUrl": "https://api.openai.com",
      "model": "gpt-3.5-turbo"
    },
    "google": {
      "apiKey": "your-google-api-key"
    },
    "bing": {
      "apiKey": "your-api-key",
      "region": "global"
    },
    "deeplx": {
      "baseUrl": "http://127.0.0.1:1188"
    },
    "baidu": {
      "appId": "your-app-id",
      "secretKey": "your-secret-key"
    },
    "tencent": {
      "secretId": "your-secret-id",
      "secretKey": "your-secret-key",
      "region": "ap-guangzhou"
    }
  }
}

Released under the MIT License.