Skip to content

Commit ef6e556

Browse files
committed
Consolidate shared i18n translation keys and replace removed dictionary error messages with common translations
└── apps └── editor └── src ├── commands │ ├── code-at-cursor-command │ │ └── utils │ │ └── perform-code-at-cursor.ts │ ├── copy-markdown-command.ts │ ├── copy-merge-commit-details-command.ts │ ├── copy-paths-command.ts │ ├── delete-command.ts │ ├── generate-commit-message-commands │ │ └── actions │ │ └── run-generate-action.ts │ ├── history-command │ │ └── actions │ │ └── delete-checkpoint-with-undo.ts │ ├── new-file-command.ts │ ├── new-folder-command.ts │ ├── rename-command.ts │ ├── restore-file-selection-command │ │ └── actions │ │ ├── restore-from-json-file.ts │ │ └── restore-from-workspace-state.ts │ ├── save-file-selection-command │ │ └── actions │ │ ├── save-to-json-file.ts │ │ └── save-to-workspace-state.ts │ ├── select-files-of-commit-command.ts │ ├── select-imported-files-commands │ │ └── utils │ │ └── prompt-for-imported-files.ts │ ├── select-modified-files-command.ts │ ├── select-referencing-files-commands │ │ └── select-referencing-files-commands.ts │ └── select-workspace-file-command.ts ├── features │ ├── context-restoration │ │ └── utils │ │ ├── ask-for-new-context-name.ts │ │ └── source-selector.ts │ └── search-files │ └── search-modes │ ├── perform-intelligent-search-mode.ts │ ├── perform-keywords-search-mode.ts │ └── perform-phrase-search-mode.ts ├── i18n │ ├── index.ts │ └── translations │ ├── commands │ │ ├── copy-markdown-command.ts │ │ ├── copy-merge-commit-details-command.ts │ │ ├── copy-paths-command.ts │ │ ├── history-command.ts │ │ ├── index.ts │ │ ├── new-file-command.ts │ │ ├── new-folder-command.ts │ │ ├── rename-command.ts │ │ ├── restore-file-selection-command.ts │ │ ├── select-files-of-commit-command.ts │ │ ├── select-imported-files-command.ts │ │ ├── select-modified-files-command.ts │ │ ├── select-referencing-files-command.ts │ │ └── select-workspace-file-command.ts │ ├── common.ts │ ├── features │ │ ├── context-restoration.ts │ │ └── index.ts │ ├── utils │ │ ├── index.ts │ │ ├── show-missing-configuration-notification.ts │ │ └── show-parent-folder-quick-pick.ts │ └── views │ ├── index.ts │ ├── prompt │ │ ├── handlers │ │ │ ├── handle-agentic-search.ts │ │ │ ├── handle-delete-task.ts │ │ │ ├── handle-template-quick-pick.ts │ │ │ └── index.ts │ │ └── index.ts │ ├── settings │ │ ├── handlers │ │ │ ├── handle-delete-provider.ts │ │ │ ├── handle-delete-template.ts │ │ │ ├── handle-open-allow-patterns-settings.ts │ │ │ ├── handle-open-ignore-patterns-settings.ts │ │ │ └── index.ts │ │ └── index.ts │ └── shared │ ├── actions │ │ ├── api │ │ │ ├── delete.ts │ │ │ └── index.ts │ │ ├── index.ts │ │ └── web │ │ ├── delete.ts │ │ └── index.ts │ └── index.ts ├── utils │ ├── show-missing-configuration-notification.ts │ └── show-parent-folder-quick-pick.ts └── views ├── prompt │ └── backend │ └── message-handlers │ ├── handle-agentic-search │ │ └── agentic-search.ts │ ├── handle-copy-prompt.ts │ ├── handle-delete-task.ts │ ├── handle-patch-repair.ts │ └── handle-template-quick-pick.ts ├── settings │ └── backend │ └── message-handlers │ ├── handle-delete-provider.ts │ ├── handle-delete-template.ts │ ├── handle-open-allow-patterns-settings.ts │ └── handle-open-ignore-patterns-settings.ts └── shared └── actions ├── api │ └── delete.ts └── web └── delete.ts
1 parent 628dc16 commit ef6e556

138 files changed

Lines changed: 1494 additions & 3170 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎apps/editor/src/commands/apply-response-command/apply-response-command.ts‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,9 +316,7 @@ export const apply_response_command = (params: {
316316
params.prompt_view_provider.send_message({
317317
command: 'SHOW_PROGRESS',
318318
title: t('common.progress.response-preview'),
319-
subtitle: t(
320-
'command.apply-response-command.progress.creating-checkpoint'
321-
)
319+
subtitle: t('common.progress.creating-checkpoint')
322320
})
323321

324322
before_checkpoint = await create_checkpoint({

‎apps/editor/src/commands/code-at-cursor-command/utils/get-code-at-cursor-config.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,11 @@ export const get_code_at_cursor_api_configuration = async (params: {
7272
)
7373

7474
if (!provider) {
75-
vscode.window.showErrorMessage(t('common.error.api-provider-not-found'))
75+
vscode.window.showErrorMessage(
76+
t('common.error.provider-not-found', {
77+
name: selected_api_configuration.provider_name
78+
})
79+
)
7680
Logger.warn({
7781
function_name: 'get_code_at_cursor_api_configuration',
7882
message: 'API provider not found for Code at Cursor tool.'

‎apps/editor/src/commands/code-at-cursor-command/utils/perform-code-at-cursor.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,9 @@ export const perform_code_at_cursor = async (params: {
259259

260260
if (action === 'copy') {
261261
await vscode.env.clipboard.writeText(chatbot_prompt)
262-
vscode.window.showInformationMessage(t('common.info.copied-to-clipboard'))
262+
vscode.window.showInformationMessage(
263+
t('common.info.copied-to-clipboard', { item: 'Prompt' })
264+
)
263265
return
264266
}
265267

@@ -430,9 +432,7 @@ export const perform_code_at_cursor = async (params: {
430432
},
431433
async (progress, token) => {
432434
token.onCancellationRequested(() => {
433-
abort_controller.abort(
434-
t('command.code-at-cursor-command.cancel.user')
435-
)
435+
abort_controller.abort(t('common.cancel.user'))
436436
})
437437

438438
progress.report({

‎apps/editor/src/commands/copy-markdown-command.ts‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export const copy_markdown_commands = (
4646
}).full_prompt + '\n'
4747
await vscode.env.clipboard.writeText(context_text)
4848
vscode.window.showInformationMessage(
49-
t('command.copy-markdown-command.info.context-copied')
49+
t('common.info.copied-to-clipboard', { item: 'Context' })
5050
)
5151
}),
5252

@@ -129,7 +129,9 @@ export const copy_markdown_commands = (
129129
}).full_prompt + '\n'
130130
await vscode.env.clipboard.writeText(context_text)
131131
vscode.window.showInformationMessage(
132-
t('command.copy-markdown-command.info.context-from-editors-copied')
132+
t('common.info.copied-to-clipboard', {
133+
item: 'Context from open editors'
134+
})
133135
)
134136
}
135137
)

‎apps/editor/src/commands/copy-merge-commit-details-command.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const copy_merge_commit_details_command = (): vscode.Disposable => {
2929

3030
if (!branches_output) {
3131
vscode.window.showInformationMessage(
32-
t('command.copy-merge-commit-details-command.no-branches')
32+
t('common.info.no-branches-found')
3333
)
3434
return
3535
}
@@ -48,18 +48,18 @@ export const copy_merge_commit_details_command = (): vscode.Disposable => {
4848

4949
if (branches.length === 0) {
5050
vscode.window.showInformationMessage(
51-
t('command.copy-merge-commit-details-command.no-other-branches')
51+
t('common.info.no-other-branches-to-compare')
5252
)
5353
return
5454
}
5555

5656
const quick_pick = vscode.window.createQuickPick<
5757
vscode.QuickPickItem & { name: string }
5858
>()
59-
quick_pick.title = t('command.copy-merge-commit-details-command.title')
59+
quick_pick.title = t('common.title.branches')
6060
quick_pick.items = branches
6161
quick_pick.placeholder = t(
62-
'command.copy-merge-commit-details-command.select'
62+
'common.placeholder.select-branch-to-compare'
6363
)
6464
quick_pick.matchOnDetail = true
6565
quick_pick.buttons = [
@@ -163,7 +163,7 @@ export const copy_merge_commit_details_command = (): vscode.Disposable => {
163163

164164
await vscode.env.clipboard.writeText(final_text)
165165
vscode.window.showInformationMessage(
166-
t('command.copy-merge-commit-details-command.copied')
166+
t('common.info.copied-to-clipboard', { item: 'Merge commit details' })
167167
)
168168
} catch (error) {
169169
vscode.window.showErrorMessage(

‎apps/editor/src/commands/copy-paths-command.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export const copy_paths_commands = (
140140
const paths_text = format_paths(checked_files, format)
141141
await vscode.env.clipboard.writeText(paths_text)
142142
vscode.window.showInformationMessage(
143-
t('command.copy-paths-command.copied')
143+
t('common.info.copied-to-clipboard', { item: 'Paths' })
144144
)
145145
}),
146146

@@ -163,7 +163,7 @@ export const copy_paths_commands = (
163163
const paths_text = format_paths(checked_files, format)
164164
await vscode.env.clipboard.writeText(paths_text)
165165
vscode.window.showInformationMessage(
166-
t('command.copy-paths-command.copied')
166+
t('common.info.copied-to-clipboard', { item: 'Paths' })
167167
)
168168
}
169169
)

‎apps/editor/src/commands/generate-commit-message-commands/actions/run-generate-action.ts‎

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import {
2020
import { get_prompt_data } from './get-prompt-data'
2121
import { display_token_count } from '@shared/utils/display-token-count'
2222
import { show_configurations_quick_pick } from '@/utils/show-configurations-quick-pick'
23-
import { dictionary } from '@shared/constants/dictionary'
2423
import { WebSocketManager } from '@/services/websocket-manager'
2524
import { get_response_preview_promise_resolve } from '@/commands/apply-response-command/utils/preview'
2625
import { normalize_path } from '@/utils/normalize-path'
@@ -252,9 +251,7 @@ export const run_generate_action = async (params: {
252251
const attach_label = t(
253252
'command.generate-commit-message-command.attach-context-files.attach'
254253
)
255-
const skip_label = t(
256-
'command.generate-commit-message-command.attach-context-files.skip'
257-
)
254+
const skip_label = t('common.action.skip')
258255
const last_selected_id =
259256
params.extension_context.workspaceState.get<string>(
260257
LAST_USE_CONTEXT_FILES_STATE_KEY,
@@ -361,6 +358,7 @@ export const run_generate_action = async (params: {
361358
await vscode.env.clipboard.writeText(final_chatbot_prompt!)
362359
vscode.window.showInformationMessage(
363360
t('common.info.copied-to-clipboard', {
361+
item: 'Prompt',
364362
tokens: display_token_count(
365363
Math.ceil(final_api_prompt!.length / 4)
366364
)
@@ -584,9 +582,7 @@ export const run_generate_action = async (params: {
584582
const attach_label = t(
585583
'command.generate-commit-message-command.attach-ascii-tree.attach'
586584
)
587-
const skip_label = t(
588-
'command.generate-commit-message-command.attach-ascii-tree.skip'
589-
)
585+
const skip_label = t('common.action.skip')
590586

591587
const last_selected_id =
592588
params.extension_context.workspaceState.get<string>(

‎apps/editor/src/commands/generate-commit-message-commands/utils/get-commit-message-config.ts‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ export const get_commit_message_api_configuration = async (params: {
8484
)
8585

8686
if (!provider) {
87-
vscode.window.showErrorMessage(t('common.error.api-provider-not-found'))
87+
vscode.window.showErrorMessage(
88+
t('common.error.provider-not-found', {
89+
name: commit_message_api_configuration.provider_name
90+
})
91+
)
8892
Logger.warn({
8993
function_name: 'get_commit_message_api_configuration',
9094
message: 'API provider not found for Commit Messages tool.'

‎apps/editor/src/commands/history-command/actions/delete-checkpoint-with-undo.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export const delete_checkpoint_with_undo = async (params: {
6161
params.on_before_show_message?.()
6262
const undo_action = t('common.undo')
6363
const choice = await vscode.window.showInformationMessage(
64-
t('command.history-command.success.deleted'),
64+
t('common.success.item-deleted', { item: 'Checkpoint' }),
6565
undo_action
6666
)
6767
params.on_after_show_message?.()

‎apps/editor/src/commands/new-file-command.ts‎

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as path from 'path'
33
import * as fs from 'fs'
44
import { create_safe_path } from '../utils/path-sanitizer'
55
import { dictionary } from '@shared/constants/dictionary'
6+
import { Logger } from '@shared/utils/logger'
67
import { t } from '../i18n'
78

89
export const new_file_command = () => {
@@ -30,9 +31,10 @@ export const new_file_command = () => {
3031
}
3132

3233
if (!parent_path) {
33-
vscode.window.showErrorMessage(
34-
dictionary.error_message.COULD_NOT_DETERMINE_LOCATION_TO_CREATE_FILE
35-
)
34+
Logger.error({
35+
function_name: 'new_file_command',
36+
message: 'Could not determine location to create file.'
37+
})
3638
return
3739
}
3840

@@ -45,7 +47,7 @@ export const new_file_command = () => {
4547

4648
const input_box = vscode.window.createInputBox()
4749
input_box.title = t('command.new-file-command.title')
48-
input_box.prompt = t('command.new-file-command.prompt')
50+
input_box.prompt = t('common.prompt.enter-name', { item: 'file' })
4951
input_box.placeholder = ''
5052

5153
const close_button = {
@@ -92,20 +94,21 @@ export const new_file_command = () => {
9294
const file_path = create_safe_path(parent_path, file_name)
9395

9496
if (!file_path) {
95-
vscode.window.showErrorMessage(
96-
dictionary.error_message.INVALID_FILE_NAME(file_name)
97-
)
97+
Logger.error({
98+
function_name: 'new_file_command',
99+
message: `Invalid file name: '${file_name}'.`
100+
})
98101
return
99102
}
100103

101104
const fileUri = vscode.Uri.file(file_path)
102105

103106
try {
104107
await vscode.workspace.fs.stat(fileUri)
105-
vscode.window.showErrorMessage(
106-
dictionary.error_message.FILE_ALREADY_EXISTS(
107-
path.basename(file_path)
108-
)
108+
vscode.window.showInformationMessage(
109+
t('common.info.file-already-exists', {
110+
name: path.basename(file_path)
111+
})
109112
)
110113
return
111114
} catch {}
@@ -128,8 +131,10 @@ export const new_file_command = () => {
128131
const document = await vscode.workspace.openTextDocument(fileUri)
129132
await vscode.window.showTextDocument(document, { preview: false })
130133
} catch (error: any) {
131-
vscode.window.showErrorMessage(
132-
dictionary.error_message.FAILED_TO_CREATE_FILE(error.message)
134+
vscode.window.showInformationMessage(
135+
t('common.info.failed-to-create-file', {
136+
message: error.message
137+
})
133138
)
134139
}
135140
}

0 commit comments

Comments
 (0)