Skip to content

Commit 663d154

Browse files
committed
DOC-3147: Language code standardization to RFC5646/BCP47 format.
1 parent b3a9cdd commit 663d154

File tree

12 files changed

+163
-101
lines changed

12 files changed

+163
-101
lines changed

modules/ROOT/examples/live-demos/spellchecker/index.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3,31 +3,31 @@ tinymce.init({
33
plugins: 'code tinymcespellchecker link',
44
toolbar: 'spellchecker language spellcheckdialog',
55
height: 500,
6-
spellchecker_language: 'en_US',
6+
spellchecker_language: 'en-US',
77
content_langs: [
8-
{ title: 'Afrikaans (South Africa)', code: 'af_ZA', customCode: 'af_ZA' },
9-
{ title: 'English (Australia)', code: 'en_AU' },
10-
{ title: 'English (Canada)', code: 'en_CA' },
11-
{ title: 'English (United Kingdom)', code: 'en_GB' },
12-
{ title: 'English (United States)', code: 'en_US' },
13-
{ title: 'Medical English (US)', code: 'en_US', customCode: 'en_US-medical' },
14-
{ title: 'Medical English (UK)', code: 'en_GB', customCode: 'en_GB-medical' },
8+
{ title: 'Afrikaans (South Africa)', code: 'af-ZA', customCode: 'af-ZA' },
9+
{ title: 'English (Australia)', code: 'en-AU' },
10+
{ title: 'English (Canada)', code: 'en-CA' },
11+
{ title: 'English (United Kingdom)', code: 'en-GB' },
12+
{ title: 'English (United States)', code: 'en-US' },
13+
{ title: 'Medical English (US)', code: 'en-US', customCode: 'en-US-medical' },
14+
{ title: 'Medical English (UK)', code: 'en-GB', customCode: 'en-GB-medical' },
1515
{ title: 'Danish', code: 'da' },
16-
{ title: 'Dutch', code: 'nl_NL' },
16+
{ title: 'Dutch', code: 'nl-NL' },
1717
{ title: 'Finnish', code: 'fi' },
1818
{ title: 'French', code: 'fr' },
19-
{ title: 'German', code: 'de_DE' },
19+
{ title: 'German', code: 'de-DE' },
2020
{ title: 'Hungarian', code: 'hu' },
21-
{ title: 'Italian', code: 'it_IT' },
22-
{ title: 'Maori (New Zealand)', code: 'mi_NZ' },
23-
{ title: 'Norwegian Bokmål', code: 'nb_NO' },
21+
{ title: 'Italian', code: 'it-IT' },
22+
{ title: 'Maori (New Zealand)', code: 'mi-NZ' },
23+
{ title: 'Norwegian Bokmål', code: 'nb-NO' },
2424
{ title: 'Norwegian Nynorsk', code: 'nn' },
2525
{ title: 'Polish', code: 'pl' },
26-
{ title: 'Portuguese (Brazil)', code: 'pt_BR' },
27-
{ title: 'Portuguese (Portugal)', code: 'pt_PT' },
26+
{ title: 'Portuguese (Brazil)', code: 'pt-BR' },
27+
{ title: 'Portuguese (Portugal)', code: 'pt-PT' },
2828
{ title: 'Spanish', code: 'es' },
29-
{ title: 'Swedish', code: 'sv_SE' },
30-
{ title: 'Swedish (Finland)', code: 'sv_FI' }
29+
{ title: 'Swedish', code: 'sv-SE' },
30+
{ title: 'Swedish (Finland)', code: 'sv-FI' }
3131
],
3232
content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
3333
});

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

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
= {productname} {release-version}
32
:release-version: 8.0.0
43
:navtitle: {productname} {release-version}
@@ -59,6 +58,67 @@ The following premium plugin updates were released alongside {productname} {rele
5958

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

61+
=== Spell Checker
62+
63+
The {productname} {release-version} includes an accompanying release of the **Spell Checker** premium plugin.
64+
65+
**Spell Checker** includes the following improvement.
66+
67+
=== Language code standardization to RFC5646/BCP47 format
68+
69+
The {productname} {release-version} release introduces standardized support for language codes using the RFC5646 (also known as BCP47) format. This update applies to all language-related configurations, including:
70+
71+
* UI language packs (premium and community)
72+
* Spellchecker language codes
73+
* HTML `lang` attributes
74+
* Content language selection
75+
76+
**Changes**
77+
78+
* Language codes now use hyphens (`-`) instead of underscores (`_`). For example:
79+
** `'en-US'` instead of `'en_US'`
80+
** `'zh-TW'` instead of `'zh_TW'`
81+
** `'pt-BR'` instead of `'pt_BR'`
82+
* Base language codes without regions (e.g., `'en'`, `'es'`, `'fr'`) remain unchanged.
83+
* File names for language packs have been updated to use hyphens.
84+
* Premium plugins have been updated to recognize RFC5646-compliant codes.
85+
86+
**Backward Compatibility**
87+
88+
To ensure a smooth migration
89+
90+
* Both hyphenated and underscore formats are supported in {productname} {release-version}.
91+
* A console warning is displayed when the legacy underscore format is used.
92+
* Both formats of language pack files are distributed with {productname} {release-version}.
93+
* {productname} 9 will support only the RFC5646-compliant hyphenated format.
94+
95+
**Migration**
96+
97+
. Update language-related configuration in `tinymce.init`:
98+
+
99+
[source,javascript]
100+
----
101+
language: 'en-US',
102+
spellchecker_language: 'en-US'
103+
----
104+
+
105+
. Update `content_langs` configuration:
106+
+
107+
[source,javascript]
108+
----
109+
content_langs: [
110+
{ title: 'English (US)', code: 'en-US' },
111+
{ title: 'Portuguese (Brazil)', code: 'pt-BR' }
112+
]
113+
----
114+
+
115+
. Rename any custom dictionary files to use hyphens (e.g., `'en-GB.txt'` instead of `'en_GB.txt'`).
116+
. Ensure any server-side integrations or custom language pack files follow the new naming convention.
117+
118+
This standardization aligns {productname} with modern web standards and improves consistency across its multilingual features.
119+
120+
For information on the **Spell Checker** premium plugin, see: xref:introduction-to-tiny-spellchecker.adoc[Spell Checker plugin] or for an complete list of supported languages, see: xref:introduction-to-tiny-spellchecker.adoc#supported-languages[Supported languages].
121+
62122

63123
[[accompanying-premium-plugin-end-of-life-announcement]]
64124
== Accompanying Premium plugin end-of-life announcement

modules/ROOT/pages/custom-dictionaries-for-tiny-spellchecker.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
One custom dictionary can be created for each language already supported by the spell checker (see xref:introduction-to-tiny-spellchecker.adoc#supported-languages[supported languages]) or any arbitrary language added by additional Hunspell dictionary files included in Hunspell Dictionary Path (See xref:self-hosting-hunspell.adoc[Add Hunspell dictionaries to Spell Checker]). It's also possible to define an additional "global" dictionary that contains words that are valid across all languages, such as trademarks.
99

10-
A custom dictionary file for a particular language must be named with the language code of the language (see xref:introduction-to-tiny-spellchecker.adoc#supported-languages[supported languages] for language code examples), plus the suffix `+.txt+`: E.g. `+en.txt+`, `+en_gb.txt+`, `+fr.txt+`, `+de.txt+` etc.
10+
A custom dictionary file for a particular language must be named with the language code of the language (see xref:introduction-to-tiny-spellchecker.adoc#supported-languages[supported languages] for language code examples), plus the suffix `+.txt+`: E.g. `+en.txt+`, `+en-GB.txt+`, `+fr.txt+`, `+de.txt+` etc.
1111

1212
The "global" dictionary file for language-independent words must be called "global.txt".
1313

modules/ROOT/pages/introduction-to-tiny-spellchecker.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ With {cloudname} the server-side spellchecking component is automatically config
2929
tinymce.init({
3030
selector: 'textarea',
3131
plugins: 'tinymcespellchecker',
32-
spellchecker_language: 'en_US'
32+
spellchecker_language: 'en-US' // Note: Using RFC5646 format with hyphen
3333
});
3434
----
3535

@@ -47,7 +47,7 @@ tinymce.init({
4747
selector: 'textarea',
4848
plugins: 'tinymcespellchecker',
4949
spellchecker_rpc_url: 'localhost/ephox-spelling',
50-
spellchecker_language: 'en_US'
50+
spellchecker_language: 'en-US' // Note: Using RFC5646 format with hyphen
5151
});
5252
----
5353

@@ -243,7 +243,7 @@ tinymce.init({
243243

244244
The `+spelling+` object, which is provided by the `+SpellcheckerUpdated+` event, contains the result of the spelling service spellcheck.
245245

246-
The keys of the outermost object are the language code for each checked language.
246+
The keys of the outermost object are the language code for each checked language (using RFC5646 format, e.g., 'en-US', 'es-ES').
247247

248248
Under each returned language code is an object with
249249

modules/ROOT/pages/localize-your-language.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ IMPORTANT: The language settings will not work unless the language pack is place
2525
2626
== Step 3
2727
28-
Set the language option in {productname}'s configuration to the language code in the list on xref:ui-localization.adoc#language[this page].
28+
Set the language option in {productname}'s configuration to the RFC5646 language code in the list on xref:ui-localization.adoc#language[this page].
2929
3030
== Step 4
3131
@@ -46,7 +46,7 @@ link:{gettiny}/language-packages/[Download the Chinese language] pack to test th
4646
<script type="text/javascript">
4747
tinymce.init({
4848
selector: 'textarea',
49-
language: 'zh_CN',
49+
language: 'zh-CN',
5050
directionality: 'rtl'
5151
});
5252
</script>

modules/ROOT/partials/configuration/language.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,20 @@ For information on:
1919

2020
=== Example: using `+language+`
2121

22-
In this example we will set the editor language to Swedish.
22+
In this example we will set the editor language to Swedish using the RFC5646 format:
2323

2424
[source,js]
2525
----
2626
tinymce.init({
2727
selector: 'textarea', // change this value according to your HTML
28-
language: 'sv_SE'
28+
language: 'sv-SE'
2929
});
3030
----
3131

3232
[[using-the-premium-language-packs]]
3333
=== Using the premium language packs
3434

35-
The following professionally localized language packs are provided to paid {cloudname} and premium self-hosted deployments. To use these language packs, set the `+language+` option to the corresponding language code. No additional configuration is required.
35+
The following professionally localized language packs are provided to paid {cloudname} and premium self-hosted deployments. To use these language packs, set the `+language+` option to the corresponding language code in RFC5646 format. No additional configuration is required.
3636

3737
include::partial$misc/ui-languages.adoc[leveloffset=+2]
3838

modules/ROOT/partials/configuration/spellchecker_language.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ This option specifies the default language used by Spell Checker.
55

66
*Type:* `+String+`
77

8-
*Default value:* `+'en_US'+`
8+
*Default value:* `+'en-US'+`
99

1010
=== Example: using `+spellchecker_language+`
1111

@@ -14,6 +14,6 @@ This option specifies the default language used by Spell Checker.
1414
tinymce.init({
1515
selector: 'textarea',
1616
plugins: 'tinymcespellchecker',
17-
spellchecker_language: 'de'
17+
spellchecker_language: 'de' // Use ISO language code, hyphenated for regional variants (e.g., 'de-DE')
1818
});
1919
----

modules/ROOT/partials/configuration/spellchecker_languages.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This option specifies the spellchecker languages that are available to the user,
88
*Default value:*
99
[source,js]
1010
----
11-
'English (United States)=en_US,English (United Kingdom)=en_GB,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Norwegian Bokmål=nb_NO,Norwegian Nynorsk=nn,Brazilian Portuguese=pt_BR,Portuguese=pt,Portuguese (Portugal)=pt_PT,Spanish=es,Swedish=sv,Swedish (Finland)=sv_FI,Afrikaans (South Africa)=af_ZA,English (Australia)=en_AU,English (Canada)=en_CA,English (United Kingdom)=en_GB,English (United States)=en_US,Medical English (US)=en_US-medical,Medical English (UK)=en_GB-medical,Maori (New Zealand)=mi_NZ'
11+
'English (United States)=en-US,English (United Kingdom)=en-GB,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Norwegian Bokmål=nb-NO,Norwegian Nynorsk=nn,Brazilian Portuguese=pt-BR,Portuguese=pt,Portuguese (Portugal)=pt-PT,Spanish=es,Swedish=sv,Swedish (Finland)=sv-FI,Afrikaans (South Africa)=af-ZA,English (Australia)=en-AU,English (Canada)=en-CA,English (United Kingdom)=en-GB,English (United States)=en-US,Medical English (US)=en-US-medical,Medical English (UK)=en-GB-medical,Maori (New Zealand)=mi-NZ'
1212
----
1313

1414

@@ -19,6 +19,6 @@ This option specifies the spellchecker languages that are available to the user,
1919
tinymce.init({
2020
selector: 'textarea',
2121
plugins: 'tinymcespellchecker',
22-
spellchecker_languages: 'US English=en_US,UK English=en_GB,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Norwegian Bokmål=nb_NO,Norwegian Nynorsk=nn,Brazilian Portuguese=pt_BR,Portuguese=pt,Portuguese (Portugal)=pt_PT,Spanish=es,Swedish=sv,Swedish (Finland)=sv_FI,Afrikaans (South Africa)=af_ZA,English (Australia)=en_AU,English (Canada)=en_CA,English (United Kingdom)=en_GB,English (United States)=en_US,Medical English (US)=en_US-medical,Medical English (UK)=en_GB-medical,Maori (New Zealand)=mi_NZ'
22+
spellchecker_languages: 'US English=en-US,UK English=en-GB,Danish=da,Dutch=nl,Finnish=fi,French=fr,German=de,Italian=it,Norwegian Bokmål=nb-NO,Norwegian Nynorsk=nn,Brazilian Portuguese=pt-BR,Portuguese=pt,Portuguese (Portugal)=pt-PT,Spanish=es,Swedish=sv,Swedish (Finland)=sv-FI,Afrikaans (South Africa)=af-ZA,English (Australia)=en-AU,English (Canada)=en-CA,English (United Kingdom)=en-GB,English (United States)=en-US,Medical English (US)=en-US-medical,Medical English (UK)=en-GB-medical,Maori (New Zealand)=mi-NZ'
2323
});
2424
----

modules/ROOT/partials/docker/spelling-service/spelling-service-installation.adoc

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -175,11 +175,11 @@ spelling-tiny-1 | 2025-02-11 09:51:11.104Z [io-compute-blocker-6] INFO c.e.i.d
175175
spelling-tiny-1 | 2025-02-11 09:51:11.161Z [io-compute-blocker-6] INFO com.ephox.nectar.data.Bees$ - Loading all dictionaries from WinterTree
176176
spelling-tiny-1 | 2025-02-11 09:51:11.482Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Loading hunspell dictionary from path: /app/resources/hunspell-dictionaries and locale es
177177
spelling-tiny-1 | 2025-02-11 09:51:11.536Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Finished loading hunspell for es
178-
spelling-tiny-1 | 2025-02-11 09:51:11.537Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Loading hunspell dictionary from path: /app/resources/hunspell-dictionaries and locale pt_BR
179-
spelling-tiny-1 | 2025-02-11 09:51:11.881Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Finished loading hunspell for pt_BR
178+
spelling-tiny-1 | 2025-02-11 09:51:11.537Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Loading hunspell dictionary from path: /app/resources/hunspell-dictionaries and locale pt-BR
179+
spelling-tiny-1 | 2025-02-11 09:51:11.881Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Finished loading hunspell for pt-BR
180180
...
181-
spelling-tiny-1 | 2025-02-11 09:51:13.593Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Loading hunspell dictionary from path: /app/resources/hunspell-dictionaries and locale de_DE
182-
spelling-tiny-1 | 2025-02-11 09:51:13.651Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Finished loading hunspell for de_DE
181+
spelling-tiny-1 | 2025-02-11 09:51:13.593Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Loading hunspell dictionary from path: /app/resources/hunspell-dictionaries and locale de-DE
182+
spelling-tiny-1 | 2025-02-11 09:51:13.651Z [io-compute-blocker-5] INFO c.e.nectar.hunspell.HunspellLoader$ - Finished loading hunspell for de-DE
183183
spelling-tiny-1 | 2025-02-11 09:51:14.142Z [io-compute-9] INFO o.h.b.c.nio1.NIO1SocketServerGroup - Service bound to address /0:0:0:0:0:0:0:0:18080
184184
spelling-tiny-1 | 2025-02-11 09:51:14.146Z [io-compute-9] INFO o.h.blaze.server.BlazeServerBuilder -
185185
spelling-tiny-1 | _ _ _ _ _
@@ -215,7 +215,7 @@ To confirm that a request is being sent to the {pluginname} service, use:
215215
+
216216
[source, sh]
217217
----
218-
curl http://localhost:18080/2/check -d '{"words": ["teh"], "language": "en_US"}' -H "Origin: http://good.com" -H "Content-Type: application/json"
218+
curl http://localhost:18080/2/check -d '{"words": ["teh"], "language": "en-US"}' -H "Origin: http://good.com" -H "Content-Type: application/json"
219219
----
220220

221221
+
@@ -224,7 +224,7 @@ Finally, to verify if a request is unauthorized and originates from an incorrect
224224
+
225225
[source, sh]
226226
----
227-
curl http://localhost:18080/2/check -d '{"words": ["teh"], "language": "en_US"}' -H "Origin: http://bad.com" -H "Content-Type: application/json"
227+
curl http://localhost:18080/2/check -d '{"words": ["teh"], "language": "en-US"}' -H "Origin: http://bad.com" -H "Content-Type: application/json"
228228
----
229229

230230
+
@@ -245,12 +245,7 @@ tinymce.init({
245245
selector: 'textarea#spellchecker', // change this value according to your HTML
246246
plugins: 'code tinymcespellchecker link',
247247
toolbar: 'spellchecker language spellcheckdialog',
248-
spellchecker_language: 'en_US',
248+
spellchecker_language: 'en-US', // Note: Using RFC5646 format with hyphen
249249
spellchecker_rpc_url: "http://localhost:18080"
250250
});
251251
----
252-
253-
254-
255-
256-

modules/ROOT/partials/misc/spellchecker-languages.adoc

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,27 @@ The following languages are supported for the Spell Checker plugin. All of the l
66
[cols="2,^1,^1,^1",options="header"]
77
|===
88
|Language |Code |Pre-packaged with {productname} |Supported Hunspell dictionaries
9-
|Afrikaans (South Africa) |af_ZA |{cross} |{tick}
10-
|English (Australia) |en_AU |{cross} |{tick}
11-
|English (Canada) |en_CA |{cross} |{tick}
12-
|English (United Kingdom) |en_GB, en_UK, en_BR |{tick} |{tick}
13-
|English (United States) |en, en_US |{tick} |{tick}
14-
|Medical English (US) |en-medical, en_US-medical |{tick} |{tick}
15-
|Medical English (UK) |en_GB-medical |{tick} |{cross}
9+
|Afrikaans (South Africa) |af-ZA |{cross} |{tick}
10+
|English (Australia) |en-AU |{cross} |{tick}
11+
|English (Canada) |en-CA |{cross} |{tick}
12+
|English (United Kingdom) |en-GB, en-UK, en-BR |{tick} |{tick}
13+
|English (United States) |en, en-US |{tick} |{tick}
14+
|Medical English (US) |en-medical, en-US-medical |{tick} |{tick}
15+
|Medical English (UK) |en-GB-medical |{tick} |{cross}
1616
|Danish |da |{tick} |{tick}
17-
|Dutch |nl, nl_NL |{tick} |{tick}
17+
|Dutch |nl, nl-NL |{tick} |{tick}
1818
|Finnish |fi |{tick} |{cross}
1919
|French |fr |{tick} |{tick}
20-
|German |de, de_DE |{tick} |{tick}
20+
|German |de, de-DE |{tick} |{tick}
2121
|Hungarian |hu |{cross} |{tick}
22-
|Italian |it, it_IT |{tick} |{tick}
23-
|Maori (New Zealand) |mi_NZ |{cross} |{tick}
24-
|Norwegian Bokmål |nb, nb_NO |{tick} |{tick}
22+
|Italian |it, it-IT |{tick} |{tick}
23+
|Maori (New Zealand) |mi-NZ |{cross} |{tick}
24+
|Norwegian Bokmål |nb, nb-NO |{tick} |{tick}
2525
|Norwegian Nynorsk |nn |{cross} |{tick}
2626
|Polish |pl |{cross} |{tick}
27-
|Portuguese (Brazil) |pt, pt_BR |{tick} |{tick}
28-
|Portuguese (Portugal) |pt_PT |{tick} |{tick}
27+
|Portuguese (Brazil) |pt, pt-BR |{tick} |{tick}
28+
|Portuguese (Portugal) |pt-PT |{tick} |{tick}
2929
|Spanish |es |{tick} |{tick}
30-
|Swedish |sv, sv_SE |{tick} |{tick}
31-
|Swedish (Finland) |sv_FI |{cross} |{tick}
30+
|Swedish |sv, sv-SE |{tick} |{tick}
31+
|Swedish (Finland) |sv-FI |{cross} |{tick}
3232
|===

0 commit comments

Comments
 (0)