2013-07-20 2 views
1

ckeditor 커스텀 플러그인을 만들었습니다. 이제 선택한 언어에서 툴팁 언어를 동적으로 변경하려고합니다. 번역 된 툴팁 텍스트를 ckeditor의 lang 폴더에있는 해당 js 파일에 넣으려고했지만 작동하지 않습니다. 당신이 도구 모음 단추를 만드는 경우커스텀 플러그인의 툴팁 언어 변경하기 Ckedtior

답변

3

,이 같은 플러그인의 pluginDefinition.initeditor.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.labelNameinit 내에서 사용할 수 있습니다.

관련 문제