@@ -660,9 +660,11 @@ export function registerAccessibilityConfiguration() {
660660}
661661
662662export const enum AccessibilityVoiceSettingId {
663- SpeechTimeout = 'accessibility.voice.speechTimeout'
663+ SpeechTimeout = 'accessibility.voice.speechTimeout' ,
664+ SpeechLanguage = 'accessibility.voice.speechLanguage'
664665}
665666export const SpeechTimeoutDefault = 1200 ;
667+ const SpeechLanguageDefault = 'en-US' ;
666668
667669export class DynamicSpeechAccessibilityConfiguration extends Disposable implements IWorkbenchContribution {
668670
@@ -681,6 +683,11 @@ export class DynamicSpeechAccessibilityConfiguration extends Disposable implemen
681683 return ; // these settings require a speech provider
682684 }
683685
686+ const languages = this . getLanguages ( ) ;
687+ const languagesSorted = Object . keys ( languages ) . sort ( ( langA , langB ) => {
688+ return languages [ langA ] . name . localeCompare ( languages [ langB ] . name ) ;
689+ } ) ;
690+
684691 const registry = Registry . as < IConfigurationRegistry > ( Extensions . Configuration ) ;
685692 registry . registerConfiguration ( {
686693 ...accessibilityConfigurationNodeBase ,
@@ -691,11 +698,98 @@ export class DynamicSpeechAccessibilityConfiguration extends Disposable implemen
691698 'default' : SpeechTimeoutDefault ,
692699 'minimum' : 0 ,
693700 'tags' : [ 'accessibility' ]
701+ } ,
702+ [ AccessibilityVoiceSettingId . SpeechLanguage ] : {
703+ 'markdownDescription' : localize ( 'voice.speechLanguage' , "The language that voice speech recognition should recognize." ) ,
704+ 'type' : 'string' ,
705+ 'enum' : languagesSorted ,
706+ 'default' : SpeechLanguageDefault ,
707+ 'tags' : [ 'accessibility' ] ,
708+ 'enumDescriptions' : languagesSorted . map ( key => languages [ key ] . name ) ,
709+ 'enumItemLabels' : languagesSorted . map ( key => languages [ key ] . name )
694710 }
695711 }
696712 } ) ;
697713 }
714+
715+ private getLanguages ( ) : { [ locale : string ] : { name : string } } {
716+ return {
717+ [ 'de-DE' ] : {
718+ name : localize ( 'speechLanguage.de-DE' , "German (Germany)" )
719+ } ,
720+ [ 'en-AU' ] : {
721+ name : localize ( 'speechLanguage.en-AU' , "English (Australia)" )
722+ } ,
723+ [ 'en-CA' ] : {
724+ name : localize ( 'speechLanguage.en-CA' , "English (Canada)" )
725+ } ,
726+ [ 'en-GB' ] : {
727+ name : localize ( 'speechLanguage.en-GB' , "English (United Kingdom)" )
728+ } ,
729+ [ 'en-IE' ] : {
730+ name : localize ( 'speechLanguage.en-IE' , "English (Ireland)" )
731+ } ,
732+ [ 'en-IN' ] : {
733+ name : localize ( 'speechLanguage.en-IN' , "English (India)" )
734+ } ,
735+ [ 'en-NZ' ] : {
736+ name : localize ( 'speechLanguage.en-NZ' , "English (New Zealand)" )
737+ } ,
738+ [ SpeechLanguageDefault ] : {
739+ name : localize ( 'speechLanguage.en-US' , "English (United States)" )
740+ } ,
741+ [ 'es-ES' ] : {
742+ name : localize ( 'speechLanguage.es-ES' , "Spanish (Spain)" )
743+ } ,
744+ [ 'es-MX' ] : {
745+ name : localize ( 'speechLanguage.es-MX' , "Spanish (Mexico)" )
746+ } ,
747+ [ 'fr-CA' ] : {
748+ name : localize ( 'speechLanguage.fr-CA' , "French (Canada)" )
749+ } ,
750+ [ 'fr-FR' ] : {
751+ name : localize ( 'speechLanguage.fr-FR' , "French (France)" )
752+ } ,
753+ [ 'hi-IN' ] : {
754+ name : localize ( 'speechLanguage.hi-IN' , "Hindi (India)" )
755+ } ,
756+ [ 'it-IT' ] : {
757+ name : localize ( 'speechLanguage.it-IT' , "Italian (Italy)" )
758+ } ,
759+ [ 'ja-JP' ] : {
760+ name : localize ( 'speechLanguage.ja-JP' , "Japanese (Japan)" )
761+ } ,
762+ [ 'ko-KR' ] : {
763+ name : localize ( 'speechLanguage.ko-KR' , "Korean (South Korea)" )
764+ } ,
765+ [ 'nl-NL' ] : {
766+ name : localize ( 'speechLanguage.nl-NL' , "Dutch (Netherlands)" )
767+ } ,
768+ [ 'pt-BR' ] : {
769+ name : localize ( 'speechLanguage.pt-BR' , "Portuguese (Brazil)" )
770+ } ,
771+ [ 'ru-RU' ] : {
772+ name : localize ( 'speechLanguage.ru-RU' , "Russian (Russia)" )
773+ } ,
774+ [ 'sv-SE' ] : {
775+ name : localize ( 'speechLanguage.sv-SE' , "Swedish (Sweden)" )
776+ } ,
777+ [ 'tr-TR' ] : {
778+ name : localize ( 'speechLanguage.tr-TR' , "Turkish (Turkey)" )
779+ } ,
780+ [ 'zh-CN' ] : {
781+ name : localize ( 'speechLanguage.zh-CN' , "Chinese (Simplified, China)" )
782+ } ,
783+ [ 'zh-HK' ] : {
784+ name : localize ( 'speechLanguage.zh-HK' , "Chinese (Traditional, Hong Kong)" )
785+ } ,
786+ [ 'zh-TW' ] : {
787+ name : localize ( 'speechLanguage.zh-TW' , "Chinese (Traditional, Taiwan)" )
788+ }
789+ } ;
790+ }
698791}
792+
699793Registry . as < IConfigurationMigrationRegistry > ( WorkbenchExtensions . ConfigurationMigration )
700794 . registerConfigurationMigrations ( [ {
701795 key : 'audioCues.volume' ,
0 commit comments