首页 > 解决方案 > 在 CKEditor 中更改插件标题的语言

问题描述

在此处输入图像描述

我想根据语言更改标题“表情符号列表”的值。说法语,它来自 fr.js

如何修改语言值

CKEDITOR.lang['fr']['emoji']['title'] = 'abcd';

我正在这样做,

CKEDITOR.on('instanceLoaded', function(evt) {
  CKEDITOR.lang['fr']['emoji']['title'] = 'abcd';
});

标签: ckeditor

解决方案


From what I have checked the Emoji plugin only has the English translation: https://github.com/ckeditor/ckeditor-dev/tree/major/plugins/emoji/lang.

If you want to add French language manually to that plugin, here is how:

  1. Download CKEditor repo from Github - https://github.com/ckeditor/ckeditor-dev
  2. Go to https://github.com/ckeditor/ckeditor-dev/tree/major/plugins/emoji/lang and copy-paste en.js file
  3. Rename it to fr.js
  4. Open fr.js, change the language code in CKEDITOR.plugins.setLang( 'emoji', 'en', { to fr and change all the translations of key:translation pairs from English to French (please remember to leave the keys untouched).
  5. Go to https://github.com/ckeditor/ckeditor-dev/blob/major/plugins/emoji/plugin.js#L548 and change lang: 'en', to lang: 'en,fr',.
  6. Once this is done, you can build your own editor instance - https://ckeditor.com/docs/ckeditor4/latest/guide/dev_build.html

If you would like to also help the community, you can join the CKEditor translation center and provide your translations there: https://ckeditor.com/docs/ckeditor4/latest/guide/dev_uilanguage.html


推荐阅读