Skip to content

Commit

Permalink
feat(Editor): support localizer (#921)
Browse files Browse the repository at this point in the history
* feat: 支持多语言

* chore: bump version 7.1.0
  • Loading branch information
ArgoZhang authored Mar 30, 2023
1 parent f1780b6 commit e4cdeca
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<Import Project="..\..\..\bundleconfig.props" />

<PropertyGroup>
<Version>7.0.0</Version>
<Version>7.1.0</Version>
</PropertyGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,14 @@ export function bb_editor_method(el, obj, method, parameter) {
return $this.hasClass('open') ? $this.summernote(op) : $this.html();
}

const editorLangConfig = $.summernote.lang[options.lang].bb_editor
let title = ''
let tooltip = ''
if (editorLangConfig) {
title = editorLangConfig.submit
tooltip = editorLangConfig.tooltip
}

// div 点击事件
$this.on('click', op, function (event, args) {
var $this = $(this).tooltip('hide');
Expand All @@ -70,11 +78,15 @@ export function bb_editor_method(el, obj, method, parameter) {
break;
}
});
var $done = $('<div class="note-btn-group btn-group note-view note-right"><button type="button" class="note-btn btn btn-sm note-btn-close" tabindex="-1" data-method="submit" title="完成" data-bs-placement="bottom"><i class="fa-solid fa-check"></i></button></div>').appendTo($toolbar).find('button').tooltip({ container: 'body' });

var $done = $('<div class="note-btn-group btn-group note-view note-right"><button type="button" class="note-btn btn btn-sm note-btn-close" tabindex="-1" data-method="submit" data-bs-placement="bottom"><i class="fa-solid fa-check"></i></button></div>').appendTo($toolbar).find('button').tooltip({
title: title,
container: 'body'
});
$('body').find('.note-group-select-from-files [accept="image/*"]').attr('accept', 'image/bmp,image/png,image/jpg,image/jpeg,image/gif');
});

}).tooltip({ title: '点击展开编辑' });
}).tooltip({ title: tooltip });

if (op.value) $this.html(op.value);
if ($this.hasClass('open')) {
Expand Down Expand Up @@ -199,6 +211,19 @@ export function bb_editor_method(el, obj, method, parameter) {
},
specialChar: {
specialChar: "特殊字符", select: "选取特殊字符"
},
bb_editor: {
tooltip: "点击展开编辑",
submit: "完成"
}
}
});
$.extend(true, $.summernote.lang, {
"en-US":
{
bb_editor: {
tooltip: "Click to edit",
submit: "submit"
}
}
});
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e4cdeca

Please sign in to comment.