Translate code comments
Translates code comments + docstrings to a target language, preserving code style.
For internationalising open source / sharing repos with multilingual teams.
The prompt
Copy this into ChatGPT, Claude, Gemini or any assistant you already use β then paste your own code + target language underneath it.
Translate the code comments + docstrings to the target language. Rules: - Translate comments + docstrings ONLY - Do NOT change code, identifiers, or strings - Preserve indentation + format exactly - Keep technical terms (HTTP, API, GET, JSON, etc.) in English unless commonly translated - Match the comment style of the language (// vs # vs /* */) Output the translated file as-is. Rules: - Preserve code byte-for-byte. - Don't translate string literals.
Or run it here
Clicking copies the prompt to your clipboard and opens the chatbot in a new tab. Gemini doesn't accept URL params β paste manually with Ctrl/Cmd+V.
Related prompts
Corrects + explains errors in your second-language writing β like a tutor would.
Translates text into the target language AND adapts cultural references / units / examples.
Rewrites text in a different tone (formal β casual / friendly β professional / etc.).
Explains a grammar rule with examples + counter-examples + 3 practice sentences.
10 high-value vocabulary words for a topic β definitions, examples, mnemonics.
IPA + phonetic spelling for a word/name/phrase in the requested language.
Browse the full free AI prompt library or see more translation & language prompts.