revert-ai 1.1.1

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.
@@ -0,0 +1,471 @@
1
+ export const languages = {
2
+ en: {
3
+ name: 'English',
4
+ messages: {
5
+ // Command descriptions
6
+ 'cmd.list.description': 'List all operations in the current Claude Code session',
7
+ 'cmd.undo.description': 'Undo operations from the current Claude Code session',
8
+ 'cmd.redo.description': 'Redo previously undone operations',
9
+ 'cmd.preview.description': 'Preview what would be undone without making changes',
10
+ 'cmd.sessions.description': 'List all available Claude Code sessions',
11
+ 'cmd.session.description': 'Switch to a different session',
12
+ 'cmd.language.description': 'Set the interface language',
13
+
14
+ // Options
15
+ 'opt.all': 'Show all operations including undone ones',
16
+ 'opt.session': 'Specify session ID',
17
+ 'opt.claude': 'Show operations from Claude Code session (default)',
18
+ 'opt.local': 'Show operations from local revert-ai tracking',
19
+ 'opt.yes': 'Skip confirmation',
20
+
21
+ // Messages
22
+ 'msg.no_active_session': 'No active Claude Code session found in this directory.',
23
+ 'msg.make_sure_directory': 'Make sure you are in a directory where Claude Code has been used.',
24
+ 'msg.no_local_session': 'No local revert-ai session found.',
25
+ 'msg.no_operations': 'No operations found.',
26
+ 'msg.no_operations_to_undo': 'No operations to undo.',
27
+ 'msg.no_operations_to_redo': 'No operations to redo.',
28
+ 'msg.operation_not_found': 'Operation {id} not found.',
29
+ 'msg.already_undone': 'This operation has already been undone.',
30
+ 'msg.undo_cancelled': 'Undo cancelled.',
31
+ 'msg.no_sessions_found': 'No Claude Code sessions found.',
32
+ 'msg.no_local_sessions': 'No local sessions found.',
33
+ 'msg.language_set': 'Language set to {language}.',
34
+ 'msg.language_invalid': 'Invalid language. Available languages: {languages}',
35
+
36
+ // Prompts
37
+ 'prompt.select_operation_undo': 'Select operation to undo:',
38
+ 'prompt.select_operation_redo': 'Select operation to redo:',
39
+ 'prompt.select_operation_preview': 'Select operation to preview:',
40
+ 'prompt.confirm_undo': 'Are you sure you want to undo these {count} operations?',
41
+ 'prompt.confirm_redo': 'Are you sure you want to redo these {count} operations?',
42
+ 'prompt.cascading_warning': '⚠️ Cascading undo: Selecting an operation will undo it and ALL operations that came after it.',
43
+
44
+ // Operation types
45
+ 'op.file_create': 'file_create',
46
+ 'op.file_edit': 'file_edit',
47
+ 'op.file_delete': 'file_delete',
48
+ 'op.file_rename': 'file_rename',
49
+ 'op.directory_create': 'directory_create',
50
+ 'op.directory_delete': 'directory_delete',
51
+ 'op.bash_command': 'bash_command',
52
+
53
+ // Operation actions
54
+ 'action.will_delete_file': 'Will delete file:',
55
+ 'action.will_revert_file': 'Will revert file:',
56
+ 'action.will_restore_file': 'Will restore file:',
57
+ 'action.will_rename_back': 'Will rename back:',
58
+ 'action.will_remove_directory': 'Will remove directory:',
59
+ 'action.will_restore_directory': 'Will restore directory:',
60
+ 'action.cannot_undo_bash': 'Cannot auto-undo bash command:',
61
+ 'action.manual_intervention': 'Manual intervention required',
62
+
63
+ // Headers
64
+ 'header.operations_claude': 'Operations from Claude Code session:',
65
+ 'header.operations_local': 'Operations in local session {sessionId}:',
66
+ 'header.available_sessions_claude': 'Available Claude Code sessions:',
67
+ 'header.available_sessions_local': 'Available local sessions:',
68
+ 'header.preview': '📋 Preview: Would undo {count} operation(s):',
69
+ 'header.undoing': 'Undoing {count} operations...',
70
+ 'header.redoing': 'Redoing {count} operations...',
71
+ 'header.this_will_undo': 'This will undo {count} operation(s):',
72
+ 'header.this_will_redo': 'This will redo {count} operation(s):',
73
+
74
+ // Status
75
+ 'status.active': '[ACTIVE]',
76
+ 'status.undone': '[UNDONE]',
77
+ 'status.current_content': 'Current content:',
78
+ 'status.content_to_restore': 'Content to restore:',
79
+ 'status.original_not_available': '(Original content not available from session)',
80
+ 'status.content_not_available': '(Content not available from session)',
81
+ 'status.completed': 'Completed: {success} successful, {failed} failed',
82
+
83
+ // Time
84
+ 'time.seconds_ago': '{seconds}s ago',
85
+ 'time.minutes_ago': '{minutes}m ago',
86
+ 'time.hours_ago': '{hours}h ago',
87
+ 'time.days_ago': '{days}d ago',
88
+
89
+ // Suffixes
90
+ 'suffix.more_operations': '(+ {count} more will be undone)',
91
+ 'suffix.more_would_be_undone': '(+ {count} more would be undone)',
92
+ 'suffix.tip_to_undo': '💡 To actually perform these undos, run: revert-ai undo'
93
+ }
94
+ },
95
+
96
+ ja: {
97
+ name: '日本語',
98
+ messages: {
99
+ // Command descriptions
100
+ 'cmd.list.description': '現在のClaude Codeセッションのすべての操作を一覧表示',
101
+ 'cmd.undo.description': '現在のClaude Codeセッションの操作を元に戻す',
102
+ 'cmd.redo.description': '以前に元に戻した操作をやり直し',
103
+ 'cmd.preview.description': '変更を加えずに元に戻される内容をプレビュー',
104
+ 'cmd.sessions.description': '利用可能なすべてのClaude Codeセッションを一覧表示',
105
+ 'cmd.session.description': '別のセッションに切り替え',
106
+ 'cmd.language.description': 'インターフェース言語を設定',
107
+
108
+ // Options
109
+ 'opt.all': '元に戻された操作も含めてすべての操作を表示',
110
+ 'opt.session': 'セッションIDを指定',
111
+ 'opt.claude': 'Claude Codeセッションの操作を表示(デフォルト)',
112
+ 'opt.local': 'ローカルrevert-ai追跡の操作を表示',
113
+ 'opt.yes': '確認をスキップ',
114
+
115
+ // Messages
116
+ 'msg.no_active_session': 'このディレクトリでアクティブなClaude Codeセッションが見つかりません。',
117
+ 'msg.make_sure_directory': 'Claude Codeが使用されたディレクトリにいることを確認してください。',
118
+ 'msg.no_local_session': 'ローカルrevert-aiセッションが見つかりません。',
119
+ 'msg.no_operations': '操作が見つかりません。',
120
+ 'msg.no_operations_to_undo': '元に戻す操作がありません。',
121
+ 'msg.no_operations_to_redo': 'やり直す操作がありません。',
122
+ 'msg.operation_not_found': '操作 {id} が見つかりません。',
123
+ 'msg.already_undone': 'この操作は既に元に戻されています。',
124
+ 'msg.undo_cancelled': '元に戻す操作がキャンセルされました。',
125
+ 'msg.no_sessions_found': 'Claude Codeセッションが見つかりません。',
126
+ 'msg.no_local_sessions': 'ローカルセッションが見つかりません。',
127
+ 'msg.language_set': '言語が{language}に設定されました。',
128
+ 'msg.language_invalid': '無効な言語です。利用可能な言語: {languages}',
129
+
130
+ // Prompts
131
+ 'prompt.select_operation_undo': '元に戻す操作を選択:',
132
+ 'prompt.select_operation_redo': 'やり直す操作を選択:',
133
+ 'prompt.select_operation_preview': 'プレビューする操作を選択:',
134
+ 'prompt.confirm_undo': 'これら{count}個の操作を本当に元に戻しますか?',
135
+ 'prompt.confirm_redo': 'これら{count}個の操作を本当にやり直しますか?',
136
+ 'prompt.cascading_warning': '⚠️ カスケード元に戻し: 操作を選択すると、その操作とその後のすべての操作が元に戻されます。',
137
+
138
+ // Operation types
139
+ 'op.file_create': 'ファイル作成',
140
+ 'op.file_edit': 'ファイル編集',
141
+ 'op.file_delete': 'ファイル削除',
142
+ 'op.file_rename': 'ファイル名変更',
143
+ 'op.directory_create': 'ディレクトリ作成',
144
+ 'op.directory_delete': 'ディレクトリ削除',
145
+ 'op.bash_command': 'bashコマンド',
146
+
147
+ // Operation actions
148
+ 'action.will_delete_file': 'ファイルを削除します:',
149
+ 'action.will_revert_file': 'ファイルを元に戻します:',
150
+ 'action.will_restore_file': 'ファイルを復元します:',
151
+ 'action.will_rename_back': '名前を元に戻します:',
152
+ 'action.will_remove_directory': 'ディレクトリを削除します:',
153
+ 'action.will_restore_directory': 'ディレクトリを復元します:',
154
+ 'action.cannot_undo_bash': 'bashコマンドを自動で元に戻せません:',
155
+ 'action.manual_intervention': '手動での対応が必要です',
156
+
157
+ // Headers
158
+ 'header.operations_claude': 'Claude Codeセッションの操作:',
159
+ 'header.operations_local': 'ローカルセッション {sessionId} の操作:',
160
+ 'header.available_sessions_claude': '利用可能なClaude Codeセッション:',
161
+ 'header.available_sessions_local': '利用可能なローカルセッション:',
162
+ 'header.preview': '📋 プレビュー: {count}個の操作を元に戻します:',
163
+ 'header.undoing': '{count}個の操作を元に戻しています...',
164
+ 'header.redoing': '{count}個の操作をやり直しています...',
165
+ 'header.this_will_undo': 'これにより{count}個の操作が元に戻されます:',
166
+ 'header.this_will_redo': 'これにより{count}個の操作がやり直されます:',
167
+
168
+ // Status
169
+ 'status.active': '[アクティブ]',
170
+ 'status.undone': '[元に戻し済み]',
171
+ 'status.current_content': '現在の内容:',
172
+ 'status.content_to_restore': '復元する内容:',
173
+ 'status.original_not_available': '(セッションから元の内容を取得できません)',
174
+ 'status.content_not_available': '(セッションから内容を取得できません)',
175
+ 'status.completed': '完了: {success}個成功、{failed}個失敗',
176
+
177
+ // Time
178
+ 'time.seconds_ago': '{seconds}秒前',
179
+ 'time.minutes_ago': '{minutes}分前',
180
+ 'time.hours_ago': '{hours}時間前',
181
+ 'time.days_ago': '{days}日前',
182
+
183
+ // Suffixes
184
+ 'suffix.more_operations': '(+ {count}個も元に戻されます)',
185
+ 'suffix.more_would_be_undone': '(+ {count}個も元に戻されます)',
186
+ 'suffix.tip_to_undo': '💡 実際に元に戻すには次を実行: revert-ai undo'
187
+ }
188
+ },
189
+
190
+ fr: {
191
+ name: 'Français',
192
+ messages: {
193
+ // Command descriptions
194
+ 'cmd.list.description': 'Lister toutes les opérations de la session Claude Code actuelle',
195
+ 'cmd.undo.description': 'Annuler les opérations de la session Claude Code actuelle',
196
+ 'cmd.redo.description': 'Rétablir les opérations précédemment annulées',
197
+ 'cmd.preview.description': 'Prévisualiser ce qui serait annulé sans appliquer les changements',
198
+ 'cmd.sessions.description': 'Lister toutes les sessions Claude Code disponibles',
199
+ 'cmd.session.description': 'Changer de session',
200
+ 'cmd.language.description': 'Définir la langue de l\'interface',
201
+
202
+ // Options
203
+ 'opt.all': 'Afficher toutes les opérations, y compris celles annulées',
204
+ 'opt.session': 'Spécifier l\'ID de session',
205
+ 'opt.claude': 'Afficher les opérations de la session Claude Code (par défaut)',
206
+ 'opt.local': 'Afficher les opérations du suivi local revert-ai',
207
+ 'opt.yes': 'Ignorer la confirmation',
208
+
209
+ // Messages
210
+ 'msg.no_active_session': 'Aucune session Claude Code active trouvée dans ce répertoire.',
211
+ 'msg.make_sure_directory': 'Assurez-vous d\'être dans un répertoire où Claude Code a été utilisé.',
212
+ 'msg.no_local_session': 'Aucune session revert-ai locale trouvée.',
213
+ 'msg.no_operations': 'Aucune opération trouvée.',
214
+ 'msg.no_operations_to_undo': 'Aucune opération à annuler.',
215
+ 'msg.no_operations_to_redo': 'Aucune opération à rétablir.',
216
+ 'msg.operation_not_found': 'Opération {id} introuvable.',
217
+ 'msg.already_undone': 'Cette opération a déjà été annulée.',
218
+ 'msg.undo_cancelled': 'Annulation annulée.',
219
+ 'msg.no_sessions_found': 'Aucune session Claude Code trouvée.',
220
+ 'msg.no_local_sessions': 'Aucune session locale trouvée.',
221
+ 'msg.language_set': 'Langue définie sur {language}.',
222
+ 'msg.language_invalid': 'Langue invalide. Langues disponibles : {languages}',
223
+
224
+ // Prompts
225
+ 'prompt.select_operation_undo': 'Sélectionner l\'opération à annuler :',
226
+ 'prompt.select_operation_redo': 'Sélectionner l\'opération à rétablir :',
227
+ 'prompt.select_operation_preview': 'Sélectionner l\'opération à prévisualiser :',
228
+ 'prompt.confirm_undo': 'Êtes-vous sûr de vouloir annuler ces {count} opérations ?',
229
+ 'prompt.confirm_redo': 'Êtes-vous sûr de vouloir rétablir ces {count} opérations ?',
230
+ 'prompt.cascading_warning': '⚠️ Annulation en cascade : Sélectionner une opération l\'annulera ainsi que TOUTES les opérations qui l\'ont suivie.',
231
+
232
+ // Operation types
233
+ 'op.file_create': 'création_fichier',
234
+ 'op.file_edit': 'édition_fichier',
235
+ 'op.file_delete': 'suppression_fichier',
236
+ 'op.file_rename': 'renommage_fichier',
237
+ 'op.directory_create': 'création_répertoire',
238
+ 'op.directory_delete': 'suppression_répertoire',
239
+ 'op.bash_command': 'commande_bash',
240
+
241
+ // Operation actions
242
+ 'action.will_delete_file': 'Va supprimer le fichier :',
243
+ 'action.will_revert_file': 'Va annuler les modifications du fichier :',
244
+ 'action.will_restore_file': 'Va restaurer le fichier :',
245
+ 'action.will_rename_back': 'Va renommer en arrière :',
246
+ 'action.will_remove_directory': 'Va supprimer le répertoire :',
247
+ 'action.will_restore_directory': 'Va restaurer le répertoire :',
248
+ 'action.cannot_undo_bash': 'Impossible d\'annuler automatiquement la commande bash :',
249
+ 'action.manual_intervention': 'Intervention manuelle requise',
250
+
251
+ // Headers
252
+ 'header.operations_claude': 'Opérations de la session Claude Code :',
253
+ 'header.operations_local': 'Opérations de la session locale {sessionId} :',
254
+ 'header.available_sessions_claude': 'Sessions Claude Code disponibles :',
255
+ 'header.available_sessions_local': 'Sessions locales disponibles :',
256
+ 'header.preview': '📋 Prévisualisation : Annulerait {count} opération(s) :',
257
+ 'header.undoing': 'Annulation de {count} opérations...',
258
+ 'header.redoing': 'Rétablissement de {count} opérations...',
259
+ 'header.this_will_undo': 'Ceci annulera {count} opération(s) :',
260
+ 'header.this_will_redo': 'Ceci rétablira {count} opération(s) :',
261
+
262
+ // Status
263
+ 'status.active': '[ACTIF]',
264
+ 'status.undone': '[ANNULÉ]',
265
+ 'status.current_content': 'Contenu actuel :',
266
+ 'status.content_to_restore': 'Contenu à restaurer :',
267
+ 'status.original_not_available': '(Contenu original non disponible depuis la session)',
268
+ 'status.content_not_available': '(Contenu non disponible depuis la session)',
269
+ 'status.completed': 'Terminé : {success} réussi(s), {failed} échoué(s)',
270
+
271
+ // Time
272
+ 'time.seconds_ago': 'il y a {seconds}s',
273
+ 'time.minutes_ago': 'il y a {minutes}m',
274
+ 'time.hours_ago': 'il y a {hours}h',
275
+ 'time.days_ago': 'il y a {days}j',
276
+
277
+ // Suffixes
278
+ 'suffix.more_operations': '(+ {count} de plus seront annulées)',
279
+ 'suffix.more_would_be_undone': '(+ {count} de plus seraient annulées)',
280
+ 'suffix.tip_to_undo': '💡 Pour effectuer réellement ces annulations, exécutez : revert-ai undo'
281
+ }
282
+ },
283
+
284
+ es: {
285
+ name: 'Español',
286
+ messages: {
287
+ // Command descriptions
288
+ 'cmd.list.description': 'Listar todas las operaciones en la sesión actual de Claude Code',
289
+ 'cmd.undo.description': 'Deshacer operaciones de la sesión actual de Claude Code',
290
+ 'cmd.redo.description': 'Rehacer operaciones previamente deshechas',
291
+ 'cmd.preview.description': 'Previsualizar lo que se desharía sin hacer cambios',
292
+ 'cmd.sessions.description': 'Listar todas las sesiones de Claude Code disponibles',
293
+ 'cmd.session.description': 'Cambiar a una sesión diferente',
294
+ 'cmd.language.description': 'Establecer el idioma de la interfaz',
295
+
296
+ // Options
297
+ 'opt.all': 'Mostrar todas las operaciones, incluidas las deshechas',
298
+ 'opt.session': 'Especificar ID de sesión',
299
+ 'opt.claude': 'Mostrar operaciones de la sesión de Claude Code (predeterminado)',
300
+ 'opt.local': 'Mostrar operaciones del seguimiento local de revert-ai',
301
+ 'opt.yes': 'Omitir confirmación',
302
+
303
+ // Messages
304
+ 'msg.no_active_session': 'No se encontró ninguna sesión activa de Claude Code en este directorio.',
305
+ 'msg.make_sure_directory': 'Asegúrate de estar en un directorio donde se haya usado Claude Code.',
306
+ 'msg.no_local_session': 'No se encontró ninguna sesión local de revert-ai.',
307
+ 'msg.no_operations': 'No se encontraron operaciones.',
308
+ 'msg.no_operations_to_undo': 'No hay operaciones para deshacer.',
309
+ 'msg.no_operations_to_redo': 'No hay operaciones para rehacer.',
310
+ 'msg.operation_not_found': 'Operación {id} no encontrada.',
311
+ 'msg.already_undone': 'Esta operación ya ha sido deshecha.',
312
+ 'msg.undo_cancelled': 'Deshacer cancelado.',
313
+ 'msg.no_sessions_found': 'No se encontraron sesiones de Claude Code.',
314
+ 'msg.no_local_sessions': 'No se encontraron sesiones locales.',
315
+ 'msg.language_set': 'Idioma establecido a {language}.',
316
+ 'msg.language_invalid': 'Idioma inválido. Idiomas disponibles: {languages}',
317
+
318
+ // Prompts
319
+ 'prompt.select_operation_undo': 'Seleccionar operación para deshacer:',
320
+ 'prompt.select_operation_redo': 'Seleccionar operación para rehacer:',
321
+ 'prompt.select_operation_preview': 'Seleccionar operación para previsualizar:',
322
+ 'prompt.confirm_undo': '¿Estás seguro de que quieres deshacer estas {count} operaciones?',
323
+ 'prompt.confirm_redo': '¿Estás seguro de que quieres rehacer estas {count} operaciones?',
324
+ 'prompt.cascading_warning': '⚠️ Deshacer en cascada: Seleccionar una operación la deshará a ella y a TODAS las operaciones que vinieron después.',
325
+
326
+ // Operation types
327
+ 'op.file_create': 'creación_archivo',
328
+ 'op.file_edit': 'edición_archivo',
329
+ 'op.file_delete': 'eliminación_archivo',
330
+ 'op.file_rename': 'renombrar_archivo',
331
+ 'op.directory_create': 'creación_directorio',
332
+ 'op.directory_delete': 'eliminación_directorio',
333
+ 'op.bash_command': 'comando_bash',
334
+
335
+ // Operation actions
336
+ 'action.will_delete_file': 'Se eliminará el archivo:',
337
+ 'action.will_revert_file': 'Se revertirá el archivo:',
338
+ 'action.will_restore_file': 'Se restaurará el archivo:',
339
+ 'action.will_rename_back': 'Se renombrará de vuelta:',
340
+ 'action.will_remove_directory': 'Se eliminará el directorio:',
341
+ 'action.will_restore_directory': 'Se restaurará el directorio:',
342
+ 'action.cannot_undo_bash': 'No se puede deshacer automáticamente el comando bash:',
343
+ 'action.manual_intervention': 'Intervención manual requerida',
344
+
345
+ // Headers
346
+ 'header.operations_claude': 'Operaciones de la sesión de Claude Code:',
347
+ 'header.operations_local': 'Operaciones en la sesión local {sessionId}:',
348
+ 'header.available_sessions_claude': 'Sesiones de Claude Code disponibles:',
349
+ 'header.available_sessions_local': 'Sesiones locales disponibles:',
350
+ 'header.preview': '📋 Previsualización: Desharía {count} operación(es):',
351
+ 'header.undoing': 'Deshaciendo {count} operaciones...',
352
+ 'header.redoing': 'Rehaciendo {count} operaciones...',
353
+ 'header.this_will_undo': 'Esto deshará {count} operación(es):',
354
+ 'header.this_will_redo': 'Esto rehacerá {count} operación(es):',
355
+
356
+ // Status
357
+ 'status.active': '[ACTIVO]',
358
+ 'status.undone': '[DESHECHO]',
359
+ 'status.current_content': 'Contenido actual:',
360
+ 'status.content_to_restore': 'Contenido a restaurar:',
361
+ 'status.original_not_available': '(Contenido original no disponible desde la sesión)',
362
+ 'status.content_not_available': '(Contenido no disponible desde la sesión)',
363
+ 'status.completed': 'Completado: {success} exitoso(s), {failed} fallido(s)',
364
+
365
+ // Time
366
+ 'time.seconds_ago': 'hace {seconds}s',
367
+ 'time.minutes_ago': 'hace {minutes}m',
368
+ 'time.hours_ago': 'hace {hours}h',
369
+ 'time.days_ago': 'hace {days}d',
370
+
371
+ // Suffixes
372
+ 'suffix.more_operations': '(+ {count} más serán deshechas)',
373
+ 'suffix.more_would_be_undone': '(+ {count} más serían deshechas)',
374
+ 'suffix.tip_to_undo': '💡 Para realizar realmente estos deshacer, ejecuta: revert-ai undo'
375
+ }
376
+ },
377
+
378
+ de: {
379
+ name: 'Deutsch',
380
+ messages: {
381
+ // Command descriptions
382
+ 'cmd.list.description': 'Alle Operationen in der aktuellen Claude Code Sitzung auflisten',
383
+ 'cmd.undo.description': 'Operationen aus der aktuellen Claude Code Sitzung rückgängig machen',
384
+ 'cmd.redo.description': 'Zuvor rückgängig gemachte Operationen wiederherstellen',
385
+ 'cmd.preview.description': 'Vorschau anzeigen, was rückgängig gemacht würde, ohne Änderungen vorzunehmen',
386
+ 'cmd.sessions.description': 'Alle verfügbaren Claude Code Sitzungen auflisten',
387
+ 'cmd.session.description': 'Zu einer anderen Sitzung wechseln',
388
+ 'cmd.language.description': 'Die Sprache der Benutzeroberfläche einstellen',
389
+
390
+ // Options
391
+ 'opt.all': 'Alle Operationen anzeigen, einschließlich der rückgängig gemachten',
392
+ 'opt.session': 'Sitzungs-ID angeben',
393
+ 'opt.claude': 'Operationen aus der Claude Code Sitzung anzeigen (Standard)',
394
+ 'opt.local': 'Operationen aus der lokalen revert-ai Verfolgung anzeigen',
395
+ 'opt.yes': 'Bestätigung überspringen',
396
+
397
+ // Messages
398
+ 'msg.no_active_session': 'Keine aktive Claude Code Sitzung in diesem Verzeichnis gefunden.',
399
+ 'msg.make_sure_directory': 'Stellen Sie sicher, dass Sie sich in einem Verzeichnis befinden, in dem Claude Code verwendet wurde.',
400
+ 'msg.no_local_session': 'Keine lokale revert-ai Sitzung gefunden.',
401
+ 'msg.no_operations': 'Keine Operationen gefunden.',
402
+ 'msg.no_operations_to_undo': 'Keine Operationen zum Rückgängigmachen vorhanden.',
403
+ 'msg.no_operations_to_redo': 'Keine Operationen zum Wiederherstellen vorhanden.',
404
+ 'msg.operation_not_found': 'Operation {id} nicht gefunden.',
405
+ 'msg.already_undone': 'Diese Operation wurde bereits rückgängig gemacht.',
406
+ 'msg.undo_cancelled': 'Rückgängigmachen abgebrochen.',
407
+ 'msg.no_sessions_found': 'Keine Claude Code Sitzungen gefunden.',
408
+ 'msg.no_local_sessions': 'Keine lokalen Sitzungen gefunden.',
409
+ 'msg.language_set': 'Sprache auf {language} eingestellt.',
410
+ 'msg.language_invalid': 'Ungültige Sprache. Verfügbare Sprachen: {languages}',
411
+
412
+ // Prompts
413
+ 'prompt.select_operation_undo': 'Operation zum Rückgängigmachen auswählen:',
414
+ 'prompt.select_operation_redo': 'Operation zum Wiederherstellen auswählen:',
415
+ 'prompt.select_operation_preview': 'Operation zur Vorschau auswählen:',
416
+ 'prompt.confirm_undo': 'Sind Sie sicher, dass Sie diese {count} Operationen rückgängig machen möchten?',
417
+ 'prompt.confirm_redo': 'Sind Sie sicher, dass Sie diese {count} Operationen wiederherstellen möchten?',
418
+ 'prompt.cascading_warning': '⚠️ Kaskadierendes Rückgängigmachen: Das Auswählen einer Operation macht diese und ALLE nachfolgenden Operationen rückgängig.',
419
+
420
+ // Operation types
421
+ 'op.file_create': 'Datei_erstellen',
422
+ 'op.file_edit': 'Datei_bearbeiten',
423
+ 'op.file_delete': 'Datei_löschen',
424
+ 'op.file_rename': 'Datei_umbenennen',
425
+ 'op.directory_create': 'Verzeichnis_erstellen',
426
+ 'op.directory_delete': 'Verzeichnis_löschen',
427
+ 'op.bash_command': 'bash_Befehl',
428
+
429
+ // Operation actions
430
+ 'action.will_delete_file': 'Wird Datei löschen:',
431
+ 'action.will_revert_file': 'Wird Datei zurücksetzen:',
432
+ 'action.will_restore_file': 'Wird Datei wiederherstellen:',
433
+ 'action.will_rename_back': 'Wird zurück umbenennen:',
434
+ 'action.will_remove_directory': 'Wird Verzeichnis entfernen:',
435
+ 'action.will_restore_directory': 'Wird Verzeichnis wiederherstellen:',
436
+ 'action.cannot_undo_bash': 'Kann bash Befehl nicht automatisch rückgängig machen:',
437
+ 'action.manual_intervention': 'Manuelle Intervention erforderlich',
438
+
439
+ // Headers
440
+ 'header.operations_claude': 'Operationen aus der Claude Code Sitzung:',
441
+ 'header.operations_local': 'Operationen in lokaler Sitzung {sessionId}:',
442
+ 'header.available_sessions_claude': 'Verfügbare Claude Code Sitzungen:',
443
+ 'header.available_sessions_local': 'Verfügbare lokale Sitzungen:',
444
+ 'header.preview': '📋 Vorschau: Würde {count} Operation(en) rückgängig machen:',
445
+ 'header.undoing': 'Mache {count} Operationen rückgängig...',
446
+ 'header.redoing': 'Stelle {count} Operationen wieder her...',
447
+ 'header.this_will_undo': 'Dies wird {count} Operation(en) rückgängig machen:',
448
+ 'header.this_will_redo': 'Dies wird {count} Operation(en) wiederherstellen:',
449
+
450
+ // Status
451
+ 'status.active': '[AKTIV]',
452
+ 'status.undone': '[RÜCKGÄNGIG]',
453
+ 'status.current_content': 'Aktueller Inhalt:',
454
+ 'status.content_to_restore': 'Wiederherzustellender Inhalt:',
455
+ 'status.original_not_available': '(Originalinhalt nicht aus Sitzung verfügbar)',
456
+ 'status.content_not_available': '(Inhalt nicht aus Sitzung verfügbar)',
457
+ 'status.completed': 'Abgeschlossen: {success} erfolgreich, {failed} fehlgeschlagen',
458
+
459
+ // Time
460
+ 'time.seconds_ago': 'vor {seconds}s',
461
+ 'time.minutes_ago': 'vor {minutes}m',
462
+ 'time.hours_ago': 'vor {hours}h',
463
+ 'time.days_ago': 'vor {days}T',
464
+
465
+ // Suffixes
466
+ 'suffix.more_operations': '(+ {count} weitere werden rückgängig gemacht)',
467
+ 'suffix.more_would_be_undone': '(+ {count} weitere würden rückgängig gemacht)',
468
+ 'suffix.tip_to_undo': '💡 Um diese Rückgängigmachungen tatsächlich durchzuführen, führe aus: revert-ai undo'
469
+ }
470
+ }
471
+ };
@@ -0,0 +1,112 @@
1
+ import chalk from 'chalk';
2
+
3
+ /**
4
+ * Computes the Longest Common Subsequence (LCS) to align lines for diffing.
5
+ * @param {string[]} oldLines
6
+ * @param {string[]} newLines
7
+ * @returns {Array<{ type: string, oldLine: string, newLine: string }>}
8
+ */
9
+ export function diffLines(oldLines, newLines) {
10
+ const dp = Array(oldLines.length + 1).fill(null).map(() => Array(newLines.length + 1).fill(0));
11
+ for (let i = 1; i <= oldLines.length; i++) {
12
+ for (let j = 1; j <= newLines.length; j++) {
13
+ if (oldLines[i - 1] === newLines[j - 1]) {
14
+ dp[i][j] = dp[i - 1][j - 1] + 1;
15
+ } else {
16
+ dp[i][j] = Math.max(dp[i - 1][j], dp[i][j - 1]);
17
+ }
18
+ }
19
+ }
20
+
21
+ const result = [];
22
+ let i = oldLines.length;
23
+ let j = newLines.length;
24
+
25
+ while (i > 0 || j > 0) {
26
+ if (i > 0 && j > 0 && oldLines[i - 1] === newLines[j - 1]) {
27
+ result.unshift({ type: 'normal', oldLine: oldLines[i - 1], newLine: newLines[j - 1] });
28
+ i--;
29
+ j--;
30
+ } else if (j > 0 && (i === 0 || dp[i][j - 1] >= dp[i - 1][j])) {
31
+ result.unshift({ type: 'added', oldLine: '', newLine: newLines[j - 1] });
32
+ j--;
33
+ } else {
34
+ result.unshift({ type: 'deleted', oldLine: oldLines[i - 1], newLine: '' });
35
+ i--;
36
+ }
37
+ }
38
+ return result;
39
+ }
40
+
41
+ /**
42
+ * Renders a side-by-side diff in the terminal.
43
+ * @param {string} currentContent
44
+ * @param {string} originalContent
45
+ * @param {object} options
46
+ * @returns {string}
47
+ */
48
+ export function renderSideBySide(currentContent, originalContent, options = {}) {
49
+ const currentLines = (currentContent || '').split('\n');
50
+ const originalLines = (originalContent || '').split('\n');
51
+
52
+ const diffs = diffLines(currentLines, originalLines);
53
+
54
+ const terminalWidth = process.stdout.columns || 80;
55
+ const colWidth = Math.floor((terminalWidth - 8) / 2);
56
+
57
+ let output = '';
58
+
59
+ // Render headers
60
+ const leftHeader = padString('CURRENT STATE (To be reverted)', colWidth);
61
+ const rightHeader = padString('PROPOSED STATE (After undo)', colWidth);
62
+ output += `${chalk.bold.red(leftHeader)} ${chalk.bold.green(rightHeader)}\n`;
63
+ output += `${chalk.gray('─'.repeat(colWidth))} ➔ ${chalk.gray('─'.repeat(colWidth))}\n`;
64
+
65
+ let currentLineNo = 1;
66
+ let originalLineNo = 1;
67
+
68
+ // Limit display lines for very large files
69
+ const maxLines = options.maxLines || 30;
70
+ const slicedDiffs = diffs.slice(0, maxLines);
71
+
72
+ for (const diff of slicedDiffs) {
73
+ let leftSide = '';
74
+ let rightSide = '';
75
+
76
+ if (diff.type === 'normal') {
77
+ const lineNoStr = padString(String(currentLineNo++), 4);
78
+ leftSide = chalk.gray(lineNoStr) + truncateString(diff.oldLine, colWidth - 4);
79
+
80
+ const rLineNoStr = padString(String(originalLineNo++), 4);
81
+ rightSide = chalk.gray(rLineNoStr) + truncateString(diff.newLine, colWidth - 4);
82
+ } else if (diff.type === 'deleted') {
83
+ // Line exists in current but deleted/modified in original
84
+ const lineNoStr = padString(String(currentLineNo++), 4);
85
+ leftSide = chalk.red(lineNoStr + truncateString(diff.oldLine, colWidth - 4));
86
+ rightSide = chalk.gray(' '.repeat(colWidth));
87
+ } else if (diff.type === 'added') {
88
+ // Line is new/modified in original but blank in current
89
+ leftSide = chalk.gray(' '.repeat(colWidth));
90
+ const rLineNoStr = padString(String(originalLineNo++), 4);
91
+ rightSide = chalk.green(rLineNoStr + truncateString(diff.newLine, colWidth - 4));
92
+ }
93
+
94
+ output += `${leftSide} │ ${rightSide}\n`;
95
+ }
96
+
97
+ if (diffs.length > maxLines) {
98
+ output += `${chalk.gray(`... (${diffs.length - maxLines} more lines truncated)`)}\n`;
99
+ }
100
+
101
+ return output;
102
+ }
103
+
104
+ function truncateString(str, len) {
105
+ if (str.length <= len) return str.padEnd(len);
106
+ return str.slice(0, len - 3) + '...';
107
+ }
108
+
109
+ function padString(str, len) {
110
+ if (str.length >= len) return str.slice(0, len);
111
+ return str.padEnd(len);
112
+ }
@@ -0,0 +1,15 @@
1
+ import { i18n } from '../i18n/i18n.js';
2
+
3
+ export function formatDistance(date) {
4
+ const now = new Date();
5
+ const past = new Date(date);
6
+ const seconds = Math.floor((now - past) / 1000);
7
+
8
+ if (seconds < 60) return i18n.t('time.seconds_ago', { seconds });
9
+ const minutes = Math.floor(seconds / 60);
10
+ if (minutes < 60) return i18n.t('time.minutes_ago', { minutes });
11
+ const hours = Math.floor(minutes / 60);
12
+ if (hours < 24) return i18n.t('time.hours_ago', { hours });
13
+ const days = Math.floor(hours / 24);
14
+ return i18n.t('time.days_ago', { days });
15
+ }