@@ -15,6 +15,8 @@ import {
1515} from 'vscode' ;
1616import { inject , injectable } from 'inversify' ;
1717import { IExtensionContext } from '../../platform/common/types' ;
18+ import { LocalizedMessages } from '../../messageTypes' ;
19+ import * as localize from '../../platform/common/utils/localize' ;
1820
1921interface SelectInputSettings {
2022 allowMultipleValues : boolean ;
@@ -91,6 +93,7 @@ export class SelectInputSettingsWebviewProvider {
9193
9294 // Send initial data
9395 await this . sendInitialData ( ) ;
96+ await this . sendLocStrings ( ) ;
9497
9598 // Return a promise that resolves when the user saves or cancels
9699 return new Promise ( ( resolve ) => {
@@ -119,6 +122,33 @@ export class SelectInputSettingsWebviewProvider {
119122 } ) ;
120123 }
121124
125+ private async sendLocStrings ( ) : Promise < void > {
126+ if ( ! this . currentPanel ) {
127+ return ;
128+ }
129+
130+ const locStrings : Partial < LocalizedMessages > = {
131+ selectInputSettingsTitle : localize . SelectInputSettings . title ,
132+ allowMultipleValues : localize . SelectInputSettings . allowMultipleValues ,
133+ allowEmptyValue : localize . SelectInputSettings . allowEmptyValue ,
134+ valueSourceTitle : localize . SelectInputSettings . valueSourceTitle ,
135+ fromOptions : localize . SelectInputSettings . fromOptions ,
136+ fromOptionsDescription : localize . SelectInputSettings . fromOptionsDescription ,
137+ addOptionPlaceholder : localize . SelectInputSettings . addOptionPlaceholder ,
138+ addButton : localize . SelectInputSettings . addButton ,
139+ fromVariable : localize . SelectInputSettings . fromVariable ,
140+ fromVariableDescription : localize . SelectInputSettings . fromVariableDescription ,
141+ variablePlaceholder : localize . SelectInputSettings . variablePlaceholder ,
142+ saveButton : localize . SelectInputSettings . saveButton ,
143+ cancelButton : localize . SelectInputSettings . cancelButton
144+ } ;
145+
146+ await this . currentPanel . webview . postMessage ( {
147+ type : 'locInit' ,
148+ locStrings
149+ } ) ;
150+ }
151+
122152 private async handleMessage ( message : { type : string ; settings ?: SelectInputSettings } ) : Promise < void > {
123153 switch ( message . type ) {
124154 case 'save' :
0 commit comments