Reputation: 5190
CKEditor 4 stores language-depending content in the lang/
-folder. I have written a custom plugin, which I do keep apart from the original CKEditor-folder. Now I would like to keep additional language-depending texts also separated from the original CKEditor-folder. I don't like to simply add the texts with their labels in the original language-files as it was done before.
http://theholyjava.wordpress.com/2011/04/04/how-to-customize-ckeditor-with-your-own-plugins-skins-configurations/ (section "Custom Language") describes how to define own language-files, but I would like CKEditor keep loading the original language-file, and additionally, namely for the plugin, load additional language data.
How could I do this?
Upvotes: 0
Views: 186
Reputation: 5190
Finally figured it out...
myplugin/lang/
en.js
,de.js
etc.)JS
CKEDITOR.plugins.setLang( 'myplugin', 'en', {
title: 'My Plugin',
});
myplugin/plugin.js
, register the language-files:JS
CKEDITOR.plugins.add('myplugin',
{
lang: 'de,en',
init: function (editor) {
// ...
}
});
Now you can access your locals like this: editor.lang.myplugin.title
The UI Color Plugin gives a good example of that.
Upvotes: 1