mirror of
https://github.com/microsoft/vscode.git
synced 2026-08-12 08:44:45 +01:00
initial cut of vscode.l10n (#158328)
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { MainContext, MainThreadLocalizationShape } from 'vs/workbench/api/common/extHost.protocol';
|
||||
import { extHostNamedCustomer, IExtHostContext } from 'vs/workbench/services/extensions/common/extHostCustomers';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { IFileService } from 'vs/platform/files/common/files';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
@extHostNamedCustomer(MainContext.MainThreadLocalization)
|
||||
export class MainThreadLocalization extends Disposable implements MainThreadLocalizationShape {
|
||||
|
||||
constructor(
|
||||
extHostContext: IExtHostContext,
|
||||
@IFileService private readonly fileService: IFileService,
|
||||
) {
|
||||
super();
|
||||
}
|
||||
|
||||
async $fetchBundleContents(uriComponents: UriComponents): Promise<string> {
|
||||
const contents = await this.fileService.readFile(URI.revive(uriComponents));
|
||||
return contents.value.toString();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user