Skip to content

Introduction

variable-translator is a VSCode extension that automatically detects any non-English characters (Chinese, Japanese, Korean, Russian, etc.) in file paths or selected text and translates them into properly-cased English.

Know exactly what to name something in your native language, but stuck on the English? Just type it as-is and let the extension translate it into camelCase, snake_case or any of the 8 supported naming formats.

Core Features

FeatureTriggerDescription
File path translationCreate file/folder in ExplorerDetects non-English path segments and translates them on creation
Selection translationAlt+Shift+TTranslates and replaces the selected text
Translate & copyAlt+Shift+CWrites the translation in multiple formats to the clipboard history
Undo translationAlt+Shift+Z / Ctrl+ZUndoes a file translation within 1 minute and cleans up created directories (Ctrl+Z only when focus is outside text input areas)
File translation toggleAlt+Shift+DQuickly enables/disables file path translation
Switch serviceAlt+Shift+SSwitches between 7 translation services

Highlights

  • Automatic language detection: no source language needed — any non-English characters are recognized
  • 8 naming formats: camelCase, PascalCase, snake_case, CONSTANT_CASE, param-case, Header-Case, Capital Case, no case
  • Multiple translation services: OpenAI, Google Translate, Bing/Azure, DeepLX, Baidu, Tencent and Pinyin
  • Automatic fallback: failed services fall back by priority, ending with Pinyin — translation never fails
  • Timeout protection: a global 10-second translation timeout keeps the editor responsive
  • Zero configuration: the default Pinyin service works out of the box, no API key required

Supported Languages

The extension automatically detects and translates the following languages into English:

LanguageExample
Chinese用户名称 → userName
Japaneseユーザー名 → userName
Korean사용자 이름 → userName
RussianИмя пользователя → userName
OthersAny non-English characters

Naming Formats

File Translation Formats

FormatExampleDescription
camelCaseuserNameLower camel case
PascalCaseUserNameUpper camel case
snake_caseuser_nameUnderscore-separated, lowercase
CONSTANT_CASEUSER_NAMEUnderscore-separated, uppercase
param-caseuser-nameHyphen-separated, lowercase
Header-CaseUser-NameHyphen-separated, capitalized

Additional Formats for Selection Translation

FormatExampleDescription
Capital CaseUser NameSpace-separated, capitalized
no caseuser nameSpace-separated, lowercase

Next Steps

Released under the MIT License.