本文整理汇总了TypeScript中vs/nls.localize函数的典型用法代码示例。如果您正苦于以下问题:TypeScript localize函数的具体用法?TypeScript localize怎么用?TypeScript localize使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了localize函数的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1:
import { TPromise } from 'vs/base/common/winjs.base';
import * as Types from 'vs/base/common/types';
import * as Objects from 'vs/base/common/objects';
import { ExtensionsRegistry, ExtensionMessageCollector } from 'vs/platform/extensions/common/extensionsRegistry';
import * as Tasks from 'vs/workbench/parts/tasks/common/tasks';
const taskDefinitionSchema: IJSONSchema = {
type: 'object',
additionalProperties: false,
properties: {
type: {
type: 'string',
description: nls.localize('TaskDefinition.description', 'The actual task type')
},
required: {
type: 'array',
items: {
type: 'string'
}
},
properties: {
type: 'object',
description: nls.localize('TaskDefinition.properties', 'Additional properties of the task type'),
additionalProperties: {
$ref: 'http://json-schema.org/draft-04/schema#'
}
}
}
示例2: setEnablement
/**
* Enable or disable the given extension.
* if `workspace` is `true` then enablement is done for workspace, otherwise globally.
*
* Returns a promise that resolves to boolean value.
* if resolves to `true` then requires restart for the change to take effect.
*
* Throws error if enablement is requested for workspace and there is no workspace
*/
setEnablement(identifier: IExtensionIdentifier, enable: boolean, workspace?: boolean): TPromise<boolean>;
migrateToIdentifiers(installed: IExtensionIdentifier[]): void;
}
export const IExtensionTipsService = createDecorator<IExtensionTipsService>('extensionTipsService');
export interface IExtensionTipsService {
_serviceBrand: any;
getAllRecommendationsWithReason(): { [id: string]: string; };
getFileBasedRecommendations(): string[];
getOtherRecommendations(): string[];
getWorkspaceRecommendations(): TPromise<string[]>;
getKeymapRecommendations(): string[];
getKeywordsForExtension(extension: string): string[];
getRecommendationsForExtension(extension: string): string[];
}
export const ExtensionsLabel = localize('extensions', "Extensions");
export const ExtensionsChannelId = 'extensions';
export const PreferencesLabel = localize('preferences', "Preferences");
示例3:
'support.function',
'support.other',
'support.type',
'support.type.property-name',
'support.variable',
'variable',
'variable.language',
'variable.name',
'variable.other',
'variable.other.readwrite',
'variable.parameter'
];
export const tokenColorizationSettingSchema: IJSONSchema = {
type: 'object',
description: nls.localize('schema.token.settings', 'Colors and styles for the token.'),
properties: {
foreground: {
type: 'string',
description: nls.localize('schema.token.foreground', 'Foreground color for the token.'),
format: 'color-hex',
default: '#ff0000'
},
background: {
type: 'string',
deprecationMessage: nls.localize('schema.token.background.warning', 'Token background colors are currently not supported.')
},
fontStyle: {
type: 'string',
description: nls.localize('schema.token.fontStyle', 'Font style of the rule: \'italic\', \'bold\' or \'underline\' or a combination. The empty string unsets inherited settings.'),
pattern: '^(\\s*\\b(italic|bold|underline))*\\s*$',
示例4:
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
'use strict';
import * as nls from 'vs/nls';
import {IJSONSchema} from 'vs/base/common/jsonSchema';
var global:any = self;
global.MonacoEditorSchemas = global.MonacoEditorSchemas || {};
let MonacoEditorSchemas: { [uri:string]:IJSONSchema } = global.MonacoEditorSchemas;
MonacoEditorSchemas['http://json.schemastore.org/project'] = {
'title': nls.localize('project.json.title', 'JSON schema for ASP.NET project.json files'),
'$schema': 'http://json-schema.org/draft-04/schema#',
'id': 'http://json.schemastore.org/project',
'type': 'object',
'definitions': {
'compilationOptions': {
'description': nls.localize('project.json.compilationOptions', 'Compilation options that are passed through to Roslyn'),
'type': 'object',
'properties': {
'define': {
'type': 'array',
'items': {
'type': 'string',
'uniqueItems': true
}
示例5: getActivePreviewsForResource
import { registerWebViewCommands } from 'vs/workbench/parts/webview/electron-browser/webview.contribution';
function getActivePreviewsForResource(accessor: ServicesAccessor, resource: URI | string) {
const uri = resource instanceof URI ? resource : URI.parse(resource);
return accessor.get(IEditorService).visibleControls
.filter(c => c instanceof HtmlPreviewPart && c.model)
.map(e => e as HtmlPreviewPart)
.filter(e => e.model.uri.scheme === uri.scheme && e.model.uri.toString() === uri.toString());
}
// --- Register Editor
(Registry.as<IEditorRegistry>(EditorExtensions.Editors)).registerEditor(new EditorDescriptor(
HtmlPreviewPart,
HtmlPreviewPart.ID,
localize('html.editor.label', "Html Preview")),
[new SyncDescriptor(HtmlInput)]);
// --- Register Commands
CommandsRegistry.registerCommand('_workbench.previewHtml', function (
accessor: ServicesAccessor,
resource: URI | string,
position?: EditorViewColumn,
label?: string
) {
const uri = resource instanceof URI ? resource : URI.parse(resource);
label = label || uri.fsPath;
let input: HtmlInput;
示例6:
if (root) {
terminalService.openTerminal(root.fsPath);
} else {
// Opens current file's folder, if no folder is open in editor
const activeFile = historyService.getLastActiveFile();
if (activeFile) {
terminalService.openTerminal(paths.dirname(activeFile.fsPath));
}
}
}
});
MenuRegistry.appendMenuItem(MenuId.CommandPalette, {
command: {
id: OPEN_NATIVE_CONSOLE_COMMAND_ID,
title: env.isWindows ? nls.localize('globalConsoleActionWin', "Open New Command Prompt") :
nls.localize('globalConsoleActionMacLinux', "Open New Terminal")
}
});
const openConsoleCommand = {
id: OPEN_IN_TERMINAL_COMMAND_ID,
title: env.isWindows ? nls.localize('scopedConsoleActionWin', "Open in Command Prompt") :
nls.localize('scopedConsoleActionMacLinux', "Open in Terminal")
};
MenuRegistry.appendMenuItem(MenuId.OpenEditorsContext, {
group: 'navigation',
order: 30,
command: openConsoleCommand,
when: ResourceContextKey.Scheme.isEqualTo(Schemas.file)
});
示例7: constructor
constructor() {
this.editor = {
experimentalScreenReader: true,
rulers: [],
wordSeparators: USUAL_WORD_SEPARATORS,
selectionClipboard: true,
ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"),
lineNumbers: true,
selectOnLineNumbers: true,
lineNumbersMinChars: 5,
glyphMargin: false,
lineDecorationsWidth: 10,
revealHorizontalRightPadding: 30,
roundedSelection: true,
theme: 'vs',
readOnly: false,
scrollbar: {
verticalScrollbarSize: 14,
horizontal: 'auto',
useShadows: true,
verticalHasArrows: false,
horizontalHasArrows: false
},
overviewRulerLanes: 2,
cursorBlinking: 'blink',
mouseWheelZoom: false,
cursorStyle: 'line',
fontLigatures: false,
disableTranslate3d: false,
hideCursorInOverviewRuler: false,
scrollBeyondLastLine: true,
automaticLayout: false,
wrappingColumn: 300,
wrappingIndent: 'same',
wordWrapBreakBeforeCharacters: '([{‘“〈《「『【〔([{「£¥$£¥++',
wordWrapBreakAfterCharacters: ' \t})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー’”〉》」』】〕)]}」',
wordWrapBreakObtrusiveCharacters: '.',
// Features
hover: true,
contextmenu: true,
mouseWheelScrollSensitivity: 1,
quickSuggestions: true,
quickSuggestionsDelay: 10,
parameterHints: true,
iconsInSuggestions: true,
autoClosingBrackets: true,
formatOnType: false,
suggestOnTriggerCharacters: true,
acceptSuggestionOnEnter: true,
selectionHighlight: true,
referenceInfos: true,
folding: true,
renderWhitespace: false,
renderControlCharacters: false,
renderIndentGuides: false,
useTabStops: true,
fontFamily: (
platform.isMacintosh ? DEFAULT_MAC_FONT_FAMILY : (platform.isLinux ? DEFAULT_LINUX_FONT_FAMILY : DEFAULT_WINDOWS_FONT_FAMILY)
),
fontSize: (
platform.isMacintosh ? 12 : 14
),
lineHeight: 0
};
}
示例8: fixReferences
}
Object.getOwnPropertyNames(literal).forEach(property => {
let value = literal[property];
if (Array.isArray(value) || typeof value === 'object') {
fixReferences(value);
}
});
}
}
const shellCommand: IJSONSchema = {
anyOf: [
{
type: 'boolean',
default: true,
description: nls.localize('JsonSchema.shell', 'Specifies whether the command is a shell command or an external program. Defaults to false if omitted.')
},
{
$ref: '#definitions/shellConfiguration'
}
],
deprecationMessage: nls.localize('JsonSchema.tasks.isShellCommand.deprecated', 'The property isShellCommand is deprecated. Use the type property of the task and the shell property in the options instead. See also the 1.14 release notes.')
};
const taskIdentifier: IJSONSchema = {
type: 'object',
additionalProperties: true,
properties: {
type: {
type: 'string',
description: nls.localize('JsonSchema.tasks.dependsOn.identifier', 'The task identifier.')
示例9: constructor
constructor() {
this.editor = {
experimentalScreenReader: true,
rulers: [],
wordSeparators: USUAL_WORD_SEPARATORS,
selectionClipboard: true,
ariaLabel: nls.localize('editorViewAccessibleLabel', "Editor content"),
lineNumbers: true,
selectOnLineNumbers: true,
lineNumbersMinChars: 5,
glyphMargin: false,
lineDecorationsWidth: 10,
revealHorizontalRightPadding: 30,
roundedSelection: true,
theme: 'vs',
readOnly: false,
scrollbar: {
verticalScrollbarSize: 14,
horizontal: 'auto',
useShadows: true,
verticalHasArrows: false,
horizontalHasArrows: false
},
overviewRulerLanes: 2,
cursorBlinking: 'blink',
cursorStyle: 'line',
fontLigatures: false,
hideCursorInOverviewRuler: false,
scrollBeyondLastLine: true,
automaticLayout: false,
wrappingColumn: 300,
wrappingIndent: 'same',
wordWrapBreakBeforeCharacters: '([{‘“〈《「『【〔([{「£¥$£¥++',
wordWrapBreakAfterCharacters: ' \t})]?|&,;¢°′″‰℃、。。、¢,.:;?!%・・ゝゞヽヾーァィゥェォッャュョヮヵヶぁぃぅぇぉっゃゅょゎゕゖㇰㇱㇲㇳㇴㇵㇶㇷㇸㇹㇺㇻㇼㇽㇾㇿ々〻ァィゥェォャュョッー’”〉》」』】〕)]}」',
wordWrapBreakObtrusiveCharacters: '.',
tabFocusMode: false,
// stopLineTokenizationAfter
// stopRenderingLineAfter
longLineBoundary: 300,
forcedTokenizationBoundary: 1000,
// Features
hover: true,
contextmenu: true,
mouseWheelScrollSensitivity: 1,
quickSuggestions: true,
quickSuggestionsDelay: 10,
iconsInSuggestions: true,
autoClosingBrackets: true,
formatOnType: false,
suggestOnTriggerCharacters: true,
acceptSuggestionOnEnter: true,
selectionHighlight: true,
outlineMarkers: false,
referenceInfos: true,
folding: true,
renderWhitespace: false,
indentGuides: false,
fontFamily: '',
fontSize: 0,
lineHeight: 0
};
}
示例10: request
_serviceBrand: any;
request(options: IRequestOptions): TPromise<IRequestContext>;
}
export interface IHTTPConfiguration {
http?: {
proxy?: string;
proxyStrictSSL?: boolean;
};
}
Registry.as<IConfigurationRegistry>(Extensions.Configuration)
.registerConfiguration({
id: 'http',
order: 15,
title: localize('httpConfigurationTitle', "HTTP"),
type: 'object',
properties: {
'http.proxy': {
type: 'string',
pattern: '^https?://([^:]*(:[^@]*)?@)?([^:]+)(:\\d+)?/?$|^$',
description: localize('proxy', "The proxy setting to use. If not set will be taken from the http_proxy and https_proxy environment variables")
},
'http.proxyStrictSSL': {
type: 'boolean',
default: true,
description: localize('strictSSL', "Whether the proxy server certificate should be verified against the list of supplied CAs.")
}
}
});