Topic: WYSIWYG editor control translation not working
<!-- JQuery Files -->
<script src="~/lib/jquery/jquery.min.js"></script>
<script src="~/lib/jquery-validate/jquery.validate.min.js"></script>
<script src="~/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"></script>
<!-- MDB ESSENTIAL -->
<script src="~/lib/MDB5_pro/mdb.min.js"></script>
<!-- MDB PLUGINS -->
<script src="~/lib/MDB5_pro/plugins/all.min.js"></script>
<script>
window.onload = function () {
var wysiwygElement = document.getElementsByClassName('wysiwyg')[0];
var wysiwygInstance = new WYSIWYG(wysiwygElement, {
translations: {
paragraph: '段落',
textStyle: '字型樣式',
heading: '標題',
preformatted: '預格式化',
bold: '粗體',
italic: '斜體',
strikethrough: '刪除線',
underline: '下劃線',
textcolor: '字體顏色',
textBackgroundColor: '字體背景色',
alignLeft: '靠左',
alignCenter: '置中',
alignRight: '靠右',
alignJustify: '對齊',
insertLink: '插入鏈接',
insertPicture: '插入圖片',
unorderedList: '分數列表',
orderedList: '編號列表',
increaseIndent: '增加縮進',
decreaseIndent: '減少縮進',
insertHorizontalRule: '插入水平線',
showHTML: '顯示 HTML 代碼',
undo: '撤消',
redo: '恢復',
addLinkHead: '添加鏈接',
addImageHead: '添加圖片',
linkUrlLabel: '輸入網址:',
linkDescription: '輸入描述',
imageUrlLabel: '請輸入圖片網址:',
okButton: '確定',
cancelButton: '取消',
moreOptions: '顯示更多選項',
}
});
}
</script>
mlazaru staff answered 2 years ago
There is an error in translation example in the documentation, im going to fix it.
Use wysiwygTranslations
instead of translations
.
https://mdbootstrap.com/snippets/standard/mlazaru/5222959#js-tab-view
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Standard
- MDB Version: MDB5 6.2.0
- Device: Visual Studio 2022
- Browser: Google Chrome
- OS: Windows11
- Provided sample code: No
- Provided link: No