Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbefc48c

Browse files
hyriouslszomoru
authored andcommitted
fix: missing translations of remote built-in extensions (#249430)
1 parentc32c401 commitbefc48c

File tree

5 files changed

+22
-19
lines changed

5 files changed

+22
-19
lines changed

‎build/gulpfile.reh.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ const serverResourceIncludes = [
5858

5959
// NLS
6060
'out-build/nls.messages.json',
61+
'out-build/nls.keys.json',
6162

6263
// Process monitor
6364
'out-build/vs/base/node/cpuUsage.sh',

‎src/vs/base/node/nls.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -108,22 +108,20 @@ export async function resolveNLSConfiguration({ userLocale, osLocale, userDataPa
108108
_corruptedFile:languagePackCorruptMarkerFile
109109
};
110110

111-
if(awaitPromises.exists(commitLanguagePackCachePath)){
111+
if(awaitPromises.exists(languagePackMessagesFile)){
112112
touch(commitLanguagePackCachePath).catch(()=>{});// We don't wait for this. No big harm if we can't touch
113113
mark('code/didGenerateNls');
114114
returnresult;
115115
}
116116

117117
const[
118-
,
119118
nlsDefaultKeys,
120119
nlsDefaultMessages,
121120
nlsPackdata
122121
]:
123-
[unknown,Array<[string,string[]]>,string[],{contents:Record<string,Record<string,string>>}]
124-
//^moduleId ^nlsKeys ^moduleId ^nlsKey ^nlsValue
122+
[Array<[string,string[]]>,string[],{contents:Record<string,Record<string,string>>}]
123+
// ^moduleId ^nlsKeys ^moduleId ^nlsKey ^nlsValue
125124
=awaitPromise.all([
126-
promises.mkdir(commitLanguagePackCachePath,{recursive:true}),
127125
promises.readFile(join(nlsMetadataPath,'nls.keys.json'),'utf-8').then(content=>JSON.parse(content)),
128126
promises.readFile(join(nlsMetadataPath,'nls.messages.json'),'utf-8').then(content=>JSON.parse(content)),
129127
promises.readFile(mainLanguagePackPath,'utf-8').then(content=>JSON.parse(content)),
@@ -145,6 +143,8 @@ export async function resolveNLSConfiguration({ userLocale, osLocale, userDataPa
145143
}
146144
}
147145

146+
awaitpromises.mkdir(commitLanguagePackCachePath,{recursive:true});
147+
148148
awaitPromise.all([
149149
promises.writeFile(languagePackMessagesFile,JSON.stringify(nlsResult),'utf-8'),
150150
promises.writeFile(translationsConfigFile,JSON.stringify(languagePack.translations),'utf-8')

‎src/vs/platform/extensionManagement/common/extensionManagement.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ export interface IExtensionManagementService {
616616
uninstall(extension:ILocalExtension,options?:UninstallOptions):Promise<void>;
617617
uninstallExtensions(extensions:UninstallExtensionInfo[]):Promise<void>;
618618
toggleApplicationScope(extension:ILocalExtension,fromProfileLocation:URI):Promise<ILocalExtension>;
619-
getInstalled(type?:ExtensionType,profileLocation?:URI,productVersion?:IProductVersion):Promise<ILocalExtension[]>;
619+
getInstalled(type?:ExtensionType,profileLocation?:URI,productVersion?:IProductVersion,language?:string):Promise<ILocalExtension[]>;
620620
getExtensionsControlManifest():Promise<IExtensionsControlManifest>;
621621
copyExtensions(fromProfileLocation:URI,toProfileLocation:URI):Promise<void>;
622622
updateMetadata(local:ILocalExtension,metadata:Partial<Metadata>,profileLocation:URI):Promise<ILocalExtension>;

‎src/vs/platform/extensionManagement/common/extensionManagementIpc.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
import{ExtensionType,IExtensionManifest,TargetPlatform}from'../../extensions/common/extensions.js';
1818
import{IProductService}from'../../product/common/productService.js';
1919
import{CommontExtensionManagementService}from'./abstractExtensionManagementService.js';
20+
import{language}from'../../../base/common/platform.js';
2021

2122
functiontransformIncomingURI(uri:UriComponents,transformer:IURITransformer|null):URI;
2223
functiontransformIncomingURI(uri:UriComponents|undefined,transformer:IURITransformer|null):URI|undefined;
@@ -145,7 +146,7 @@ export class ExtensionManagementChannel implements IServerChannel {
145146
returnthis.service.uninstallExtensions(arg.map(({ extension, options})=>({extension:transformIncomingExtension(extension,uriTransformer),options:transformIncomingOptions(options,uriTransformer)})));
146147
}
147148
case'getInstalled':{
148-
constextensions=awaitthis.service.getInstalled(args[0],transformIncomingURI(args[1],uriTransformer),args[2]);
149+
constextensions=awaitthis.service.getInstalled(args[0],transformIncomingURI(args[1],uriTransformer),args[2],args[3]);
149150
returnextensions.map(e=>transformOutgoingExtension(e,uriTransformer));
150151
}
151152
case'toggleApplicationScope':{
@@ -297,7 +298,7 @@ export class ExtensionManagementChannelClient extends CommontExtensionManagement
297298
}
298299

299300
getInstalled(type:ExtensionType|null=null,extensionsProfileResource?:URI,productVersion?:IProductVersion):Promise<ILocalExtension[]>{
300-
returnPromise.resolve(this.channel.call<ILocalExtension[]>('getInstalled',[type,extensionsProfileResource,productVersion]))
301+
returnPromise.resolve(this.channel.call<ILocalExtension[]>('getInstalled',[type,extensionsProfileResource,productVersion,language]))
301302
.then(extensions=>extensions.map(extension=>transformIncomingExtension(extension,null)));
302303
}
303304

‎src/vs/platform/extensionManagement/node/extensionManagementService.ts

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
130130
}
131131
}
132132

133-
getInstalled(type?:ExtensionType,profileLocation:URI=this.userDataProfilesService.defaultProfile.extensionsResource,productVersion:IProductVersion={version:this.productService.version,date:this.productService.date}):Promise<ILocalExtension[]>{
134-
returnthis.extensionsScanner.scanExtensions(type??null,profileLocation,productVersion);
133+
getInstalled(type?:ExtensionType,profileLocation:URI=this.userDataProfilesService.defaultProfile.extensionsResource,productVersion:IProductVersion={version:this.productService.version,date:this.productService.date},language?:string):Promise<ILocalExtension[]>{
134+
returnthis.extensionsScanner.scanExtensions(type??null,profileLocation,productVersion,language);
135135
}
136136

137137
scanAllUserInstalledExtensions():Promise<ILocalExtension[]>{
@@ -563,24 +563,25 @@ export class ExtensionsScanner extends Disposable {
563563
awaitthis.initializeExtensionSize();
564564
}
565565

566-
asyncscanExtensions(type:ExtensionType|null,profileLocation:URI,productVersion:IProductVersion):Promise<ILocalExtension[]>{
566+
asyncscanExtensions(type:ExtensionType|null,profileLocation:URI,productVersion:IProductVersion,language?:string):Promise<ILocalExtension[]>{
567567
try{
568-
constuserScanOptions:UserExtensionsScanOptions={includeInvalid:true, profileLocation, productVersion};
568+
constcacheKey:URI=profileLocation.with({query:language});
569+
constuserScanOptions:UserExtensionsScanOptions={includeInvalid:true, profileLocation, productVersion, language};
569570
letscannedExtensions:IScannedExtension[]=[];
570571
if(type===null||type===ExtensionType.System){
571-
letscanAllExtensionsPromise=this.scanAllExtensionPromise.get(profileLocation);
572+
letscanAllExtensionsPromise=this.scanAllExtensionPromise.get(cacheKey);
572573
if(!scanAllExtensionsPromise){
573-
scanAllExtensionsPromise=this.extensionsScannerService.scanAllExtensions({},userScanOptions)
574-
.finally(()=>this.scanAllExtensionPromise.delete(profileLocation));
575-
this.scanAllExtensionPromise.set(profileLocation,scanAllExtensionsPromise);
574+
scanAllExtensionsPromise=this.extensionsScannerService.scanAllExtensions({ language},userScanOptions)
575+
.finally(()=>this.scanAllExtensionPromise.delete(cacheKey));
576+
this.scanAllExtensionPromise.set(cacheKey,scanAllExtensionsPromise);
576577
}
577578
scannedExtensions.push(...awaitscanAllExtensionsPromise);
578579
}elseif(type===ExtensionType.User){
579-
letscanUserExtensionsPromise=this.scanUserExtensionsPromise.get(profileLocation);
580+
letscanUserExtensionsPromise=this.scanUserExtensionsPromise.get(cacheKey);
580581
if(!scanUserExtensionsPromise){
581582
scanUserExtensionsPromise=this.extensionsScannerService.scanUserExtensions(userScanOptions)
582-
.finally(()=>this.scanUserExtensionsPromise.delete(profileLocation));
583-
this.scanUserExtensionsPromise.set(profileLocation,scanUserExtensionsPromise);
583+
.finally(()=>this.scanUserExtensionsPromise.delete(cacheKey));
584+
this.scanUserExtensionsPromise.set(cacheKey,scanUserExtensionsPromise);
584585
}
585586
scannedExtensions.push(...awaitscanUserExtensionsPromise);
586587
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp