@bhsd/codemirror-mediawiki 2.3.2 → 2.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,6 +16,7 @@
16
16
  - [extraKeys](#extrakeys)
17
17
  - [getLinter](#getlinter)
18
18
  - [lint](#lint)
19
+ - [localize](#localize)
19
20
  - [prefer](#prefer)
20
21
  - [setContent](#setcontent)
21
22
  - [setIndent](#setindent)
@@ -181,6 +182,24 @@ cm.lint(doc => [
181
182
 
182
183
  </details>
183
184
 
185
+ ## localize
186
+
187
+ <details>
188
+ <summary>Expand</summary>
189
+
190
+ *version added: 2.3.3*
191
+
192
+ **param**: `Record<string, string>` localization table
193
+ Set the localization table.
194
+
195
+ ```js
196
+ cm.localize({
197
+ 'Find': '查找',
198
+ });
199
+ ```
200
+
201
+ </details>
202
+
184
203
  ## prefer
185
204
 
186
205
  <details>
@@ -40,7 +40,10 @@ export declare class CodeMirror6 {
40
40
  * @param indent 缩进字符串
41
41
  */
42
42
  setIndent(indent: string): void;
43
- /** 获取默认linter */
43
+ /**
44
+ * 获取默认linter
45
+ * @param opt 选项
46
+ */
44
47
  getLinter(opt?: Record<string, unknown>): Promise<LintSource | undefined>;
45
48
  /**
46
49
  * 重设编辑器内容
@@ -57,6 +60,11 @@ export declare class CodeMirror6 {
57
60
  * @param keys 快捷键
58
61
  */
59
62
  extraKeys(keys: KeyBinding[]): void;
63
+ /**
64
+ * 设置翻译信息
65
+ * @param messages 翻译信息
66
+ */
67
+ localize(messages: Record<string, string>): void;
60
68
  /**
61
69
  * 替换选中内容
62
70
  * @param view EditorView