Skip to content

Commit bdc1a2a

Browse files
authored
DOC-3355: New content_language option to set the lang attribute on the editor content element (#4092)
* DOC-3355: New content_language option to set the lang attribute on the editor content element * Add deprecation note to spellchecker_language option The TINY-11214 DoD required noting the deprecation on the spellchecker_language config page itself, pointing integrators to content_language as the replacement.
1 parent 6d57ea5 commit bdc1a2a

4 files changed

Lines changed: 52 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
=== Accessibility Checker
4560

4661
The {productname} {release-version} release includes an accompanying release of the **Accessibility Checker** premium plugin.
@@ -361,6 +376,13 @@ For information on using Enhanced Skins & Icon Packs, see: xref:enhanced-skins-a
361376

362377
// CCFR here.
363378

379+
=== New `content_language` option to set the `lang` attribute on the iframe's `html` element or the inline editor's target element
380+
// #TINY-11214
381+
382+
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.
383+
384+
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+`.
385+
364386

365387
[[changes]]
366388
== 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+
----

modules/ROOT/partials/configuration/spellchecker_language.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[[spellchecker_language]]
22
== `+spellchecker_language+`
33

4+
IMPORTANT: This option has been marked as *deprecated* as of {productname} 8.5. It will be removed in a future major release. Use xref:content-localization.adoc#content_language[`+content_language+`] instead, which sets both the default content language and the Spell Checker proofing language.
5+
46
This option specifies the default language used by Spell Checker.
57

68
*Type:* `+String+`

0 commit comments

Comments
 (0)