1
ckeditor 커스텀 플러그인을 만들었습니다. 이제 선택한 언어에서 툴팁 언어를 동적으로 변경하려고합니다. 번역 된 툴팁 텍스트를 ckeditor의 lang 폴더에있는 해당 js 파일에 넣으려고했지만 작동하지 않습니다. 당신이 도구 모음 단추를 만드는 경우커스텀 플러그인의 툴팁 언어 변경하기 Ckedtior
ckeditor 커스텀 플러그인을 만들었습니다. 이제 선택한 언어에서 툴팁 언어를 동적으로 변경하려고합니다. 번역 된 툴팁 텍스트를 ckeditor의 lang 폴더에있는 해당 js 파일에 넣으려고했지만 작동하지 않습니다. 당신이 도구 모음 단추를 만드는 경우커스텀 플러그인의 툴팁 언어 변경하기 Ckedtior
,이 같은 플러그인의 pluginDefinition.init 내 editor.ui.addButton에 추가 : 이제 당신의 언어를 가정하여
이CKEDITOR.plugins.add('pluginName', {
lang: 'lan,gua,ges,sup,por,ted,by,this,plu,gin,com,ma,se,pa,ra,ted',
icons: 'icons,used,by,this,plugin',
requires: 'anotherPlugin',
init: function(editor) {
// Register the toolbar button.
if (editor.ui.addButton) {
editor.ui.addButton('ButtonName', {
label: editor.lang.pluginName.labelName, // Your label
command: 'yourcommand', // Command name
directional: true, // Depends on BiDi support, optional
toolbar: 'list,10' // Wherever you want, in fact
});
}
...
}
});
다음 pluginName/lang/foo.js
는 다음과 같이한다 foo
입니다 :
CKEDITOR.plugins.setLang('pluginName', 'foo', {
labelName: 'My label!'
});
pluginDefinition
의 개체 리터럴 내부에있는 lang
속성에 foo
을 추가해야합니다.
CKEDITOR.plugins.add('pluginName', {
lang: 'foo',
...
});
일반적으로 editor.lang.pluginName.labelName
은 init
내에서 사용할 수 있습니다.