diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d6c757..96ce238 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,9 +2,11 @@ ## Unreleased +- Added `craft\ckeditor\web\assets\BaseCkeditorPackageAsset::getImportCompliantLanguage()`. - Fixed a bug where custom `toolbar` config settings were getting ignored. ([#522](https://github.com/craftcms/ckeditor/issues/522)) - Fixed a bug where files uploaded to Assets fields could also be added to nearby CKEditor fields. ([#523](https://github.com/craftcms/ckeditor/issues/523)) - Fixed an error that could occur when registering a custom CKEditor plugin. ([#525](https://github.com/craftcms/ckeditor/issues/525)) +- Fixed a JavaScript error that occurred if the control panel was being translated into a language that CKEditor doesn’t support. ([#526](https://github.com/craftcms/ckeditor/issues/526)) ## 5.1.0 - 2026-03-05 diff --git a/src/Field.php b/src/Field.php index b1b7a98..1d516d5 100644 --- a/src/Field.php +++ b/src/Field.php @@ -1432,7 +1432,8 @@ private function _inputHtml(mixed $value, ?ElementInterface $element, bool $stat // Add the translation import $uiLanguage = BaseCkeditorPackageAsset::uiLanguage(); - $uiTranslationImport = "import coreTranslations from 'ckeditor5/translations/$uiLanguage.js';"; + $importCompliantUiLanguage = BaseCkeditorPackageAsset::getImportCompliantLanguage(BaseCkeditorPackageAsset::uiLanguage()); + $uiTranslationImport = "import coreTranslations from 'ckeditor5/translations/$importCompliantUiLanguage.js';"; $view->registerScriptWithVars(fn($baseConfigJs, $toolbarJs, $languageJs, $showWordCountJs, $wordLimitJs, $characterLimitJs, $imageMode) => <<