Inspect the working example
The English paragraph quotes a Hong Kong Chinese button label. The Chinese fixture independently describes an English button label. Each phrase has its own language metadata, while the surrounding sentence keeps its original language.
| Case | Input or inspection | Result and meaning |
|---|---|---|
| Paragraph language | Inspect the p lang attribute | en in this English fixture |
| Phrase language | Inspect phrase lang | zh-Hant-HK for 儲存草稿 |
| CSS language matching | Test :lang on paragraph and phrase | The explicit phrase language overrides the inherited language |
Follow the browser mechanism
lang declares content language and inherits when a descendant has no explicit language. An explicit value on span identifies the switch. It does not translate content, set a universal voice, or change Chinese into right-to-left text. Any claim about spoken pronunciation still needs testing with the actual reading technology.
An unmarked phrase inherits the surrounding language
The phrase below contains different-language text but has no lang of its own. Its content is still classified by the surrounding paragraph language.
<p lang="en">The button reads <span id="phrase">儲存草稿</span>.</p>The English counterexample phrase matches :lang(en), not :lang(zh-Hant-HK). The Chinese counterexample phrase matches :lang(zh-Hant-HK), not :lang(en).
Try the repair
You add another English sentence after the marked Chinese phrase. Must the whole paragraph become zh-Hant-HK?
Show the worked answer
No. Keep the paragraph en and mark only the Chinese phrase zh-Hant-HK in the English fixture. In the Chinese fixture, keep the paragraph zh-Hant-HK and only the English phrase en.
- Inspect explicit lang attributes and inherited :lang matches separately.
- Keep original wording for each language rather than using language metadata as a translation instruction.