diff --git a/README.md b/README.md index 5c17b5679..ef49cba9c 100644 --- a/README.md +++ b/README.md @@ -200,7 +200,7 @@ Markdown 输出的 HTML 所展现的外观。内置 light,dark,wechat 3 套 | minHeight | 编辑区域最小高度 | - | | width | 编辑器总宽度,支持 % | 'auto' | | placeholder | 输入区域为空时的提示 | '' | -| lang | 多语言:en_US, ko_KR, zh_CN | 'zh_CN' | +| lang | 多语言:en_US, ja_JP, ko_KR, zh_CN | 'zh_CN' | | input(value: string, previewElement?: HTMLElement): void | 输入后触发 | - | | focus(value: string): void | 聚焦后触发 | - | | blur(value: string): void | 失焦后触发 | - | diff --git a/README_en_US.md b/README_en_US.md index 2b0c10cb9..0a8226fb2 100644 --- a/README_en_US.md +++ b/README_en_US.md @@ -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, ko_KR, zh_CN | 'zh_CN' | +| lang | i18n: en_US, ja_JP, ko_KR, zh_CN | 'zh_CN' | | input | Trigger after input (value: string, previewElement?: HTMLElement): void | - | | focus | Trigger after focusing (value: string): void | - | | blur | Trigger after out of focus (value: string): void | - | diff --git a/src/index.ts b/src/index.ts index e9b93000b..9aaf05000 100644 --- a/src/index.ts +++ b/src/index.ts @@ -66,7 +66,7 @@ class Vditor extends VditorMethod { const getOptions = new Options(options); const mergedOptions = getOptions.merge(); - if (!["en_US", "ko_KR", "zh_CN"].includes(mergedOptions.lang)) { + if (!["en_US", "ja_JP", "ko_KR", "zh_CN"].includes(mergedOptions.lang)) { throw new Error("options.lang error, see https://hacpai.com/article/1549638745630#options"); } diff --git a/src/ts/i18n/index.ts b/src/ts/i18n/index.ts index 5cde27181..8ff69cdb6 100644 --- a/src/ts/i18n/index.ts +++ b/src/ts/i18n/index.ts @@ -72,6 +72,79 @@ export const i18n: II18n = { "uploading": "uploading...", "wysiwyg": "WYSIWYG", }, + ja_JP: { + "alignCenter": "中央", + "alignLeft": "左側", + "alignRight": "右側", + "alternateText": "イメージタグ", + "bold": "太く", + "both": "エディター & プレビュー", + "check": "チェックリスト", + "code": "コードブロック挿入", + "code-theme": "コードブロックテーマ", + "column": "行列", + "confirm": "確認", + "content-theme": "コンテンツテーマ", + "copied": "コピー完了", + "copy": "コピー", + "delete-column": "列 消去", + "delete-row": "行 消去", + "devtools": "開発ツール", + "down": "ダウンロード", + "downloadTip": "ブラウザがダウンロード機能をサポートしていません。", + "edit": "修正", + "edit-mode": "編集モード", + "emoji": "絵文字", + "export": "書き出し", + "fileTypeError": "サポートしていません。", + "footnoteRef": "脚注参照", + "fullscreen": "全体画面", + "generate": "作成する", + "headings": "タイトル大きさ", + "help": "ヘルプ", + "imageURL": "イメージ URL", + "indent": "字下げ", + "info": "情報", + "inline-code": "インラインコード", + "insert-after": "ブロックの後ろに入力", + "insert-before": "ブロックの前に入力", + "insert-column": "列 挿入", + "insert-row": "行 挿入", + "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": "列", + "splitView": "マークダウン", + "strike": "取り消し線", + "table": "表 挿入", + "textIsNotEmpty": "テキスト(no empty)", + "tooltipText": "ツールチップ", + "undo": "取り消す", + "up": "戻る", + "update": "アップデート", + "upload": "イメージをダウンロードする", + "uploadError": "アップロード失敗", + "uploading": "アップロード中", + "wysiwyg": "ウィジウィグ", + }, ko_KR: { "alignCenter": "가운데", "alignLeft": "왼쪽", diff --git a/types/index.d.ts b/types/index.d.ts index 2bdd8049f..fc160a0e9 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -213,6 +213,7 @@ declare const webkitAudioContext: { interface II18n { en_US: IObject; + ja_JP: IObject; ko_KR: IObject; zh_CN: IObject; } diff --git a/yarn.lock b/yarn.lock index 7f506dbea..ddd387833 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1811,11 +1811,6 @@ assign-symbols@^1.0.0: resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367" integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c= -ast-types@0.9.6: - version "0.9.6" - resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9" - integrity sha1-ECyenpAF0+fjgpvwxPok7oYu6bk= - astral-regex@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/astral-regex/-/astral-regex-1.0.0.tgz#6c8c3fb827dd43ee3918f27b82782ab7658a6fd9" @@ -3477,14 +3472,6 @@ es6-promisify@^5.0.0: dependencies: es6-promise "^4.0.3" -es6-templates@^0.2.3: - version "0.2.3" - resolved "https://registry.yarnpkg.com/es6-templates/-/es6-templates-0.2.3.tgz#5cb9ac9fb1ded6eb1239342b81d792bbb4078ee4" - integrity sha1-XLmsn7He1usSOTQrgdeSu7QHjuQ= - dependencies: - recast "~0.11.12" - through "~2.3.6" - escape-html@~1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" @@ -3520,11 +3507,6 @@ esprima@^4.0.0, esprima@^4.0.1: resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esprima@~3.1.0: - version "3.1.3" - resolved "https://registry.yarnpkg.com/esprima/-/esprima-3.1.3.tgz#fdca51cee6133895e3c88d535ce49dbff62a4633" - integrity sha1-/cpRzuYTOJXjyI1TXOSdv/YqRjM= - esrecurse@^4.1.0: version "4.2.1" resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.2.1.tgz#007a3b9fdbc2b3bb87e4879ea19c92fdbd3942cf" @@ -3748,11 +3730,6 @@ fast-levenshtein@~2.0.6: resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" integrity sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc= -fastparse@^1.1.1: - version "1.1.2" - resolved "https://registry.yarnpkg.com/fastparse/-/fastparse-1.1.2.tgz#91728c5a5942eced8531283c79441ee4122c35a9" - integrity sha512-483XLLxTVIwWK3QTrMGRqUfUpoOs/0hbQrl2oz4J0pAcm3A3bu84wxTFqGqkJzewCLdME38xJLJAxBABfQT8sQ== - faye-websocket@^0.10.0: version "0.10.0" resolved "https://registry.yarnpkg.com/faye-websocket/-/faye-websocket-0.10.0.tgz#4e492f8d04dfb6f89003507f6edbf2d501e7c6f4" @@ -4353,18 +4330,7 @@ html-escaper@^2.0.0: resolved "https://registry.yarnpkg.com/html-escaper/-/html-escaper-2.0.2.tgz#dfd60027da36a36dfcbe236262c00a5822681453" integrity sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg== -html-loader@^0.5.5: - version "0.5.5" - resolved "https://registry.yarnpkg.com/html-loader/-/html-loader-0.5.5.tgz#6356dbeb0c49756d8ebd5ca327f16ff06ab5faea" - integrity sha512-7hIW7YinOYUpo//kSYcPB6dCKoceKLmOwjEMmhIobHuWGDVl0Nwe4l68mdG/Ru0wcUxQjVMEoZpkalZ/SE7zog== - dependencies: - es6-templates "^0.2.3" - fastparse "^1.1.1" - html-minifier "^3.5.8" - loader-utils "^1.1.0" - object-assign "^4.1.1" - -html-minifier@^3.2.3, html-minifier@^3.5.8: +html-minifier@^3.2.3: version "3.5.21" resolved "https://registry.yarnpkg.com/html-minifier/-/html-minifier-3.5.21.tgz#d0040e054730e354db008463593194015212d20c" integrity sha512-LKUKwuJDhxNa3uf/LPR/KVjm/l3rBqtYeCOAekvG8F1vItxMUpueGd94i/asDDr8/1u7InxzFA5EeGjhhG5mMA== @@ -7101,7 +7067,7 @@ pretty-format@^25.2.1, pretty-format@^25.5.0: ansi-styles "^4.0.0" react-is "^16.12.0" -private@^0.1.8, private@~0.1.5: +private@^0.1.8: version "0.1.8" resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff" integrity sha512-VvivMrbvd2nKkiG38qjULzlc+4Vx4wm/whI9pQD35YrARNnhxeiRktSOhSukRLFNlzg6Br/cJPet5J/u19r/mg== @@ -7380,16 +7346,6 @@ realpath-native@^2.0.0: resolved "https://registry.yarnpkg.com/realpath-native/-/realpath-native-2.0.0.tgz#7377ac429b6e1fd599dc38d08ed942d0d7beb866" integrity sha512-v1SEYUOXXdbBZK8ZuNgO4TBjamPsiSgcFr0aP+tEKpQZK8vooEUqV6nm6Cv502mX4NF2EfsnVqtNAHG+/6Ur1Q== -recast@~0.11.12: - version "0.11.23" - resolved "https://registry.yarnpkg.com/recast/-/recast-0.11.23.tgz#451fd3004ab1e4df9b4e4b66376b2a21912462d3" - integrity sha1-RR/TAEqx5N+bTktmN2sqIZEkYtM= - dependencies: - ast-types "0.9.6" - esprima "~3.1.0" - private "~0.1.5" - source-map "~0.5.0" - redent@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/redent/-/redent-1.0.0.tgz#cf916ab1fd5f1f16dfb20822dd6ec7f730c2afde" @@ -8039,7 +7995,7 @@ source-map@^0.4.2: dependencies: amdefine ">=0.0.4" -source-map@^0.5.0, source-map@^0.5.6, source-map@~0.5.0: +source-map@^0.5.0, source-map@^0.5.6: version "0.5.7" resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc" integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w= @@ -8500,11 +8456,6 @@ through2@^2.0.0: readable-stream "~2.3.6" xtend "~4.0.1" -through@~2.3.6: - version "2.3.8" - resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" - integrity sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU= - thunky@^1.0.2: version "1.1.0" resolved "https://registry.yarnpkg.com/thunky/-/thunky-1.1.0.tgz#5abaf714a9405db0504732bbccd2cedd9ef9537d"