craftcms / ckeditor

Edit rich text content in Craft CMS using CKEditor.
https://plugins.craftcms.com/ckeditor
GNU General Public License v3.0
47 stars 25 forks source link

Built-In Plugin "Text-Part-Language" - translations could not be overridden #130

Closed alexkuzmin closed 1 year ago

alexkuzmin commented 1 year ago

Translations for built-in plugins "Text-Part-Language" does not work

Screenshot 2023-08-28 at 13 55 27

I'm trying to override the translations for "Text-Part-Language", which is built-in in Craft-CKEditor. The translations are placed in /translations/de/ckeditor.php. Translations e.g. for Image Plugin work successfully from there, but for Text-Part-Language not. Maybe someone has a hint, how could be added the translations for that plugin? Thanks.

Additional info

brandonkelly commented 1 year ago

Translations provided by CKEditor packages are JS-only. All core packages’ translations get compiled into src/web/assets/ckeditor/dist/translations.

If it’s possible to override them (I’m not really sure), it would need to be via another CKEditor JS plugin.

alexkuzmin commented 1 year ago

Thanks. If I add this plugin additionally as CKEditor JS plugin, the translation overrides really works. At the beginning it throws an error that two plugins have the same names, so the names should be different:

public array $pluginNames = [
        'TextPartLanguage2', // should be different
];

public array $toolbarItems = [
        'textPartLanguage', // should be same
];

Then I've corrected the translations in assetbundles/[plugin]/build/translations/de.js, and they are displayed correctly.

Screenshot 2023-08-30 at 10 36 10