-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
editor builder defaultConfig.language not apply to editor.locale #8510
Comments
Hi, thanks for the report. Indeed after changing the language the |
📝 Steps
✔️ Expected result
❌ Actual result
❓ Possible solution
Solution (SPOILER)diff --git a/packages/ckeditor5-core/src/editor/editor.js b/packages/ckeditor5-core/src/editor/editor.js
index 141a7076f2..c4677263c4 100644
--- a/packages/ckeditor5-core/src/editor/editor.js
+++ b/packages/ckeditor5-core/src/editor/editor.js
@@ -52,6 +52,8 @@ export default class Editor {
* @param {Object} [config={}] The editor configuration.
*/
constructor( config = {} ) {
+ const language = config.language || this.constructor.defaultConfig.language;
+
/**
* The editor context.
* When it is not provided through the configuration, the editor creates it.
@@ -59,7 +61,7 @@ export default class Editor {
* @protected
* @type {module:core/context~Context}
*/
- this._context = config.context || new Context( { language: config.language } );
+ this._context = config.context || new Context( { language } );
this._context._addEditor( this, !config.context );
// Clone the plugins to make sure that the plugin array will not be shared
Make sure to cover this change with tests:
|
☝️ remember that the build is not refreshed when applying changes in its sources. Please call the |
Fix (core): Support language configuration passed in defaultConfig option through editor's constructor. Closes #8510.
This might solve https://www.drupal.org/project/drupal/issues/3250191 🤞 |
📝 Provide detailed reproduction steps (if any)
ckeditor5/packages/ckeditor5-build-decoupled-document
to build custom editorckeditor5/packages/ckeditor5-build-decoupled-document/src/ckeditor.js
thedefaultConfig.language
tozh-cn
✔️ Expected result
ui is
zh-cn
and editor.locale also too❌ Actual result
only ui display language in
zh-cn
. editor.locale language still isen
,both uiLanguage and cotentLanguage📃 Other details
If you'd like to see this fixed sooner, add a 👍 reaction to this post.
The text was updated successfully, but these errors were encountered: