# How to translate a web page and keep its code blocks intact

In DualTrans, select the bilingual display mode and translate the page. It adds translations alongside the original prose and leaves code blocks in place, so you can still copy commands and examples.

## Steps

### 1. Open a page with prose and code

Try the Ky README on GitHub. Scroll to Install so you can compare the text and the npm install ky command before and after translation.

- [Open the Ky README on GitHub](https://github.com/sindresorhus/ky#install)

### 2. Choose the bilingual display mode

Open the DualTrans popup, set your target language, and select the bilingual layout in the extension settings. Then start page translation from the popup.

- [Chrome Web Store](https://chromewebstore.google.com/detail/kndhkmhchkakomcdikfhnddngbkhhebj)
- [Microsoft Edge Add-ons](https://microsoftedge.microsoft.com/addons/detail/kagoaknpcofelmiphjghfbnccdjpdfme)

### 3. Check the translated text and original command

Read the source and translation together. The npm command stays in its original code block. You can still use GitHub’s copy button or select the code directly.

![Ky README with English text and highlighted Chinese translations above the unchanged npm install ky command](https://dual.productcool.com/guides/github-readme.webp)

The Ky README after translation with DualTrans. English and Chinese appear together, and npm install ky remains in the original code block.

## Troubleshooting and common questions

### Why did part of the README stay in the original language?

DualTrans skips code blocks so commands and examples remain valid. It translates readable content as it comes into view, so scroll farther down to translate more of a long README.

### How do I bring the original paragraphs back?

Switch to the bilingual layout if you previously chose translation-only view, or turn off page translation to restore the page to its original display.

## More guides

- [How to show two subtitle languages on YouTube](https://dual.productcool.com/guides/youtube-bilingual-subtitles)
- [How to watch TikTok videos and LIVE streams with bilingual subtitles](https://dual.productcool.com/guides/tiktok-bilingual-subtitles)
- [How to watch X (Twitter) videos with bilingual subtitles](https://dual.productcool.com/guides/x-video-bilingual-subtitles)
- [How to use your own DeepSeek API key in DualTrans](https://dual.productcool.com/guides/deepseek-api-key)
