diff --git a/djangocms_text_ckeditor/static/djangocms_text_ckeditor/ckeditor_plugins/cmsplugins/plugin.js b/djangocms_text_ckeditor/static/djangocms_text_ckeditor/ckeditor_plugins/cmsplugins/plugin.js index 465a69f..17a12d1 100644 --- a/djangocms_text_ckeditor/static/djangocms_text_ckeditor/ckeditor_plugins/cmsplugins/plugin.js +++ b/djangocms_text_ckeditor/static/djangocms_text_ckeditor/ckeditor_plugins/cmsplugins/plugin.js @@ -212,7 +212,7 @@ $(document).ready(function () { // on ajax receivement from server, build or tag dependig in the plugin type insertPlugin: function (data) { var element, attrs = { id: 'plugin_obj_' + data.plugin_id }; - if (data.plugin_type === 'Link') { + if (data.plugin_type === this.options.lang.link) { element = new CKEDITOR.dom.element('a', this.editor.document); $.extend(attrs, { 'href': '#', @@ -234,7 +234,8 @@ $(document).ready(function () { }, setupDataProcessor: function () { - var link_pattern = /^Link\s-\s(.+)$/; + var link_name = this.options.lang.link; + var link_pattern = new RegExp("/^"+ link_name +"\s-\s(.+)$/"); this.editor.dataProcessor.dataFilter.addRules({ elements: { @@ -242,7 +243,7 @@ $(document).ready(function () { img: function(element) { var new_element, matches; if (element.attributes.id && element.attributes.alt - && element.attributes.alt === 'Link' + && element.attributes.alt === link_name && element.attributes.id.indexOf('plugin_obj_') === 0) { matches = link_pattern.exec(element.attributes.title); new_element = new CKEDITOR.htmlParser.element('a', { diff --git a/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html b/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html index e35453b..7b4479c 100644 --- a/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html +++ b/djangocms_text_ckeditor/templates/cms/plugins/widgets/ckeditor.html @@ -30,7 +30,8 @@ $(document).ready(function () { 'toolbar': '{% filter escapejs %}{% trans "CMS Plugins" %}{% endfilter %}', 'add': '{% filter escapejs %}{% trans "Add CMS Plugin" %}{% endfilter %}', 'edit': '{% filter escapejs %}{% trans "Edit CMS Plugin" %}{% endfilter %}', - 'aria': '{% filter escapejs %}{% trans "CMS Plugins" %}{% endfilter %}' + 'aria': '{% filter escapejs %}{% trans "CMS Plugins" %}{% endfilter %}', + 'link': '{% filter escapejs %}{% trans "Link" %}{% endfilter %}' }, 'plugins': [ {% regroup installed_plugins by module as module_list %}