Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/yamlServerInit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export class YAMLServerInit {

public async setupl10nBundle(params: InitializeParams): Promise<void> {
const __dirname = path.dirname(__filename);
const l10nPath: string = params.initializationOptions?.l10nPath || path.join(__dirname, '../l10n');
const l10nPath: string = params.initializationOptions?.l10nPath || path.join(__dirname, '../../../l10n');
const locale: string = params.locale || 'en';
if (l10nPath) {
const bundleFile = !fs.existsSync(path.join(l10nPath, `bundle.l10n.${locale}.json`))
Expand Down
10 changes: 10 additions & 0 deletions test/bundlel10n.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { schemaRequestHandler, workspaceContext } from '../src/languageservice/s
import { TestTelemetry } from './utils/testsTypes';
import { YAMLServerInit } from '../src/yamlServerInit';
import * as l10n from '@vscode/l10n';
import * as path from 'path';

describe('Bundle l10n Test', () => {
let serverInit: YAMLServerInit;
Expand Down Expand Up @@ -44,6 +45,9 @@ describe('Bundle l10n Test', () => {
processId: 0,
rootUri: '',
capabilities: undefined,
initializationOptions: {
l10nPath: path.join(__dirname, '../l10n'),
},
});
});

Expand All @@ -54,6 +58,9 @@ describe('Bundle l10n Test', () => {
processId: 0,
rootUri: '',
capabilities: undefined,
initializationOptions: {
l10nPath: path.join(__dirname, '../l10n'),
},
});
assert.equal(l10n.t('Default Value'), 'Valeur par défaut');
});
Expand All @@ -64,6 +71,9 @@ describe('Bundle l10n Test', () => {
processId: 0,
rootUri: '',
capabilities: undefined,
initializationOptions: {
l10nPath: path.join(__dirname, '../l10n'),
},
});
assert.equal(l10n.t('Default Value'), 'Default value');
});
Expand Down
Loading