A Claude Code skill that edits your source files in place — adding a translated comment line below every comment you've already written. Write naturally in your primary language, run one command, done.
Works with any language pair and any programming language that uses comments.
- Write your code and comments as you normally would
- Run
/bilingual-comment --to <lang-code>in Claude Code - Claude reads the open file, translates every comment, and edits the file directly
No copy-pasting. No switching tools.
claude plugin install bilingual-comment# Translate comments in the currently open file
/bilingual-comment --to <lang-code>
# Translate comments across the entire repo
/bilingual-comment --to <lang-code> --repoFor the single-file mode, have the file open in the IDE. For --repo, Claude asks for confirmation before touching anything — it reports how many files it found first.
Before:
// Calculate the tax rate for the given region
function getTaxRate(region: string): number {After /bilingual-comment --to ja:
// Calculate the tax rate for the given region
// 指定された地域の税率を計算する
function getTaxRate(region: string): number {Before:
# Initialize the connection pool
def init_pool():After /bilingual-comment --to zh:
# Initialize the connection pool
# 初始化连接池
def init_pool():Before:
/* Handle user authentication errors */After /bilingual-comment --to es:
/* Handle user authentication errors */
/* Manejar errores de autenticación de usuario */Before:
<!-- Navigation menu -->After /bilingual-comment --to ko:
<!-- Navigation menu -->
<!-- 탐색 메뉴 -->Description text is translated. @param/@returns tags are left in the original language to preserve IDE tooling.
Before:
/**
* Fetches a user record from the database by their unique ID.
* @param id - The user's unique identifier
* @returns The user object, or null if not found
*/
async function getUserById(id: string): Promise<User | null> {After /bilingual-comment --to ja:
/**
* Fetches a user record from the database by their unique ID.
* @param id - The user's unique identifier
* @returns The user object, or null if not found
*/
/**
* ユニークIDでデータベースからユーザーレコードを取得します。
* @param id - The user's unique identifier
* @returns The user object, or null if not found
*/
async function getUserById(id: string): Promise<User | null> {| Style | Languages |
|---|---|
// |
JavaScript, TypeScript, Go, Java, C, C++, Rust, Swift, Kotlin, PHP |
# |
Python, Ruby, Shell, YAML, R, Perl |
-- |
SQL, Lua, Haskell |
/* */ |
C-family, JavaScript, TypeScript, CSS |
<!-- --> |
HTML, XML, Markdown |
/** */ |
JavaScript, TypeScript, Java (JSDoc/Javadoc) |
Already-translated comments are skipped. Running the command twice on the same file is safe.
See language-codes.md. Common codes:
| Code | Language |
|---|---|
ja |
Japanese |
zh |
Chinese (Simplified) |
zh-tw |
Chinese (Traditional) |
ko |
Korean |
es |
Spanish |
fr |
French |
de |
German |
pt |
Portuguese |
ar |
Arabic |
hi |
Hindi |