Skip to content

Commit

Permalink
feat: 加入繁體中文
Browse files Browse the repository at this point in the history
  • Loading branch information
ti777777 authored and Vanessa219 committed Apr 30, 2021
1 parent 3142e2b commit 1e40e80
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -200,7 +200,7 @@ Markdown 输出的 HTML 所展现的外观。内置 light,dark,wechat 3 套
| minHeight | 编辑区域最小高度 | - |
| width | 编辑器总宽度,支持 % | 'auto' |
| placeholder | 输入区域为空时的提示 | '' |
| lang | 多语言:en_US, ja_JP, ko_KR, ru_RU, zh_CN | 'zh_CN' |
| lang | 多语言:en_US, ja_JP, ko_KR, ru_RU, zh_CN, zh_TW | 'zh_CN' |
| input(value: string) | 输入后触发 | - |
| focus(value: string) | 聚焦后触发 | - |
| blur(value: string) | 失焦后触发 | - |
Expand Down
2 changes: 1 addition & 1 deletion README_en_US.md
Expand Up @@ -177,7 +177,7 @@ Can be filled with element `id` or element itself` HTMLElement`
| minHeight | Editing area minimum height | - |
| width | Total editor width, supports % | 'auto' |
| placeholder | Tips when the input area is empty | '' |
| lang | i18n: en_US, ja_JP, ko_KR, ru_RU, zh_CN | 'zh_CN' |
| lang | i18n: en_US, ja_JP, ko_KR, ru_RU, zh_CN, zh_TW | 'zh_CN' |
| input | Trigger after input (value: string) | - |
| focus | Trigger after focusing (value: string) | - |
| blur | Trigger after out of focus (value: string) | - |
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Expand Up @@ -67,7 +67,7 @@ class Vditor extends VditorMethod {
const getOptions = new Options(options);
const mergedOptions = getOptions.merge();

if (!["en_US", "ja_JP", "ko_KR", "ru_RU", "zh_CN"].includes(mergedOptions.lang)) {
if (!["en_US", "ja_JP", "ko_KR", "ru_RU", "zh_CN", "zh_TW"].includes(mergedOptions.lang)) {
throw new Error("options.lang error, see https://ld246.com/article/1549638745630#options");
}

Expand Down
79 changes: 79 additions & 0 deletions src/ts/i18n/index.ts
Expand Up @@ -394,4 +394,83 @@ export const i18n: II18n = {
"uploading": "上传中...",
"wysiwyg": "所见即所得",
},
zh_TW: {
"alignCenter": "置中",
"alignLeft": "置左",
"alignRight": "置右",
"alternateText": "替代文字",
"bold": "粗體",
"both": "編輯 & 預覽",
"check": "任務列表",
"close": "關閉",
"code": "代碼塊",
"code-theme": "代碼塊主題預覽",
"column": "欄",
"comment": "評論",
"confirm": "確定",
"content-theme": "內容主題預覽",
"copied": "已複製",
"copy": "複製",
"delete-column": "刪除欄",
"delete-row": "刪除列",
"devtools": "開發者工具",
"down": "下",
"downloadTip": "該瀏覽器不支持下載功能",
"edit": "編輯",
"edit-mode": "切換編輯模式",
"emoji": "表情",
"export": "匯出",
"fileTypeError": "檔案類型不允許上傳",
"footnoteRef": "腳註參考",
"fullscreen": "全螢幕切換",
"generate": "生成中",
"headings": "標題",
"help": "幫助",
"imageURL": "圖片位址",
"indent": "列表縮排",
"info": "關於",
"inline-code": "行內代碼",
"insert-after": "末尾插入列",
"insert-before": "起始插入列",
"insertColumnLeft": "在左邊插入一欄",
"insertColumnRight": "在右邊插入一欄",
"insertRowAbove": "在上方插入一行",
"insertRowBelow": "在下方插入一行",
"instantRendering": "即時渲染",
"italic": "斜體",
"language": "語言",
"line": "分隔線",
"link": "連結",
"linkRef": "連結參考",
"list": "無序列表",
"more": "更多",
"nameEmpty": "文件名不能為空",
"ordered-list": "有序列表",
"outdent": "列表反向縮排",
"outline": "大綱",
"over": "超過",
"performanceTip": "即時預覽需 ${x}ms,可點擊編輯 & 預覽按鈕進行關閉",
"preview": "預覽",
"quote": "引用",
"record": "開始錄音/結束錄音",
"record-tip": "該設備不支持錄音功能",
"recording": "錄音中...",
"redo": "重做",
"remove": "刪除",
"row": "列",
"spin": "旋轉",
"splitView": "分割預覽",
"strike": "刪除縣",
"table": "表格",
"textIsNotEmpty": "文字(不能為空)",
"title": "標題",
"tooltipText": "提示文字",
"undo": "撤銷",
"up": "上",
"update": "更新",
"upload": "上傳圖片或文件",
"uploadError": "上傳錯誤",
"uploading": "上傳中...",
"wysiwyg": "所見即所得",
}
};
1 change: 1 addition & 0 deletions types/index.d.ts
Expand Up @@ -229,6 +229,7 @@ interface II18n {
ko_KR: IObject;
ru_RU: IObject;
zh_CN: IObject;
zh_TW: IObject;
}

interface IClasses {
Expand Down

0 comments on commit 1e40e80

Please sign in to comment.