# doclang

    .doclang locale:{String? = null} -> Any

Content copied to clipboard

If locale is specified, sets the document language to that value. The document language affects localization (localization, localize), hyphenation and other locale-specific properties.

For a list of supported locales for built-in localizations, see here.

    .doclang {en}

Content copied to clipboard

or

    .doclang {English}

Content copied to clipboard

If it's unset, the current language of the document is returned as its localized name (e.g. `English`, `Italiano`, `Français`).

    The current document language is .doclang

Content copied to clipboard

#### Return

the localized name of the current document language if locale is unset, nothing otherwise

#### Parameters

locale

- Optional

optional, case-insensitive, either a locale tag (e.g. `en`, `en-US`, `it`, `fr-CA`) or an English name of a locale (e.g. `English`, `English (United States)`, `Italian`, `French (Canada)`) to assign to the document

#### Throws

IllegalArgumentException

if the locale tag is invalid or not found

#### Wiki page

document-metadata