File tree Expand file tree Collapse file tree 2 files changed +33
-2
lines changed
Expand file tree Collapse file tree 2 files changed +33
-2
lines changed Original file line number Diff line number Diff line change 7272 "clean" : " rimraf out/server && rimraf lib" ,
7373 "compile" : " tsc -p ." ,
7474 "watch" : " tsc --watch -p ." ,
75- "test" : " mocha --require ts-node/register --timeout 5000 --ui bdd ./test/*.test.ts" ,
75+ "test" : " mocha --require ts-node/register --require ./scripts/setup-l10n.mjs -- timeout 5000 --ui bdd ./test/*.test.ts" ,
7676 "coverage" : " nyc mocha --require ts-node/register --timeout 5000 --require source-map-support/register --recursive --ui bdd ./test/*.test.ts" ,
77- "coveralls" : " nyc --reporter=lcov --reporter=text mocha --timeout 5000 --require ts-node/register --require source-map-support/register --recursive --ui bdd ./test/*.test.ts" ,
77+ "coveralls" : " nyc --reporter=lcov --reporter=text mocha --timeout 5000 --require ts-node/register --require ./scripts/setup-l10n.mjs --require source-map-support/register --recursive --ui bdd ./test/*.test.ts" ,
7878 "lint" : " eslint --max-warnings 0 -c .eslintrc.js --ext .ts src test" ,
7979 "lint-ci" : " eslint --max-warnings 0 -c .eslintrc.js -f @microsoft/eslint-formatter-sarif -o eslint-result.sarif --ext .ts src test" ,
8080 "prettier-fix" : " yarn prettier --write ." ,
Original file line number Diff line number Diff line change 1+ import * as l10n from '@vscode/l10n' ;
2+ import { URI } from 'vscode-uri' ;
3+ import { fileURLToPath } from 'url' ;
4+ import * as path from 'path' ;
5+
6+ class Setupl10n {
7+ async load ( ) {
8+ const __filename = fileURLToPath ( import . meta. url ) ;
9+ const __dirname = path . dirname ( __filename ) ;
10+ const l10nPath = path . join ( __dirname , '../l10n' ) ;
11+
12+ process . env . VSCODE_NLS_CONFIG = JSON . stringify ( {
13+ locale : 'en' ,
14+ _languagePackSupport : true ,
15+ } ) ;
16+
17+ await l10n . config ( {
18+ uri : URI . file ( path . join ( l10nPath , 'bundle.l10n.json' ) ) . toString ( ) ,
19+ } ) ;
20+ }
21+ }
22+
23+ // Run immediately
24+ new Setupl10n ( )
25+ . load ( )
26+ . then ( ( ) => {
27+ console . log ( '✅ l10n configured' ) ;
28+ } )
29+ . catch ( ( err ) => {
30+ console . error ( '❌ l10n setup failed:' , err ) ;
31+ } ) ;
You can’t perform that action at this time.
0 commit comments