tui-image-editor汉化

tui-image-editor是一款开源的在线图片编辑包。
官网:
https://nhn.github.io/tui.image-editor/
该工具未提供中文支持,下面是汉化的内容。
// local_zh_cn.js
const locale_zh_cn = {
    'Load': '加载本地',
    'Download': '下载当前',
    'Custom': '自定义',
    'Square': '正方形',
    'Apply': '应用',
    'Cancel': '取消',
    'Free': '自由设定',
    'Straight': '直线',
    'Color': '颜色',
    'Range': '粗细',
    'Grayscale': '灰度',
    'Invert': '旋转',
    'Sepia': '深褐色',
    'Sepia2': '深褐色2',
    'Blur': '模糊',
    'Sharpen': '锐化',
    'Emboss': '浮雕',
    'Remove White': '消除白色',
    'Distance': '边距',
    'Brightness': '亮度',
    'Noise': '降噪',
    'Pixelate': '像素化',
    'Color Filter': '颜色过滤',
    'Threshold': '阈值',
    'Tint': '色调',
    'Multiply': '复合',
    'Flip X': '镜像',
    'Flip Y': '翻转',
    'Reset': '重置',
    'Arrow-1': '箭头1',
    'Arrow-2': '箭头2',
    'Arrow-3': '箭头3',
    'Star-1': '星形1',
    'Star-2': '星形2',
    'Polygon': '多边形',
    'Location': '定位',
    'Heart': '心形',
    'Bubble': '气泡',
    'Custom icon': '自定义图标',
    'Load Mask Image': '加载水印',
    'Load Mask Image': '加载水印',
    'Width': '宽',
    'Height': '高',
    'Lock Aspect Ratio': '保持尺寸比例',
    'Rectangle': '矩形',
    'Circle': '圆形',
    'Triangle': '三角形',
    'Fill': '填充',
    'Stroke': '画笔',
    'Bold': '加粗',
    'Italic': '斜体',
    'Underline': '下划线',
    'Left': '居左',
    'Center': '居中',
    'Right': '居右',
    'Text size': '字体大小',
    'Zoom In': '放大',
    'Zoom Out': '缩小',
    'ZoomIn': '放大',
    'ZoomOut': '缩小',
    'Hand': '拖动',
    'Resize': '尺寸',
    'Crop': '裁剪',
    'Crop': '裁剪',
    'Flip': '翻转',
    'Rotate': '旋转',
    'Draw': '画笔',
    'Shape': '形状',
    'Icon': '图标',
    'Text': '文字',
    'Mask': '水印',
    'Filter': '滤镜',
    'History': '历史动作',
    'Undo': '撤退',
    'Redo': '重做',
    'Delete': '去除',
    'DeleteAll': '全部去除',
    'Blend': '混合',
};
export default locale_zh_cn;
 
使用:
// index.vue
import local_zhCn from './zh_cn';
....
editImgRef.value = new ImageEditor(document.getElementById('digImgRef'), {
          includeUI: {
            loadImage: {
              path: '// path‘
              name: '//name',
            },
            locale: local_zhCn, //加载语言包。
            initMenu: 'filter',
            menuBarPosition: 'bottom',
          },
          cssMaxWidth: window.innerWidth * 1 < 800 ? 800 : window.innerWidth,
          cssMaxHeight: window.innerHeight * 1 < 800 ? 800 : window.innerHeight,
          selectionStyle: {
            cornerSize: 20,
            rotatingPointOffset: 70,
          },
        });
....
posted @ 2024-03-05 14:10  ckaaaa  阅读(38)  评论(0编辑  收藏  举报