---
title: "Content localization options"
description: "These settings configure TinyMCE's language capabilities, including right-to-left support."
canonical_url: "https://www.tiny.cloud/docs/tinymce/latest/content-localization/"
md_url: "https://www.tiny.cloud/docs/tinymce/latest/content-localization/index.md"
version: "latest"
last_updated: "2026-04-29T05:31:25Z"
tokens: 1037
---
# Content localization options

## Setting the default content language

### `content_language`

The `content_language` option sets the default content language of the editor by applying a `lang` attribute to the document element. In classic (iframe) mode, the attribute is set on the `<html>` element inside the editor’s iframe. In inline mode, the attribute is set on the target element specified in the editor’s `selector` option.

Setting this option helps meet accessibility standards such as [WCAG Success Criterion 3.1.1 (Language of Page)](https://www.w3.org/WAI/standards-guidelines/act/rules/b5c3f8/), which requires that the default human language of a web page can be programmatically determined.

> **Note:** This option is separate from the [`language`](../ui-localization/#language) option, which controls the language of the TinyMCE user interface. The `content_language` option controls only the language attribute of the editor content area.
When the [Spell Checker](../introduction-to-tiny-spellchecker/) plugin is active, it uses `content_language` as its default proofing language. If `content_language` is not set, the Spell Checker falls back to [`spellchecker_language`](../introduction-to-tiny-spellchecker/#spellchecker_language).

**Type:** `String`

**Default value:** Not set (`undefined`)

#### Example: using `content_language`

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  content_language: 'fr'
});
```

## Setting the language on content

### `content_langs`

This option sets the languages displayed in the `language` toolbar button and the `language` menu item. The option accepts an array of language specs. Each language spec is a JavaScript object defined using the following properties.

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `title` | String | required | The name shown for this language in the UI. |
| `code` | String | required | The language tag, as defined in [Tags for Identifying Languages (BCP47)](https://www.ietf.org/rfc/bcp/bcp47.txt), for this language. This language tag is placed in the `lang` attribute for elements formatted using this language. |
| `customCode` | String | optional | An alternative language tag, that does not need to be compatible with BCP47. This string is placed in the `data-mce-lang` attribute for elements formatted using this language, if it is defined. |

There is no default value for the `content_langs` option. If no value is specified, the `language` toolbar button and menu item are not available. A default value for this option is provided by the Spell Checker plugin. For information on using the `content_langs` option with the Spell Checker plugin, see: [Spell Checker plugin - `content_langs`](../introduction-to-tiny-spellchecker/#content_langs).

**Type:** `Array`

#### Example: using `content_langs`

```js
tinymce.init({
  selector: 'textarea', // change this according to your HTML
  toolbar: 'language',
  content_langs: [
    { title: 'English', code: 'en' },
    { title: 'Spanish', code: 'es' },
    { title: 'French', code: 'fr' },
    { title: 'German', code: 'de' },
    { title: 'Portuguese', code: 'pt' },
    { title: 'Chinese', code: 'zh' }
  ]
});
```

## Setting the language options for Spell Checker

To set the default language for Spell Checker plugin, see: [The Spell Checker plugin - `spellchecker_language`](../introduction-to-tiny-spellchecker/#spellchecker_language).

To customize the list of spell checking languages available to your users through the Spell Checker plugin, see: [The Spell Checker plugin - `spellchecker_languages`](../introduction-to-tiny-spellchecker/#spellchecker_languages).

## Changing the default text direction of content

### `directionality`

This option allows you to set the base direction of directionally neutral text (i.e., text that doesn’t have inherent directionality as defined in Unicode) within the editor. This is similar to the use of the `'dir'` attribute when using content editable elements by themselves.

**Type:** `String`

**Default value:** `'ltr'`

**Possible values:** `'ltr'`, `'rtl'`

#### Example: using `directionality`

```js
tinymce.init({
  selector: 'textarea',  // change this value according to your HTML
  directionality: 'ltr'
});
```

## Allow users to change the text direction of content

To allow your users to change the text direction of content as needed, add the toolbar buttons provided by [The Directionality plugin](../directionality/).
