Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
microsoft
GitHub Repository: microsoft/vscode
Path: blob/main/src/vs/platform/dialogs/electron-browser/dialog.ts
3296 views
1
/*---------------------------------------------------------------------------------------------
2
* Copyright (c) Microsoft Corporation. All rights reserved.
3
* Licensed under the MIT License. See License.txt in the project root for license information.
4
*--------------------------------------------------------------------------------------------*/
5
6
import { fromNow } from '../../../base/common/date.js';
7
import { isLinuxSnap } from '../../../base/common/platform.js';
8
import { localize } from '../../../nls.js';
9
import { IOSProperties } from '../../native/common/native.js';
10
import { IProductService } from '../../product/common/productService.js';
11
import { process } from '../../../base/parts/sandbox/electron-browser/globals.js';
12
13
export function createNativeAboutDialogDetails(productService: IProductService, osProps: IOSProperties): { title: string; details: string; detailsToCopy: string } {
14
let version = productService.version;
15
if (productService.target) {
16
version = `${version} (${productService.target} setup)`;
17
} else if (productService.darwinUniversalAssetId) {
18
version = `${version} (Universal)`;
19
}
20
21
const getDetails = (useAgo: boolean): string => {
22
return localize({ key: 'aboutDetail', comment: ['Electron, Chromium, Node.js and V8 are product names that need no translation'] },
23
"Version: {0}\nCommit: {1}\nDate: {2}\nElectron: {3}\nElectronBuildId: {4}\nChromium: {5}\nNode.js: {6}\nV8: {7}\nOS: {8}",
24
version,
25
productService.commit || 'Unknown',
26
productService.date ? `${productService.date}${useAgo ? ' (' + fromNow(new Date(productService.date), true) + ')' : ''}` : 'Unknown',
27
process.versions['electron'],
28
process.versions['microsoft-build'],
29
process.versions['chrome'],
30
process.versions['node'],
31
process.versions['v8'],
32
`${osProps.type} ${osProps.arch} ${osProps.release}${isLinuxSnap ? ' snap' : ''}`
33
);
34
};
35
36
const details = getDetails(true);
37
const detailsToCopy = getDetails(false);
38
39
return {
40
title: productService.nameLong,
41
details: details,
42
detailsToCopy: detailsToCopy
43
};
44
}
45
46