@fresh-editor/fresh-editor 0.1.67 → 0.1.70

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +97 -0
  2. package/README.md +2 -0
  3. package/package.json +1 -1
  4. package/plugins/audit_mode.i18n.json +380 -0
  5. package/plugins/audit_mode.ts +836 -68
  6. package/plugins/buffer_modified.i18n.json +32 -0
  7. package/plugins/buffer_modified.ts +5 -3
  8. package/plugins/calculator.i18n.json +44 -0
  9. package/plugins/calculator.ts +6 -4
  10. package/plugins/clangd-lsp.ts +2 -0
  11. package/plugins/clangd_support.i18n.json +104 -0
  12. package/plugins/clangd_support.ts +18 -16
  13. package/plugins/color_highlighter.i18n.json +68 -0
  14. package/plugins/color_highlighter.ts +12 -10
  15. package/plugins/config-schema.json +28 -145
  16. package/plugins/csharp-lsp.ts +2 -0
  17. package/plugins/csharp_support.i18n.json +38 -0
  18. package/plugins/csharp_support.ts +6 -4
  19. package/plugins/css-lsp.ts +2 -0
  20. package/plugins/diagnostics_panel.i18n.json +110 -0
  21. package/plugins/diagnostics_panel.ts +19 -17
  22. package/plugins/find_references.i18n.json +128 -0
  23. package/plugins/find_references.ts +22 -20
  24. package/plugins/git_blame.i18n.json +230 -0
  25. package/plugins/git_blame.ts +39 -37
  26. package/plugins/git_find_file.i18n.json +146 -0
  27. package/plugins/git_find_file.ts +24 -22
  28. package/plugins/git_grep.i18n.json +80 -0
  29. package/plugins/git_grep.ts +15 -13
  30. package/plugins/git_gutter.i18n.json +44 -0
  31. package/plugins/git_gutter.ts +7 -5
  32. package/plugins/git_log.i18n.json +224 -0
  33. package/plugins/git_log.ts +41 -39
  34. package/plugins/go-lsp.ts +2 -0
  35. package/plugins/html-lsp.ts +2 -0
  36. package/plugins/json-lsp.ts +2 -0
  37. package/plugins/lib/fresh.d.ts +53 -13
  38. package/plugins/lib/index.ts +1 -1
  39. package/plugins/lib/navigation-controller.ts +3 -3
  40. package/plugins/lib/panel-manager.ts +15 -13
  41. package/plugins/lib/virtual-buffer-factory.ts +84 -112
  42. package/plugins/live_grep.i18n.json +80 -0
  43. package/plugins/live_grep.ts +15 -13
  44. package/plugins/markdown_compose.i18n.json +104 -0
  45. package/plugins/markdown_compose.ts +17 -15
  46. package/plugins/merge_conflict.i18n.json +380 -0
  47. package/plugins/merge_conflict.ts +72 -73
  48. package/plugins/path_complete.i18n.json +38 -0
  49. package/plugins/path_complete.ts +6 -4
  50. package/plugins/python-lsp.ts +2 -0
  51. package/plugins/rust-lsp.ts +2 -0
  52. package/plugins/search_replace.i18n.json +188 -0
  53. package/plugins/search_replace.ts +31 -29
  54. package/plugins/test_i18n.i18n.json +12 -0
  55. package/plugins/test_i18n.ts +18 -0
  56. package/plugins/theme_editor.i18n.json +1417 -0
  57. package/plugins/theme_editor.ts +73 -69
  58. package/plugins/todo_highlighter.i18n.json +86 -0
  59. package/plugins/todo_highlighter.ts +15 -13
  60. package/plugins/typescript-lsp.ts +2 -0
  61. package/plugins/vi_mode.i18n.json +716 -0
  62. package/plugins/vi_mode.ts +1195 -78
  63. package/plugins/welcome.i18n.json +110 -0
  64. package/plugins/welcome.ts +18 -16
@@ -0,0 +1,32 @@
1
+ {
2
+ "en": {
3
+ "status.loaded": "Buffer Modified plugin loaded",
4
+ "status.initialized": "Buffer Modified: initialized for %{path}",
5
+ "status.cleared_on_save": "Buffer Modified: cleared on save"
6
+ },
7
+ "es": {
8
+ "status.loaded": "Plugin Buffer Modificado cargado",
9
+ "status.initialized": "Buffer Modificado: inicializado para %{path}",
10
+ "status.cleared_on_save": "Buffer Modificado: limpiado al guardar"
11
+ },
12
+ "de": {
13
+ "status.loaded": "Buffer Modified Plugin geladen",
14
+ "status.initialized": "Buffer Modified: initialisiert für %{path}",
15
+ "status.cleared_on_save": "Buffer Modified: beim Speichern gelöscht"
16
+ },
17
+ "fr": {
18
+ "status.loaded": "Plugin Buffer Modified chargé",
19
+ "status.initialized": "Buffer Modified: initialisé pour %{path}",
20
+ "status.cleared_on_save": "Buffer Modified: effacé lors de la sauvegarde"
21
+ },
22
+ "ja": {
23
+ "status.loaded": "Buffer Modifiedプラグインを読み込みました",
24
+ "status.initialized": "Buffer Modified: %{path}を初期化しました",
25
+ "status.cleared_on_save": "Buffer Modified: 保存時にクリアしました"
26
+ },
27
+ "zh-CN": {
28
+ "status.loaded": "Buffer Modified插件已加载",
29
+ "status.initialized": "Buffer Modified: 已为%{path}初始化",
30
+ "status.cleared_on_save": "Buffer Modified: 保存时已清除"
31
+ }
32
+ }
@@ -1,4 +1,6 @@
1
1
  /// <reference path="../types/fresh.d.ts" />
2
+ const editor = getEditor();
3
+
2
4
 
3
5
  /**
4
6
  * Buffer Modified Plugin
@@ -145,7 +147,7 @@ globalThis.onBufferModifiedAfterFileOpen = function (args: {
145
147
 
146
148
  // Initialize tracking - file just loaded, no modifications yet
147
149
  initBufferState(bufferId);
148
- editor.debug(`Buffer Modified: initialized for ${args.path}`);
150
+ editor.debug(editor.t("status.initialized", { path: args.path }));
149
151
 
150
152
  return true;
151
153
  };
@@ -180,7 +182,7 @@ globalThis.onBufferModifiedAfterSave = function (args: {
180
182
 
181
183
  // Clear all modified markers - buffer now matches disk
182
184
  clearModifiedState(bufferId);
183
- editor.debug("Buffer Modified: cleared on save");
185
+ editor.debug(editor.t("status.cleared_on_save"));
184
186
 
185
187
  return true;
186
188
  };
@@ -276,4 +278,4 @@ if (initPath && initPath !== "") {
276
278
  initBufferState(initBufferId);
277
279
  }
278
280
 
279
- editor.debug("Buffer Modified plugin loaded");
281
+ editor.debug(editor.t("status.loaded"));
@@ -0,0 +1,44 @@
1
+ {
2
+ "en": {
3
+ "cmd.calculator": "Calculator",
4
+ "cmd.calculator_desc": "Open calculator",
5
+ "status.loaded": "Calculator plugin loaded",
6
+ "status.opened": "Calculator opened",
7
+ "status.copied": "Copied: {value}"
8
+ },
9
+ "es": {
10
+ "cmd.calculator": "Calculadora",
11
+ "cmd.calculator_desc": "Abrir calculadora",
12
+ "status.loaded": "Plugin de calculadora cargado",
13
+ "status.opened": "Calculadora abierta",
14
+ "status.copied": "Copiado: {value}"
15
+ },
16
+ "de": {
17
+ "cmd.calculator": "Taschenrechner",
18
+ "cmd.calculator_desc": "Taschenrechner offnen",
19
+ "status.loaded": "Taschenrechner-Plugin geladen",
20
+ "status.opened": "Taschenrechner geoffnet",
21
+ "status.copied": "Kopiert: {value}"
22
+ },
23
+ "fr": {
24
+ "cmd.calculator": "Calculatrice",
25
+ "cmd.calculator_desc": "Ouvrir la calculatrice",
26
+ "status.loaded": "Plugin calculatrice charge",
27
+ "status.opened": "Calculatrice ouverte",
28
+ "status.copied": "Copie: {value}"
29
+ },
30
+ "ja": {
31
+ "cmd.calculator": "電卓",
32
+ "cmd.calculator_desc": "電卓を開く",
33
+ "status.loaded": "電卓プラグインが読み込まれました",
34
+ "status.opened": "電卓を開きました",
35
+ "status.copied": "コピーしました: {value}"
36
+ },
37
+ "zh": {
38
+ "cmd.calculator": "计算器",
39
+ "cmd.calculator_desc": "打开计算器",
40
+ "status.loaded": "计算器插件已加载",
41
+ "status.opened": "计算器已打开",
42
+ "status.copied": "已复制: {value}"
43
+ }
44
+ }
@@ -1,4 +1,6 @@
1
1
  /// <reference path="../types/fresh.d.ts" />
2
+ const editor = getEditor();
3
+
2
4
 
3
5
  /**
4
6
  * Calculator Plugin for Fresh Editor
@@ -272,7 +274,7 @@ function isCopyButtonAt(contentCol: number, contentRow: number): boolean {
272
274
  function copyResultToClipboard(): void {
273
275
  const textToCopy = state.error || state.result;
274
276
  editor.copyToClipboard(textToCopy);
275
- editor.setStatus(`Copied: ${textToCopy}`);
277
+ editor.setStatus(editor.t("status.copied", { value: textToCopy }));
276
278
  }
277
279
 
278
280
  // Get button position at content-relative coordinates
@@ -721,7 +723,7 @@ globalThis.calculator_open = async function (): Promise<void> {
721
723
 
722
724
  state.splitId = editor.getActiveSplitId();
723
725
 
724
- editor.setStatus("Calculator opened");
726
+ editor.setStatus(editor.t("status.opened"));
725
727
  };
726
728
 
727
729
  // Mouse move handler for hover effect
@@ -763,6 +765,6 @@ editor.on("mouse_click", "onCalculatorMouseClick");
763
765
  editor.on("mouse_move", "onCalculatorMouseMove");
764
766
 
765
767
  // Register main command
766
- editor.registerCommand("Calculator", "Open calculator", "calculator_open", "normal");
768
+ editor.registerCommand("%cmd.calculator", "%cmd.calculator_desc", "calculator_open", "normal");
767
769
 
768
- editor.setStatus("Calculator plugin loaded");
770
+ editor.setStatus(editor.t("status.loaded"));
@@ -1,4 +1,6 @@
1
1
  /// <reference path="./lib/fresh.d.ts" />
2
+ const editor = getEditor();
3
+
2
4
 
3
5
  /**
4
6
  * C/C++ LSP Helper Plugin
@@ -0,0 +1,104 @@
1
+ {
2
+ "en": {
3
+ "cmd.project_setup": "Clangd: Project Setup",
4
+ "cmd.project_setup_desc": "Analyze C/C++ clangd readiness (compile_commands.json, .clangd)",
5
+ "cmd.switch_source_header": "Clangd: Switch Source/Header",
6
+ "cmd.switch_source_header_desc": "Jump to header/source pair using clangd",
7
+ "cmd.open_project_config": "Clangd: Open Project Config",
8
+ "cmd.open_project_config_desc": "Open the nearest .clangd file",
9
+ "status.plugin_loaded": "Clangd support plugin loaded (switch header + config commands)",
10
+ "status.no_active_file": "Clangd: there is no active file to switch",
11
+ "status.unsupported_file_type": "Clangd: unsupported file type for switch header",
12
+ "status.opened_corresponding_file": "Clangd: opened corresponding file",
13
+ "status.no_matching_found": "Clangd: no matching header/source found",
14
+ "status.switch_failed": "Clangd switch source/header failed: {error}",
15
+ "status.opened_config": "Opened .clangd configuration",
16
+ "status.config_not_found": "Could not find .clangd configuration in workspace",
17
+ "status.file_status": "Clangd file status: {status}"
18
+ },
19
+ "es": {
20
+ "cmd.project_setup": "Clangd: Configuracion del Proyecto",
21
+ "cmd.project_setup_desc": "Analizar preparacion de clangd para C/C++ (compile_commands.json, .clangd)",
22
+ "cmd.switch_source_header": "Clangd: Alternar Fuente/Cabecera",
23
+ "cmd.switch_source_header_desc": "Saltar al par cabecera/fuente usando clangd",
24
+ "cmd.open_project_config": "Clangd: Abrir Configuracion del Proyecto",
25
+ "cmd.open_project_config_desc": "Abrir el archivo .clangd mas cercano",
26
+ "status.plugin_loaded": "Plugin de soporte Clangd cargado (comandos de alternar cabecera + configuracion)",
27
+ "status.no_active_file": "Clangd: no hay archivo activo para alternar",
28
+ "status.unsupported_file_type": "Clangd: tipo de archivo no soportado para alternar cabecera",
29
+ "status.opened_corresponding_file": "Clangd: archivo correspondiente abierto",
30
+ "status.no_matching_found": "Clangd: no se encontro cabecera/fuente coincidente",
31
+ "status.switch_failed": "Clangd alternar fuente/cabecera fallo: {error}",
32
+ "status.opened_config": "Configuracion .clangd abierta",
33
+ "status.config_not_found": "No se pudo encontrar configuracion .clangd en el espacio de trabajo",
34
+ "status.file_status": "Estado del archivo Clangd: {status}"
35
+ },
36
+ "de": {
37
+ "cmd.project_setup": "Clangd: Projekteinrichtung",
38
+ "cmd.project_setup_desc": "C/C++ clangd-Bereitschaft analysieren (compile_commands.json, .clangd)",
39
+ "cmd.switch_source_header": "Clangd: Quelle/Header wechseln",
40
+ "cmd.switch_source_header_desc": "Zum Header/Quell-Paar mit clangd springen",
41
+ "cmd.open_project_config": "Clangd: Projektkonfiguration offnen",
42
+ "cmd.open_project_config_desc": "Die nachste .clangd-Datei offnen",
43
+ "status.plugin_loaded": "Clangd-Support-Plugin geladen (Header-Wechsel + Konfigurations-Befehle)",
44
+ "status.no_active_file": "Clangd: keine aktive Datei zum Wechseln",
45
+ "status.unsupported_file_type": "Clangd: nicht unterstutzter Dateityp fur Header-Wechsel",
46
+ "status.opened_corresponding_file": "Clangd: entsprechende Datei geoffnet",
47
+ "status.no_matching_found": "Clangd: kein passendes Header/Quelle gefunden",
48
+ "status.switch_failed": "Clangd Quelle/Header-Wechsel fehlgeschlagen: {error}",
49
+ "status.opened_config": ".clangd-Konfiguration geoffnet",
50
+ "status.config_not_found": "Konnte .clangd-Konfiguration im Arbeitsbereich nicht finden",
51
+ "status.file_status": "Clangd Dateistatus: {status}"
52
+ },
53
+ "fr": {
54
+ "cmd.project_setup": "Clangd: Configuration du Projet",
55
+ "cmd.project_setup_desc": "Analyser la disponibilite de clangd pour C/C++ (compile_commands.json, .clangd)",
56
+ "cmd.switch_source_header": "Clangd: Basculer Source/En-tete",
57
+ "cmd.switch_source_header_desc": "Aller a la paire en-tete/source avec clangd",
58
+ "cmd.open_project_config": "Clangd: Ouvrir la Configuration du Projet",
59
+ "cmd.open_project_config_desc": "Ouvrir le fichier .clangd le plus proche",
60
+ "status.plugin_loaded": "Plugin de support Clangd charge (commandes de bascule en-tete + configuration)",
61
+ "status.no_active_file": "Clangd: aucun fichier actif a basculer",
62
+ "status.unsupported_file_type": "Clangd: type de fichier non supporte pour la bascule d'en-tete",
63
+ "status.opened_corresponding_file": "Clangd: fichier correspondant ouvert",
64
+ "status.no_matching_found": "Clangd: aucun en-tete/source correspondant trouve",
65
+ "status.switch_failed": "Clangd bascule source/en-tete echouee: {error}",
66
+ "status.opened_config": "Configuration .clangd ouverte",
67
+ "status.config_not_found": "Impossible de trouver la configuration .clangd dans l'espace de travail",
68
+ "status.file_status": "Statut du fichier Clangd: {status}"
69
+ },
70
+ "ja": {
71
+ "cmd.project_setup": "Clangd: プロジェクト設定",
72
+ "cmd.project_setup_desc": "C/C++ clangdの準備状況を分析 (compile_commands.json, .clangd)",
73
+ "cmd.switch_source_header": "Clangd: ソース/ヘッダー切り替え",
74
+ "cmd.switch_source_header_desc": "clangdを使用してヘッダー/ソースのペアにジャンプ",
75
+ "cmd.open_project_config": "Clangd: プロジェクト設定を開く",
76
+ "cmd.open_project_config_desc": "最も近い.clangdファイルを開く",
77
+ "status.plugin_loaded": "Clangdサポートプラグインがロードされました(ヘッダー切り替え + 設定コマンド)",
78
+ "status.no_active_file": "Clangd: 切り替えるアクティブなファイルがありません",
79
+ "status.unsupported_file_type": "Clangd: ヘッダー切り替えに対応していないファイル形式です",
80
+ "status.opened_corresponding_file": "Clangd: 対応するファイルを開きました",
81
+ "status.no_matching_found": "Clangd: 一致するヘッダー/ソースが見つかりません",
82
+ "status.switch_failed": "Clangdソース/ヘッダー切り替えに失敗しました: {error}",
83
+ "status.opened_config": ".clangd設定を開きました",
84
+ "status.config_not_found": "ワークスペース内に.clangd設定が見つかりません",
85
+ "status.file_status": "Clangdファイルステータス: {status}"
86
+ },
87
+ "zh": {
88
+ "cmd.project_setup": "Clangd: 项目设置",
89
+ "cmd.project_setup_desc": "分析C/C++ clangd就绪状态 (compile_commands.json, .clangd)",
90
+ "cmd.switch_source_header": "Clangd: 切换源文件/头文件",
91
+ "cmd.switch_source_header_desc": "使用clangd跳转到头文件/源文件对",
92
+ "cmd.open_project_config": "Clangd: 打开项目配置",
93
+ "cmd.open_project_config_desc": "打开最近的.clangd文件",
94
+ "status.plugin_loaded": "Clangd支持插件已加载(切换头文件 + 配置命令)",
95
+ "status.no_active_file": "Clangd: 没有活动文件可切换",
96
+ "status.unsupported_file_type": "Clangd: 不支持的文件类型,无法切换头文件",
97
+ "status.opened_corresponding_file": "Clangd: 已打开对应文件",
98
+ "status.no_matching_found": "Clangd: 未找到匹配的头文件/源文件",
99
+ "status.switch_failed": "Clangd切换源文件/头文件失败: {error}",
100
+ "status.opened_config": "已打开.clangd配置",
101
+ "status.config_not_found": "在工作区中找不到.clangd配置",
102
+ "status.file_status": "Clangd文件状态: {status}"
103
+ }
104
+ }
@@ -1,4 +1,6 @@
1
1
  /// <reference path="../types/fresh.d.ts" />
2
+ const editor = getEditor();
3
+
2
4
 
3
5
  /**
4
6
  * Clangd helper plugin
@@ -60,13 +62,13 @@ globalThis.clangdSwitchSourceHeader = async function(): Promise<void> {
60
62
  const bufferId = editor.getActiveBufferId();
61
63
  const path = editor.getBufferPath(bufferId);
62
64
  if (!path) {
63
- setClangdStatus("Clangd: there is no active file to switch");
65
+ setClangdStatus(editor.t("status.no_active_file"));
64
66
  return;
65
67
  }
66
68
 
67
69
  const language = detectLanguage(path);
68
70
  if (!language) {
69
- setClangdStatus("Clangd: unsupported file type for switch header");
71
+ setClangdStatus(editor.t("status.unsupported_file_type"));
70
72
  return;
71
73
  }
72
74
 
@@ -80,17 +82,17 @@ globalThis.clangdSwitchSourceHeader = async function(): Promise<void> {
80
82
  if (typeof result === "string" && result.length > 0) {
81
83
  const targetPath = fileUriToPath(result);
82
84
  editor.openFile(targetPath, 0, 0);
83
- setClangdStatus("Clangd: opened corresponding file");
85
+ setClangdStatus(editor.t("status.opened_corresponding_file"));
84
86
  return;
85
87
  }
86
- setClangdStatus("Clangd: no matching header/source found");
88
+ setClangdStatus(editor.t("status.no_matching_found"));
87
89
  } catch (err) {
88
- setClangdStatus(`Clangd switch source/header failed: ${err}`);
90
+ setClangdStatus(editor.t("status.switch_failed", { error: String(err) }));
89
91
  editor.debug(`clangdSwitchSourceHeader error: ${err}`);
90
92
  }
91
93
  };
92
94
 
93
- const projectPanel = new PanelManager("Clangd project setup", "clangd-project-setup");
95
+ const projectPanel = new PanelManager(editor, "Clangd project setup", "clangd-project-setup");
94
96
 
95
97
  function pathDesc(path: string): string {
96
98
  if (!path) {
@@ -246,8 +248,8 @@ globalThis.clangdProjectSetup = async function (): Promise<void> {
246
248
  };
247
249
 
248
250
  editor.registerCommand(
249
- "Clangd: Project Setup",
250
- "Analyze C/C++ clangd readiness (compile_commands.json, .clangd)",
251
+ "%cmd.project_setup",
252
+ "%cmd.project_setup_desc",
251
253
  "clangdProjectSetup",
252
254
  ""
253
255
  );
@@ -270,32 +272,32 @@ globalThis.clangdOpenProjectConfig = function(): void {
270
272
  const configPath = editor.pathJoin(dir, ".clangd");
271
273
  if (editor.fileExists(configPath)) {
272
274
  editor.openFile(configPath, 0, 0);
273
- setClangdStatus("Opened .clangd configuration");
275
+ setClangdStatus(editor.t("status.opened_config"));
274
276
  opened = true;
275
277
  break;
276
278
  }
277
279
  }
278
280
 
279
281
  if (!opened) {
280
- setClangdStatus("Could not find .clangd configuration in workspace");
282
+ setClangdStatus(editor.t("status.config_not_found"));
281
283
  }
282
284
  };
283
285
 
284
286
  editor.registerCommand(
285
- "Clangd: Switch Source/Header",
286
- "Jump to header/source pair using clangd",
287
+ "%cmd.switch_source_header",
288
+ "%cmd.switch_source_header_desc",
287
289
  "clangdSwitchSourceHeader",
288
290
  "normal"
289
291
  );
290
292
 
291
293
  editor.registerCommand(
292
- "Clangd: Open Project Config",
293
- "Open the nearest .clangd file",
294
+ "%cmd.open_project_config",
295
+ "%cmd.open_project_config_desc",
294
296
  "clangdOpenProjectConfig",
295
297
  "normal"
296
298
  );
297
299
 
298
- setClangdStatus("Clangd support plugin loaded (switch header + config commands)");
300
+ setClangdStatus(editor.t("status.plugin_loaded"));
299
301
 
300
302
  globalThis.onClangdCustomNotification = function(payload: {
301
303
  language: string;
@@ -313,7 +315,7 @@ globalThis.onClangdCustomNotification = function(payload: {
313
315
  if (payload.method === "textDocument/clangd.fileStatus" && payload.params) {
314
316
  const status = (payload.params as any).status ?? "unknown";
315
317
  editor.debug(`Clangd file status: ${JSON.stringify(status)}`);
316
- setClangdStatus(`Clangd file status: ${status}`);
318
+ setClangdStatus(editor.t("status.file_status", { status: String(status) }));
317
319
  } else if (payload.method === "$/memoryUsage" && payload.params) {
318
320
  const usage = (payload.params as any).used ?? "unknown";
319
321
  editor.debug(`Clangd memory usage: ${usage}`);
@@ -0,0 +1,68 @@
1
+ {
2
+ "en": {
3
+ "cmd.enable": "Color Highlighter: Enable",
4
+ "cmd.enable_desc": "Enable color code highlighting with swatches",
5
+ "cmd.disable": "Color Highlighter: Disable",
6
+ "cmd.disable_desc": "Disable color code highlighting",
7
+ "cmd.toggle": "Color Highlighter: Toggle",
8
+ "cmd.toggle_desc": "Toggle color code highlighting",
9
+ "status.enabled": "Color Highlighter: Enabled",
10
+ "status.disabled": "Color Highlighter: Disabled",
11
+ "status.loaded": "Color Highlighter plugin loaded"
12
+ },
13
+ "es": {
14
+ "cmd.enable": "Resaltador de Colores: Activar",
15
+ "cmd.enable_desc": "Activar resaltado de códigos de color con muestras",
16
+ "cmd.disable": "Resaltador de Colores: Desactivar",
17
+ "cmd.disable_desc": "Desactivar resaltado de códigos de color",
18
+ "cmd.toggle": "Resaltador de Colores: Alternar",
19
+ "cmd.toggle_desc": "Alternar resaltado de códigos de color",
20
+ "status.enabled": "Resaltador de Colores: Activado",
21
+ "status.disabled": "Resaltador de Colores: Desactivado",
22
+ "status.loaded": "Plugin Resaltador de Colores cargado"
23
+ },
24
+ "de": {
25
+ "cmd.enable": "Farbhervorhebung: Aktivieren",
26
+ "cmd.enable_desc": "Farbcode-Hervorhebung mit Farbfeldern aktivieren",
27
+ "cmd.disable": "Farbhervorhebung: Deaktivieren",
28
+ "cmd.disable_desc": "Farbcode-Hervorhebung deaktivieren",
29
+ "cmd.toggle": "Farbhervorhebung: Umschalten",
30
+ "cmd.toggle_desc": "Farbcode-Hervorhebung umschalten",
31
+ "status.enabled": "Farbhervorhebung: Aktiviert",
32
+ "status.disabled": "Farbhervorhebung: Deaktiviert",
33
+ "status.loaded": "Farbhervorhebung-Plugin geladen"
34
+ },
35
+ "fr": {
36
+ "cmd.enable": "Surligneur de Couleurs: Activer",
37
+ "cmd.enable_desc": "Activer le surlignage des codes couleur avec aperçu",
38
+ "cmd.disable": "Surligneur de Couleurs: Désactiver",
39
+ "cmd.disable_desc": "Désactiver le surlignage des codes couleur",
40
+ "cmd.toggle": "Surligneur de Couleurs: Basculer",
41
+ "cmd.toggle_desc": "Basculer le surlignage des codes couleur",
42
+ "status.enabled": "Surligneur de Couleurs: Activé",
43
+ "status.disabled": "Surligneur de Couleurs: Désactivé",
44
+ "status.loaded": "Plugin Surligneur de Couleurs chargé"
45
+ },
46
+ "ja": {
47
+ "cmd.enable": "カラーハイライター: 有効化",
48
+ "cmd.enable_desc": "カラーコードのハイライトとスウォッチ表示を有効化",
49
+ "cmd.disable": "カラーハイライター: 無効化",
50
+ "cmd.disable_desc": "カラーコードのハイライトを無効化",
51
+ "cmd.toggle": "カラーハイライター: 切り替え",
52
+ "cmd.toggle_desc": "カラーコードのハイライトを切り替え",
53
+ "status.enabled": "カラーハイライター: 有効",
54
+ "status.disabled": "カラーハイライター: 無効",
55
+ "status.loaded": "カラーハイライタープラグインを読み込みました"
56
+ },
57
+ "zh-CN": {
58
+ "cmd.enable": "颜色高亮器: 启用",
59
+ "cmd.enable_desc": "启用颜色代码高亮显示和色块预览",
60
+ "cmd.disable": "颜色高亮器: 禁用",
61
+ "cmd.disable_desc": "禁用颜色代码高亮显示",
62
+ "cmd.toggle": "颜色高亮器: 切换",
63
+ "cmd.toggle_desc": "切换颜色代码高亮显示",
64
+ "status.enabled": "颜色高亮器: 已启用",
65
+ "status.disabled": "颜色高亮器: 已禁用",
66
+ "status.loaded": "颜色高亮器插件已加载"
67
+ }
68
+ }
@@ -1,6 +1,8 @@
1
1
  // TypeScript Color Highlighter Plugin
2
2
  // Highlights color codes in source code with a colored swatch
3
3
  // Supports: #RGB, #RRGGBB, rgb(), rgba(), hsl(), hsla(), Color::Rgb()
4
+ const editor = getEditor();
5
+
4
6
 
5
7
  interface ColorHighlighterConfig {
6
8
  enabled: boolean;
@@ -253,14 +255,14 @@ globalThis.colorHighlighterEnable = function(): void {
253
255
  // Refresh lines so next render processes all visible lines
254
256
  const bufferId = editor.getActiveBufferId();
255
257
  editor.refreshLines(bufferId);
256
- editor.setStatus("Color Highlighter: Enabled");
258
+ editor.setStatus(editor.t("status.enabled"));
257
259
  };
258
260
 
259
261
  globalThis.colorHighlighterDisable = function(): void {
260
262
  config.enabled = false;
261
263
  const bufferId = editor.getActiveBufferId();
262
264
  clearHighlights(bufferId);
263
- editor.setStatus("Color Highlighter: Disabled");
265
+ editor.setStatus(editor.t("status.disabled"));
264
266
  };
265
267
 
266
268
  globalThis.colorHighlighterToggle = function(): void {
@@ -272,31 +274,31 @@ globalThis.colorHighlighterToggle = function(): void {
272
274
  } else {
273
275
  clearHighlights(bufferId);
274
276
  }
275
- editor.setStatus(`Color Highlighter: ${config.enabled ? "Enabled" : "Disabled"}`);
277
+ editor.setStatus(config.enabled ? editor.t("status.enabled") : editor.t("status.disabled"));
276
278
  };
277
279
 
278
280
  // Register commands
279
281
  editor.registerCommand(
280
- "Color Highlighter: Enable",
281
- "Enable color code highlighting with swatches",
282
+ "%cmd.enable",
283
+ "%cmd.enable_desc",
282
284
  "colorHighlighterEnable",
283
285
  "normal"
284
286
  );
285
287
 
286
288
  editor.registerCommand(
287
- "Color Highlighter: Disable",
288
- "Disable color code highlighting",
289
+ "%cmd.disable",
290
+ "%cmd.disable_desc",
289
291
  "colorHighlighterDisable",
290
292
  "normal"
291
293
  );
292
294
 
293
295
  editor.registerCommand(
294
- "Color Highlighter: Toggle",
295
- "Toggle color code highlighting",
296
+ "%cmd.toggle",
297
+ "%cmd.toggle_desc",
296
298
  "colorHighlighterToggle",
297
299
  "normal"
298
300
  );
299
301
 
300
302
  // Initialization
301
- editor.setStatus("Color Highlighter plugin loaded");
303
+ editor.setStatus(editor.t("status.loaded"));
302
304
  editor.debug("Color Highlighter initialized - supports hex, rgb, hsl, and Rust Color::Rgb");