w:lang (Language)
Specifies the language tag for the run text to control spell-checking and grammar-checking.
Parent elements
Description
w:lang specifies the natural language of the run text, controlling which spell-check and grammar-check dictionaries are used. It is defined in ECMA-376 Part 1 §17.3.2.20.
The value uses IETF BCP 47 language tags (e.g. en-US, de-DE, fr-FR). Three separate attributes cover Latin/Western, East Asian, and complex-script (bidirectional) text segments.
Attributes
| Attribute | Type | Possible Values | Description |
|---|---|---|---|
w:val |
ST_Lang |
BCP 47 language tag, e.g. en-US, de-DE, fr-FR, ja-JP. |
Language for Latin and Western script characters. |
w:eastAsia |
ST_Lang |
BCP 47 language tag, e.g. zh-CN, ja-JP, ko-KR. |
Language for East Asian script characters. |
w:bidi |
ST_Lang |
BCP 47 language tag, e.g. ar-SA, he-IL. |
Language for complex-script (bidirectional) characters. |
Examples
<w:rPr>
<w:lang w:val="de-DE"/>
</w:rPr>
new RunProperties(
new Languages { Val = "de-DE" });
Notes
- Omitting
w:langmeans the application’s default language is used. - Setting
w:val="zxx"(no linguistic content) orw:val="x-none"suppresses proofing entirely for the run.