66 *--------------------------------------------------------------------------------------------*/
77'use strict' ;
88
9- import { workspace , ExtensionContext , extensions , window , commands , Uri , ConfigurationTarget } from 'vscode' ;
9+ import { workspace , ExtensionContext , extensions , window , commands , Uri , ConfigurationTarget , env } from 'vscode' ;
1010import {
1111 CommonLanguageClient ,
1212 LanguageClientOptions ,
@@ -113,6 +113,9 @@ export function startClient(
113113) : SchemaExtensionAPI {
114114 const telemetryErrorHandler = new TelemetryErrorHandler ( runtime . telemetry , lsName , 4 ) ;
115115 const outputChannel = window . createOutputChannel ( lsName ) ;
116+ const l10nPath = context . asAbsolutePath ( '../yaml-language-server/l10n' ) ;
117+ const supportedLanguages = [ 'de' , 'fr' , 'ja' , 'ko' , 'zh-cn' , 'zh-tw' ] ;
118+ const locale = supportedLanguages . includes ( env . language ) ? env . language : 'en' ;
116119 // Options to control the language client
117120 const clientOptions : LanguageClientOptions = {
118121 // Register the server for on disk and newly created YAML documents
@@ -129,6 +132,10 @@ export function startClient(
129132 revealOutputChannelOn : RevealOutputChannelOn . Never ,
130133 errorHandler : telemetryErrorHandler ,
131134 outputChannel : new TelemetryOutputChannel ( outputChannel , runtime . telemetry ) ,
135+ initializationOptions : {
136+ l10nPath,
137+ locale,
138+ } ,
132139 } ;
133140
134141 // Create the language client and start it
0 commit comments