js数据处理
const translations = {
'editor.remove': 'Remove',
'editor.copy': 'Copy',
'editor.words': 'WORDS',
'editor.characters': 'CHARACTERS',
'editor.default': 'Default',
'editor.recent': 'Recently Used',
'editor.nofill': 'Remove Color',
'editor.format': 'Format Painter',
'editor.draghandle.tooltip': 'Click And Drag',
'editor.copyToClipboard': 'CopyToClipboard',
'editor.importWrod.tooltip': 'Import Word',
'editor.slash': "Press '/' for commands",
'editor.slash.empty': 'No Result',
'editor.slash.format': 'Format',
'editor.slash.insert': 'Insert',
'editor.slash.embed': 'Embed Services',
'editor.content': 'Please input content',
'editor.moremark': 'More Text Styles',
'editor.size.small.tooltip': 'Small',
'editor.size.medium.tooltip': 'Medium',
'editor.size.large.tooltip': 'Cover',
'editor.bold.tooltip': 'Bold',
'editor.italic.tooltip': 'Italic',
'editor.underline.tooltip': 'Underline',
'editor.strike.tooltip': 'Strike',
'editor.color.tooltip': 'Color',
'editor.color.more': 'Color Picker',
'editor.highlight.tooltip': 'Highlight',
'editor.lineheight.tooltip': 'Line Height',
'editor.heading.tooltip': 'Headings',
'editor.heading.h1.tooltip': 'Heading 1',
'editor.heading.h2.tooltip': 'Heading 2',
'editor.heading.h3.tooltip': 'Heading 3',
'editor.heading.h4.tooltip': 'Heading 4',
'editor.heading.h5.tooltip': 'Heading 5',
'editor.heading.h6.tooltip': 'Heading 6',
'editor.paragraph.tooltip': 'Paragraph',
'editor.textalign.tooltip': 'Align',
'editor.textalign.left.tooltip': 'Left',
'editor.textalign.center.tooltip': 'Center',
'editor.textalign.right.tooltip': 'Right',
'editor.textalign.justify.tooltip': 'Justify',
'editor.indent': 'Indent',
'editor.indent.indent': 'Increase Indent',
'editor.indent.outdent': 'Decrease Indent',
'editor.fontFamily.tooltip': 'Font family',
'editor.fontSize.tooltip': 'Font size',
'editor.fontSize.default.tooltip': 'Default',
'editor.superscript.tooltip': 'Superscript',
'editor.subscript.tooltip': 'Subscript',
'editor.bulletlist.tooltip': 'Bullet List',
'editor.orderedlist.tooltip': 'Ordered List',
'editor.tasklist.tooltip': 'Task List',
'editor.indent.tooltip': 'Indent',
'editor.outdent.tooltip': 'Outdent',
'editor.columns.tooltip': 'Columns',
'editor.link.tooltip': 'Link',
'editor.link.unlink.tooltip': 'UnLink',
'editor.link.open.tooltip': 'Open Link',
'editor.link.edit.tooltip': 'Edit Link',
'editor.link.dialog.title': 'Insert Link',
'editor.link.dialog.link': 'Link',
'editor.link.dialog.text': 'Text',
'editor.link.dialog.openInNewTab': 'Open In New Tab',
'editor.link.dialog.link.placeholder': 'Link Address',
'editor.link.dialog.text.placeholder': 'Add Description',
'editor.link.dialog.button.apply': 'Apply',
'editor.image.tooltip': 'Image',
'editor.image.dragger.tooltip': 'Click or drag the image to the area to upload',
'editor.image.float.left.tooltip': 'Float left',
'editor.image.float.none.tooltip': 'Float none',
'editor.image.float.right.tooltip': 'Float right',
'editor.image.dialog.title': 'Add an image',
'editor.image.dialog.tab.url': 'Url',
'editor.image.dialog.tab.upload': 'Upload',
'editor.image.dialog.uploading': 'Uploading',
'editor.image.dialog.form.link': 'Link',
'editor.image.dialog.placeholder': 'Link',
'editor.image.dialog.form.alt': 'Alt',
'editor.image.dialog.form.aspectRatio': 'Lock original aspect ratio',
'editor.image.dialog.form.file': 'File',
'editor.image.dialog.button.apply': 'apply',
'editor.video.tooltip': 'Video',
'editor.video.dialog.tab.upload': 'Upload',
'editor.video.dialog.uploading': 'Uploading',
'editor.video.dialog.title': 'Embed or upload a video',
'editor.video.dialog.link': 'link',
'editor.video.dialog.placeholder': 'Link',
'editor.video.dialog.button.apply': 'apply',
'editor.table.tooltip': 'Table',
'editor.table.menu.insert_table': 'Insert Table',
'editor.table.menu.insert_table.with_header_row': 'With header row',
'editor.table.menu.insertColumnBefore': 'Insert Column Before',
'editor.table.menu.insertColumnAfter': 'Insert Column After',
'editor.table.menu.deleteColumn': 'Delete Column',
'editor.table.menu.insertRowAbove': 'Insert Row Above',
'editor.table.menu.insertRowBelow': 'Insert Row Below',
'editor.table.menu.deleteRow': 'Delete Row',
'editor.table.menu.mergeCells': 'Merge Cells',
'editor.table.menu.splitCells': 'Split Cells',
'editor.table.menu.deleteTable': 'Delete Table',
'editor.table.menu.setCellsBgColor': 'Cell Background Color',
'editor.blockquote.tooltip': 'Blockquote',
'editor.horizontalrule.tooltip': 'Horizontal Rule',
'editor.code.tooltip': 'Code',
'editor.codeblock.tooltip': 'Code Block',
'editor.clear.tooltip': 'Clear Format',
'editor.undo.tooltip': 'Undo',
'editor.redo.tooltip': 'Redo',
'editor.fullscreen.tooltip.fullscreen': 'Fullscreen',
'editor.fullscreen.tooltip.exit': 'Fullscreen Exit',
'editor.imageUpload.fileTypeNotSupported': 'File type not supported',
'editor.imageUpload.fileSizeTooBig': 'File size too big, Maximum size is'
};
如何使用js转换
const translations = {
editor: {
remove: 'Remove',
copy: 'Copy',
words: 'WORDS',
characters: 'CHARACTERS',
default: 'Default',
recent: 'Recently Used',
nofill: 'Remove Color',
format: 'Format Painter',
draghandle: {
tooltip: 'Click And Drag'
},
copyToClipboard: 'CopyToClipboard',
importWrod: {
tooltip: 'Import Word'
},
slash: {
default: "Press '/' for commands",
empty: 'No Result',
format: 'Format',
insert: 'Insert',
embed: 'Embed Services'
},
content: 'Please input content',
moremark: 'More Text Styles',
size: {
small: {
tooltip: 'Small'
},
medium: {
tooltip: 'Medium'
},
large: {
tooltip: 'Cover'
}
},
bold: {
tooltip: 'Bold'
},
italic: {
tooltip: 'Italic'
},
underline: {
tooltip: 'Underline'
},
strike: {
tooltip: 'Strike'
},
color: {
tooltip: 'Color',
more: 'Color Picker'
},
highlight: {
tooltip: 'Highlight'
},
lineheight: {
tooltip: 'Line Height'
},
heading: {
tooltip: 'Headings',
h1: {
tooltip: 'Heading 1'
},
h2: {
tooltip: 'Heading 2'
},
h3: {
tooltip: 'Heading 3'
},
h4: {
tooltip: 'Heading 4'
},
h5: {
tooltip: 'Heading 5'
},
h6: {
tooltip: 'Heading 6'
}
},
paragraph: {
tooltip: 'Paragraph'
},
textalign: {
tooltip: 'Align',
left: {
tooltip: 'Left'
},
center: {
tooltip: 'Center'
},
right: {
tooltip: 'Right'
},
justify: {
tooltip: 'Justify'
}
},
indent: 'Indent',
indent: {
indent: 'Increase Indent',
outdent: 'Decrease Indent'
},
fontFamily: {
tooltip: 'Font family'
},
fontSize: {
tooltip: 'Font size',
default: {
tooltip: 'Default'
}
},
superscript: {
tooltip: 'Superscript'
},
subscript: {
tooltip: 'Subscript'
},
bulletlist: {
tooltip: 'Bullet List'
},
orderedlist: {
tooltip: 'Ordered List'
},
tasklist: {
tooltip: 'Task List'
},
indent: {
tooltip: 'Indent'
},
outdent: {
tooltip: 'Outdent'
},
columns: {
tooltip: 'Columns'
},
link: {
tooltip: 'Link',
unlink: {
tooltip: 'UnLink'
},
open: {
tooltip: 'Open Link'
},
edit: {
tooltip: 'Edit Link'
},
dialog: {
title: 'Insert Link',
link: 'Link',
text: 'Text',
openInNewTab: 'Open In New Tab',
link: {
placeholder: 'Link Address'
},
text: {
placeholder: 'Add Description'
},
button: {
apply: 'Apply'
}
}
},
image: {
tooltip: 'Image',
dragger: {
tooltip: 'Click or drag the image to the area to upload'
},
float: {
left: {
tooltip: 'Float left'
},
none: {
tooltip: 'Float none'
},
right: {
tooltip: 'Float right'
}
},
dialog: {
title: 'Add an image',
tab: {
url: 'Url',
upload: 'Upload'
},
uploading: 'Uploading',
form: {
link: 'Link',
placeholder: 'Link',
alt: 'Alt',
aspectRatio: 'Lock original aspect ratio',
file: 'File'
},
button: {
apply: 'apply'
}
}
},
video: {
tooltip: 'Video',
dialog: {
tab: {
upload: 'Upload'
},
uploading: 'Uploading',
title: 'Embed or upload a video',
link: 'link',
placeholder: 'Link',
button: {
apply: 'apply'
}
}
},
table: {
tooltip: 'Table',
menu: {
insert_table: 'Insert Table',
with_header_row: 'With header row',
insertColumnBefore: 'Insert Column Before',
insertColumnAfter: 'Insert Column After',
deleteColumn: 'Delete Column',
insertRowAbove: 'Insert Row Above',
insertRowBelow: 'Insert Row Below',
deleteRow: 'Delete Row',
mergeCells: 'Merge Cells',
splitCells: 'Split Cells',
deleteTable: 'Delete Table',
setCellsBgColor: 'Cell Background Color'
}
},
blockquote: {
tooltip: 'Blockquote'
},
horizontalrule: {
tooltip: 'Horizontal Rule'
},
code: {
tooltip: 'Code'
},
codeblock: {
tooltip: 'Code Block'
},
clear: {
tooltip: 'Clear Format'
},
undo: {
tooltip: 'Undo'
},
redo: {
tooltip: 'Redo'
},
fullscreen: {
tooltip: {
fullscreen: 'Fullscreen',
exit: 'Fullscreen Exit'
}
},
imageUpload: {
fileTypeNotSupported: 'File type not supported',
fileSizeTooBig: 'File size too big, Maximum size is'
}
}
};