---
title: "Localization and units"
canonical_url: "https://www.nutrient.io/guides/document-authoring/customize/localization-and-units/"
md_url: "https://www.nutrient.io/guides/document-authoring/customize/localization-and-units.md"
last_updated: "2026-07-08T00:00:00.000Z"
description: "Set the editor interface language and measurement units in Document Authoring with the `ui` option on `createEditor`."
---

# Set the locale and units

Set the editor interface language and measurement units with the [`CreateEditorOptions`](https://www.nutrient.io/api/document-authoring/types/createeditoroptions/) `ui` option when you create an editor.

The locale controls editor text and number formatting. The unit controls measurements in the editor UI, such as ruler and page setup values. These settings don’t change document content; they only change the editor interface around it.

Before you start, make sure the Document Authoring library is installed and running in your app. If you haven’t set it up yet, refer to the [getting started](https://www.nutrient.io/sdk/document-authoring/getting-started.md) guide.

The examples omit error handling. Add it before you use this code in production.

## Set the locale

Use [`UIOptions`](https://www.nutrient.io/api/document-authoring/types/uioptions/) `locale` to set the editor language. Document Authoring supports `en`, `fr`, and `de`:

```js

const editor = await system.createEditor(document.getElementById('editor'), {
  document: await system.createDocumentFromPlaintext('Bonjour'),
  ui: {
    locale: 'fr',
  },
});

```

Use `auto` to follow the user’s browser settings. Document Authoring falls back to the default locale when it doesn’t support the browser language:

```js

const editor = await system.createEditor(document.getElementById('editor'), {
  document: doc,
  ui: {
    locale: 'auto',
  },
});

```

## Set the units

Use [`UIOptions`](https://www.nutrient.io/api/document-authoring/types/uioptions/) `unit` to set the measurement system in the editor UI. Document Authoring supports these values:

- `cm`

- `mm`

- `in`

- `pt`

- `pc`

```js

const editor = await system.createEditor(document.getElementById('editor'), {
  document: doc,
  ui: {
    locale: 'de',
    unit: 'cm',
  },
});

```

This changes how the editor displays measurements. It doesn’t change the document, which stores dimensions in points.

## Learn more

**[Customize actions and the toolbar](https://www.nutrient.io/guides/document-authoring/customize/actions-and-toolbar.md)**\
Configure the toolbar and actions with the same `ui` option.

**[Fonts](https://www.nutrient.io/guides/document-authoring/customize/fonts.md)**\
Add custom fonts to the system.
---

## Related pages

- [Use events and integration APIs](/guides/document-authoring/customize/events-and-integration.md)
- [Customize actions and the toolbar](/guides/document-authoring/customize/actions-and-toolbar.md)
- [Configure fonts](/guides/document-authoring/customize/fonts.md)
- [Use spellcheck in Document Authoring](/guides/document-authoring/customize/spellcheck.md)

