Skip to content

Commit 1c4a084

Browse files
committed
Restore clone deep to not fail unit tests.
1 parent a7c9f0d commit 1c4a084

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/ckeditor5-core/src/context.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ import { type Editor } from './editor/editor.js';
2121
import type { LoadedPlugins, PluginConstructor } from './plugin.js';
2222
import type { EditorConfig } from './editor/editorconfig.js';
2323

24+
import { cloneDeep } from 'es-toolkit/compat';
25+
2426
/**
2527
* Provides a common, higher-level environment for solutions that use multiple {@link module:core/editor/editor~Editor editors}
2628
* or plugins that work outside the editor. Use it instead of {@link module:core/editor/editor~Editor.create `Editor.create()`}
@@ -177,7 +179,7 @@ export class Context {
177179
* Since _translate is called often and has no access to the editor config, this is the better place
178180
* to check if translations will be taken from the global variable and update config.language.ui accordingly.
179181
*/
180-
const globalTranslations = global.window.CKEDITOR_TRANSLATIONS;
182+
const globalTranslations = cloneDeep( global.window.CKEDITOR_TRANSLATIONS );
181183
const uiLanguageFromConfig = typeof languageConfig === 'string' ? languageConfig : languageConfig.ui;
182184
const hasMatchingTranslations = globalTranslations[ uiLanguageFromConfig! ];
183185
const defaultGlobalTranslationsLanguage = Object.keys( globalTranslations )[ 0 ];

0 commit comments

Comments
 (0)