Skip to main content
7BBusyBoss

Translate code comments

Translates code comments + docstrings to a target language, preserving code style.

For internationalising open source / sharing repos with multilingual teams.

Translation & Languagecodei18n

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

0/8000
Output will appear here after you click Run.
Or run in your favourite chatbot

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.

Browse the full free AI prompt library or see more translation & language prompts.