0.7.4 gives the Ambient pack weather. A page names one feed URL on its own site, and the pack sets data-weather from it, uses its sunrise and sunset for dawn and dusk, and never shows a stale observation. Helpers for producing the feed from Open-Meteo are included. Ambient p…
Marks text and translatable attribute values that machine translation must leave alone: code, brand names, identifiers. Inherited; empty means yes.
Overview
The translateattribute tells translation tools (a browser's "Translate page", translation services, and tools used by human translators) whether an element's text and its translatable attributes should be translated. Everything is translatable by default. Set translate="no" on content that must stay as written. It has no visible effect until someone translates the page.
Applies to: every element (it is a global attribute). It is inherited by descendants.
Keep brand names, code and identifiers as written
12345
<h1><spantranslate="no">Vanilla Breeze</span> quick start</h1><p>Install the package, then add the stylesheet to every page.</p><pretranslate="no"><code>npm install vanilla-breeze</code></pre><p>Press <kbdtranslate="no">Ctrl</kbd> + <kbdtranslate="no">K</kbd> to open the command palette.</p><p>Your order number is <spantranslate="no">VB-2026-1042</span>.</p>
Values
Value
Meaning
yes or "" (empty)
Translate this element's text and translatable attributes.
no
Leave them unchanged.
Absent or an unknown value
Inherited from the parent. The root defaults to yes.
Translatable attributes
translate covers these attribute values as well as text:
title on any element
alt on img, area and input
placeholder on input and textarea
label on option, optgroup and track
value on input type="button" and type="reset"
abbr on th
download on a and area
content on meta name="description" and name="keywords"
srcdoc on iframe
What a user types into a field is never translated, so translate="no" on a text input only protects its placeholder and title.
Examples
Code in documentation
Code stays verbatim
123
<p>Install the package with your package manager:</p><pretranslate="no"><code>npm install vanilla-breeze</code></pre><p>Then set <codetranslate="no">data-theme</code> on the root element.</p>
Placeholders and titles that must not change
Translatable attributes
1234567
<form-field><labelfor="endpoint">API endpoint</label><!-- The label is translated; the example URL in the placeholder is not --><inputtype="url"id="endpoint"name="endpoint"translate="no"placeholder="https://api.example.com/v1"></form-field><buttontype="button"title="Copy the install command"data-copy="npm install vanilla-breeze">Copy command</button>
Brand names
Brand names in a footer
123
<footerclass="site"><p>Built with <spantranslate="no">Vanilla Breeze</span>, hosted on <spantranslate="no">Cloudflare Pages</span>.</p></footer>
When to keep the default
Leave prose, headings, labels, button text, error messages and navigation translatable. Do not put translate="no" on a whole page or component to protect a few words.
In Vanilla Breeze
No CSS can do this. The CSS translate property is a transform; machine-translation opt-out only exists as this HTML attribute. VB's i18n stylesheet has no rules for it on purpose (src/native-elements/i18n/styles.css, section 4).
Mark code yourself. VB does not add translate="no" to <code>, <kbd>, <samp>, <pre> or <var>. The i18n guide asks authors to mark them in markup.
data-lorem placeholder text gets translate="no" automatically, so translation tools do not try to translate Latin filler (src/utils/lorem-init.js).
Accessibility
Translation is an accessibility tool. Many readers rely on it. Mark only what must stay unchanged, so the rest stays readable.
It does not set the language. Untranslated text in another language still needs lang for screen readers.
Browser support
Baseline widely available since 2025 (Chrome 19, Firefox 111, Safari 6). Translation services such as Google Translate honour it regardless of the browser.
Gotchas
It is a request. Translation tools generally honour it, but nothing enforces it.
class="notranslate" is an older Google Translate convention. translate="no" is the standard; you do not need both.
Inheritance cuts both ways.translate="no" on a container protects every descendant. Use translate="yes" on a child to re-enable translation inside it.