55 FileItem
66} from '../context/providers/workspace/workspace-provider'
77import { natural_sort } from '../utils/natural-sort'
8+ import { t } from '../i18n'
89
910interface FileQuickPickItem extends vscode . QuickPickItem {
1011 full_path : string
@@ -33,17 +34,17 @@ export const add_file_to_context_command = (
3334 ( resolve ) => {
3435 const quick_pick = vscode . window . createQuickPick ( )
3536 quick_pick . items = items
36- quick_pick . placeholder = 'Select a workspace folder to browse files'
37- quick_pick . title = 'Workspace Folders'
37+ quick_pick . placeholder = t ( 'command.context.add.select- workspace' )
38+ quick_pick . title = t ( 'command.context.workspace-folders' )
3839 quick_pick . buttons = [
3940 {
4041 iconPath : new vscode . ThemeIcon ( 'close' ) ,
41- tooltip : 'Close'
42+ tooltip : t ( 'common.close' )
4243 }
4344 ]
4445
4546 quick_pick . onDidTriggerButton ( ( button ) => {
46- if ( button . tooltip == 'Close' ) {
47+ if ( button . tooltip == t ( 'common.close' ) ) {
4748 quick_pick . hide ( )
4849 }
4950 } )
@@ -70,20 +71,20 @@ export const add_file_to_context_command = (
7071 }
7172
7273 const quick_pick = vscode . window . createQuickPick < FileQuickPickItem > ( )
73- quick_pick . title = 'Workspace Files'
74- quick_pick . placeholder = 'Select a file to add to context'
74+ quick_pick . title = t ( 'command.context.workspace-files' )
75+ quick_pick . placeholder = t ( 'command. context.add.select-file' )
7576 quick_pick . matchOnDescription = true
7677 quick_pick . buttons = [
7778 {
7879 iconPath : new vscode . ThemeIcon ( 'close' ) ,
79- tooltip : 'Close'
80+ tooltip : t ( 'common.close' )
8081 }
8182 ]
8283 quick_pick . busy = true
8384 quick_pick . show ( )
8485
8586 quick_pick . onDidTriggerButton ( ( button ) => {
86- if ( button . tooltip == 'Close' ) {
87+ if ( button . tooltip == t ( 'common.close' ) ) {
8788 quick_pick . hide ( )
8889 }
8990 } )
@@ -95,7 +96,7 @@ export const add_file_to_context_command = (
9596
9697 quick_pick . onDidTriggerItemButton ( async ( e ) => {
9798 const item = e . item
98- if ( e . button . tooltip == 'Add Parent Folder to Context' ) {
99+ if ( e . button . tooltip == t ( 'command.context.add.add-parent-folder' ) ) {
99100 parent_folder_source_full_path = item . full_path
100101
101102 const workspace_root = workspace_provider . get_workspace_root_for_file (
@@ -120,16 +121,18 @@ export const add_file_to_context_command = (
120121 }
121122
122123 if ( folders . length == 0 ) {
123- vscode . window . showInformationMessage ( 'No parent folders to add.' )
124+ vscode . window . showInformationMessage (
125+ t ( 'command.context.add.no-parent-folders' )
126+ )
124127 return
125128 }
126129
127130 const folder_quick_pick = vscode . window . createQuickPick < {
128131 label : string
129132 full_path : string
130133 } > ( )
131- folder_quick_pick . title = 'Parent Folders'
132- folder_quick_pick . placeholder = 'Select a folder to add to context'
134+ folder_quick_pick . title = t ( 'command.context.parent-folders' )
135+ folder_quick_pick . placeholder = t ( 'command. context.add.select-folder' )
133136 folder_quick_pick . items = folders . map ( ( f ) => ( {
134137 label : f . label ,
135138 full_path : f . full_path
@@ -241,7 +244,7 @@ export const add_file_to_context_command = (
241244 ? [
242245 {
243246 iconPath : new vscode . ThemeIcon ( 'folder' ) ,
244- tooltip : 'Add Parent Folder to Context'
247+ tooltip : t ( 'command.context.add.add-parent-folder' )
245248 }
246249 ]
247250 : [ ]
0 commit comments