Skip to content

Commit 354a62a

Browse files
committed
DOC-3355: New content_language option to set the lang attribute on the editor content element
1 parent 9378169 commit 354a62a

3 files changed

Lines changed: 50 additions & 0 deletions

File tree

modules/ROOT/pages/8.5.0-release-notes.adoc

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,21 @@ The {productname} {release-version} release includes an accompanying release of
4141

4242
For information on the **<Premium plugin name 1>** plugin, see: xref:<plugincode>.adoc[<Premium plugin name 1>].
4343

44+
=== Spell Checker
45+
46+
The {productname} {release-version} release includes an accompanying release of the **Spell Checker** premium plugin.
47+
48+
**Spell Checker** includes the following change.
49+
50+
==== The Spell Checker plugin now uses the `content_language` option as the default language, falling back to `spellchecker_language` if not set
51+
// #TINY-11214
52+
53+
Previously, the Spell Checker plugin relied exclusively on the `spellchecker_language` option to determine its default proofing language. There was no way to align the spellchecker language with the content language set on the editor.
54+
55+
In {productname} {release-version}, the Spell Checker plugin now reads the new `content_language` option first and uses its value as the default proofing language. If `content_language` is not set, the plugin falls back to `spellchecker_language`. The `spellchecker_language` option will be deprecated in a future major version; integrators are encouraged to use `content_language` instead.
56+
57+
For information on the **Spell Checker** plugin, see: xref:introduction-to-tiny-spellchecker.adoc[Spell Checker].
58+
4459

4560
[[accompanying-enhanced-skins-and-icon-packs-changes]]
4661
== Accompanying Enhanced Skins & Icon Packs changes
@@ -77,6 +92,13 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
7792

7893
// CCFR here.
7994

95+
=== New `content_language` option to set the `lang` attribute on the iframe's `html` element or the inline editor's target element
96+
// #TINY-11214
97+
98+
Previously, {productname} had no option to set the default content language of the editor. In classic (iframe) mode, the `html` element inside the editor iframe had no `lang` attribute, which failed to meet accessibility standards such as link:https://www.w3.org/WAI/standards-guidelines/act/rules/b5c3f8/[WCAG Success Criterion 3.1.1]. Screen readers and other assistive technologies could not determine the language of the editor content.
99+
100+
In {productname} {release-version}, the new xref:content-localization.adoc#content_language[`+content_language+`] option sets a `lang` attribute on the `html` element of the editor's iframe in classic mode, or on the target element in inline mode. This is separate from the xref:ui-localization.adoc#language[`+language+`] option, which controls the UI language. The Spell Checker plugin also now defaults to `+content_language+` when set, before falling back to `+spellchecker_language+`.
101+
80102

81103
[[changes]]
82104
== Changes

modules/ROOT/pages/content-localization.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
:description_short: Localize TinyMCE for your language, including directionality.
44
:description: These settings configure TinyMCE's language capabilities, including right-to-left support.
55

6+
== Setting the default content language
7+
8+
include::partial$configuration/content_language.adoc[leveloffset=+1]
9+
610
== Setting the language on content
711

812
include::partial$configuration/content_langs.adoc[leveloffset=+1]
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
[[content_language]]
2+
== `content_language`
3+
4+
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.
5+
6+
Setting this option helps meet accessibility standards such as link:https://www.w3.org/WAI/standards-guidelines/act/rules/b5c3f8/[WCAG Success Criterion 3.1.1 (Language of Page)], which requires that the default human language of a web page can be programmatically determined.
7+
8+
NOTE: This option is separate from the xref:ui-localization.adoc#language[`+language+`] option, which controls the language of the {productname} user interface. The `+content_language+` option controls only the language attribute of the editor content area.
9+
10+
When the xref:introduction-to-tiny-spellchecker.adoc[Spell Checker] plugin is active, it uses `+content_language+` as its default proofing language. If `+content_language+` is not set, the Spell Checker falls back to xref:introduction-to-tiny-spellchecker.adoc#spellchecker_language[`+spellchecker_language+`].
11+
12+
*Type:* `+String+`
13+
14+
*Default value:* Not set (`+undefined+`)
15+
16+
=== Example: using `content_language`
17+
18+
[source,js]
19+
----
20+
tinymce.init({
21+
selector: 'textarea', // change this value according to your HTML
22+
content_language: 'fr'
23+
});
24+
----

0 commit comments

Comments
 (0)