---
title: "Keep product text and code separate"
description: "Translate words your users read while leaving code, URLs, identifiers, and hidden content alone."
canonical_url: "https://docs.linguana.dev/docs/build-with-code/text-and-code"
markdown_url: "https://docs.linguana.dev/docs/build-with-code/text-and-code.md"
x_farming_labs_generated_preamble: true
---

# Keep product text and code separate
URL: /docs/build-with-code/text-and-code
LLM index: /llms.txt
Description: Translate words your users read while leaving code, URLs, identifiers, and hidden content alone.

# Keep product text and code separate

Linguana translates words your users read. It leaves code, identifiers, URLs, analytics values, and hidden content alone.

## Leave code unchanged

```tsx
<code data-no-translate>checkout_v2</code>
```

Use `data-no-translate` for a complete subtree that should stay unchanged.

## What is left alone automatically

- `script`, `style`, `code`, and `pre` subtrees.
- `hidden`, `aria-hidden="true"`, and hidden inputs.
- Any subtree marked `data-no-translate`.
- IDs, class names, names, roles, URLs, sources, actions, methods, test IDs, analytics values, and event attributes.
- URL-like and machine-readable text patterns.

```tsx
<section data-no-translate>
  <code>npm install example</code>
</section>
```

## Translate a custom label

Unknown literal attributes can be opted in by name:

```tsx
<Widget data-translate="emptyLabel" emptyLabel="No results" />
```

Prefer a normal user-facing prop or `t()` when you control the component.

## Text with links or components

Use `<T>` for text that contains a link, emphasis, or another component. See [Translate dynamic text and links](/docs/build-with-code/dynamic-text-and-links).

## Verify

Run your normal build and check that product text appears while code and identifiers stay out of `.linguana/manifest.json`.

## Failure and next

If expected text is missing, use [Build diagnostics](/docs/troubleshooting/build-diagnostics). For focused extraction tests, see [Advanced testing](/docs/advanced/testing/extraction).

## Sitemap

See the full [sitemap](/sitemap.md) for all pages.
Docs-scoped sitemap: [/docs/sitemap.md](/docs/sitemap.md).
Well-known sitemap: [/.well-known/sitemap.md](/.well-known/sitemap.md).
