8000 fix: missing translations of remote built-in extensions by hyrious · Pull Request #249430 · microsoft/vscode · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: missing translations of remote built-in extensions #249430

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions build/gulpfile.reh.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const serverResourceIncludes = [

// NLS
'out-build/nls.messages.json',
'out-build/nls.keys.json',

// Process monitor
'out-build/vs/base/node/cpuUsage.sh',
Expand Down
10 changes: 5 additions & 5 deletions src/vs/base/node/nls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,27 +108,27 @@ export async function resolveNLSConfiguration({ userLocale, osLocale, userDataPa
_corruptedFile: languagePackCorruptMarkerFile
};

if (await Promises.exists(commitLanguagePackCachePath)) {
if (await Promises.exists(languagePackMessagesFile)) {
touch(commitLanguagePackCachePath).catch(() => { }); // We don't wait for this. No big harm if we can't touch
mark('code/didGenerateNls');
return result;
}

const [
,
nlsDefaultKeys,
nlsDefaultMessages,
nlsPackdata
]:
[unknown, Array<[string, string[]]>, string[], { contents: Record<string, Record<string, string>> }]
// ^moduleId ^nlsKeys ^moduleId ^nlsKey ^nlsValue
[Array<[string, string[]]>, string[], { contents: Record<string, Record<string, string>> }]
// ^moduleId ^nlsKeys ^moduleId ^nlsKey ^nlsValue
= await Promise.all([
promises.mkdir(commitLanguagePackCachePath, { recursive: true }),
promises.readFile(join(nlsMetadataPath, 'nls.keys.json'), 'utf-8').then(content => JSON.parse(content)),
promises.readFile(join(nlsMetadataPath, 'nls.messages.json'), 'utf-8').then(content => JSON.parse(content)),
promises.readFile(mainLanguagePackPath, 'utf-8').then(content => JSON.parse(content)),
]);

await promises.mkdir(commitLanguagePackCachePath, { recursive: true });

const nlsResult: string[] = [];

// We expect NLS messages to be in a flat array in sorted order as they
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ export interface IExtensionManagementService {
uninstall(extension: ILocalExtensio 8000 n, options?: UninstallOptions): Promise<void>;
uninstallExtensions(extensions: UninstallExtensionInfo[]): Promise<void>;
toggleApplicationScope(extension: ILocalExtension, fromProfileLocation: URI): Promise<ILocalExtension>;
getInstalled(type?: ExtensionType, profileLocation?: URI, productVersion?: IProductVersion): Promise<ILocalExtension[]>;
getInstalled(type?: ExtensionType, profileLocation?: URI, productVersion?: IProductVersion, language?: string): Promise<ILocalExtension[]>;
getExtensionsControlManifest(): Promise<IExtensionsControlManifest>;
copyExtensions(fromProfileLocation: URI, toProfileLocation: URI): Promise<void>;
updateMetadata(local: ILocalExtension, metadata: Partial<Metadata>, profileLocation: URI): Promise<ILocalExtension>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
import { ExtensionType, IExtensionManifest, TargetPlatform } from '../../extensions/common/extensions.js';
import { IProductService } from '../../product/common/productService.js';
import { CommontExtensionManagementService } from './abstractExtensionManagementService.js';
import { language } from '../../../base/common/platform.js';

function transformIncomingURI(uri: UriComponents, transformer: IURITransformer | null): URI;
function transformIncomingURI(uri: UriComponents | undefined, transformer: IURITransformer | null): URI | undefined;
Expand Down Expand Up @@ -145,7 +146,7 @@ export class ExtensionManagementChannel implements IServerChannel {
return this.service.uninstallExtensions(arg.map(({ extension, options }) => ({ extension: transformIncomingExtension(extension, uriTransformer), options: transformIncomingOptions(options, uriTransformer) })));
}
case 'getInstalled': {
const extensions = await this.service.getInstalled(args[0], transformIncomingURI(args[1], uriTransformer), args[2]);
const extensions = await this.service.getInstalled(args[0], transformIncomingURI(args[1], uriTransformer), args[2], args[3]);
return extensions.map(e => transformOutgoingExtension(e, uriTransformer));
}
case 'toggleApplicationScope': {
Expand Down Expand Up @@ -297,7 +298,7 @@ export class ExtensionManagementChannelClient extends CommontExtensionManagement
}

getInstalled(type: ExtensionType | null = null, extensionsProfileResource?: URI, productVersion?: IProductVersion): Promise<ILocalExtension[]> {
return Promise.resolve(this.channel.call<ILocalExtension[]>('getInstalled', [type, extensionsProfileResource, productVersion]))
return Promise.resolve(this.channel.call<ILocalExtension[]>('getInstalled', [type, extensionsProfileResource, productVersion, language]))
.then(extensions => extensions.map(extension => transformIncomingExtension(extension, null)));
}

Expand Down
< 8E96 td class="blob-code blob-code-context js-file-line">
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ export class ExtensionManagementService extends AbstractExtensionManagementServi
}
}
getInstalled(type?: ExtensionType, profileLocation: URI = this.userDataProfilesService.defaultProfile.extensionsResource, productVersion: IProductVersion = { version: this.productService.version, date: this.productService.date }): Promise<ILocalExtension[]> {
return this.extensionsScanner.scanExtensions(type ?? null, profileLocation, productVersion);
getInstalled(type?: ExtensionType, profileLocation: URI = this.userDataProfilesService.defaultProfile.extensionsResource, productVersion: IProductVersion = { version: this.productService.version, date: this.productService.date }, language?: string): Promise<ILocalExtension[]> {
return this.extensionsScanner.scanExtensions(type ?? null, profileLocation, productVersion, language);
}

scanAllUserInstalledExtensions(): Promise<ILocalExtension[]> {
Expand Down Expand Up @@ -554,14 +554,14 @@ export class ExtensionsScanner extends Disposable {
await this.initializeExtensionSize();
}

async scanExtensions(type: ExtensionType | null, profileLocation: URI, productVersion: IProductVersion): Promise<ILocalExtension[]> {
async scanExtensions(type: ExtensionType | null, profileLocation: URI, productVersion: IProductVersion, language?: string): Promise<ILocalExtension[]> {
try {
const userScanOptions: UserExtensionsScanOptions = { includeInvalid: true, profileLocation, productVersion };
let scannedExtensions: IScannedExtension[] = [];
if (type === null || type === ExtensionType.System) {
let scanAllExtensionsPromise = this.scanAllExtensionPromise.get(profileLocation);
if (!scanAllExtensionsPromise) {
scanAllExtensionsPromise = this.extensionsScannerService.scanAllExtensions({}, userScanOptions)
scanAllExtensionsPromise = this.extensionsScannerService.scanAllExtensions({ language }, userScanOptions)
.finally(() => this.scanAllExtensionPromise.delete(profileLocation));
this.scanAllExtensionPromise.set(profileLocation, scanAllExtensionsPromise);
}
Expand Down
0