How to use the vscode-nls.config function in vscode-nls

To help you get started, we’ve selected a few vscode-nls examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github forcedotcom / salesforcedx-vscode / packages / salesforcedx-visualforce-language-server / src / visualforceServer.ts View on Github external
ServerCapabilities as CPServerCapabilities
} from 'vscode-languageserver-protocol';
import {
  ConfigurationParams,
  ConfigurationRequest
} from 'vscode-languageserver-protocol';

import { format } from './modes/formatting';
import { pushAll } from './utils/arrays';

import * as path from 'path';
import * as url from 'url';
import uri from 'vscode-uri';

import * as nls from 'vscode-nls';
nls.config(process.env['VSCODE_NLS_CONFIG']);

// tslint:disable-next-line:no-namespace
namespace TagCloseRequest {
  export const type: RequestType<
    TextDocumentPositionParams,
    string,
    any,
    any
  > = new RequestType('html/tag');
}

// Create a connection for the server
const connection: IConnection = createConnection();

console.log = connection.console.log.bind(connection.console);
console.error = connection.console.error.bind(connection.console);
github satokaz / vscode-memo-life-for-you / src / memoOpenFolder.ts View on Github external

'use strict';

import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import * as dateFns from 'date-fns';
import * as nls from 'vscode-nls';
import * as os from 'os';
import { memoConfigure } from './memoConfigure';

const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

export class memoOpenFolder extends memoConfigure {
    constructor() {
        super();
        // console.log('memoOpenFolder');
        // console.log(this.memodir);
        // console.log('vscode.Uri =', vscode.Uri.file(this.memodir));
    }

    /**
     * Open Dir
     */
    public OpenDir() {
        this.readConfig();
        let folderUrl = vscode.Uri.file(this.memodir);
        vscode.commands.executeCommand("vscode.openFolder", folderUrl, true);
github satokaz / vscode-memo-life-for-you / src / memoOpenTypora.ts View on Github external
'use strict';

import * as vscode from 'vscode';
import * as cp from 'child_process';
import * as fs from 'fs';
import * as nls from 'vscode-nls';
import { memoConfigure } from './memoConfigure';

const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

export class memoOpenTypora extends memoConfigure {

    constructor() {
        super();
    }
    
    /**
     * OpenTypora
     */
    public OpenTypora() {
        this.readConfig();
        // memopath に設定されたコマンドが実行可能かチェック
        console.log(this.memopath);

        // memo-life-for-you.TyporaExecPath
github satokaz / vscode-memo-life-for-you / src / memoOpenChrome.ts View on Github external
'use strict';

import * as vscode from 'vscode';
import * as nls from 'vscode-nls';
import { memoConfigure } from './memoConfigure';
import * as chromeLauncher from 'chrome-launcher';


const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

export class memoOpenChrome extends memoConfigure {
    constructor() {
        super();
    }

    /**
     * Open Chrome
     */
    public async OpenChrome() {
        this.readConfig();

        // await vscode.commands.executeCommand('markdown.showPreviewToSide').then(() => {
        // // await vscode.commands.executeCommand('markdown-preview-enhanced.openPreview').then(() => {
        //     setTimeout(() => { Ω
        //         vscode.commands.executeCommand('editor.action.webvieweditor.selectAll').then(() => {
github microsoft / vscode-extension-samples / i18n-sample / src / extension.ts View on Github external
/* --------------------------------------------------------------------------------------------
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License. See License.txt in the project root for license information.
 * ------------------------------------------------------------------------------------------ */

import * as nls from 'vscode-nls';
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

import * as vscode from 'vscode';
import { sayByeCommand } from './command/sayBye';

export function activate(context: vscode.ExtensionContext) {
	const helloCmd = vscode.commands.registerCommand('extension.sayHello', () => {
		const message = localize('sayHello.text', 'Hello')
		vscode.window.showInformationMessage(message);
	});

	const byeCmd = vscode.commands.registerCommand(
		'extension.sayBye',
		sayByeCommand
	);

	context.subscriptions.push(helloCmd, byeCmd);
github mrcrowl / vscode-hg / src / main.ts View on Github external
'use strict';

import { ExtensionContext, workspace, window, Disposable, commands, Uri } from 'vscode';
import { findHg, Hg } from './hg';
import { Model } from './model';
import { MercurialSCMProvider } from './scmProvider';
import { CommandCenter } from './commands';
import { StatusBarCommands } from './statusbar';
import { HgContentProvider } from './contentProvider';
import { AutoIncomingOutgoing } from './autoinout';
import { MergeDecorator } from './merge';
import { Askpass } from './askpass';
import TelemetryReporter from 'vscode-extension-telemetry';
import * as nls from 'vscode-nls';

const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

async function init(context: ExtensionContext, disposables: Disposable[]): Promise {
	const { name, version, aiKey } = require(context.asAbsolutePath('./package.json')) as { name: string, version: string, aiKey: string };
	const telemetryReporter: TelemetryReporter = new TelemetryReporter(name, version, aiKey);
	disposables.push(telemetryReporter);

	const outputChannel = window.createOutputChannel('Hg');
	disposables.push(outputChannel);

	const config = workspace.getConfiguration('hg');
	const enabled = config.get('enabled') === true;
	const workspaceRootPath = workspace.rootPath;

	const pathHint = workspace.getConfiguration('hg').get('path');
	const info = await findHg(pathHint);
	const askpass = new Askpass();
github satokaz / vscode-memo-life-for-you / src / memoTodo.ts View on Github external

'use strict';

import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import * as dateFns from 'date-fns';
import * as nls from 'vscode-nls';
import * as os from 'os';
import { memoConfigure } from './memoConfigure';

const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

export class memoTodo extends memoConfigure {

    constructor() {
        super();
    }

    /**
     * Todo.txt
     */
    public Todo() {
        this.readConfig();

        let file: string = 'todo.txt'
        let dateFormat = this.memoDateFormat;
github facebookarchive / atom-ide-ui / modules / atom-ide-debugger-node / VendorLib / vscode-node-debug2 / out / src / errors.js View on Github external
"use strict";
/*---------------------------------------------------------
 * Copyright (C) Microsoft Corporation. All rights reserved.
 *--------------------------------------------------------*/
Object.defineProperty(exports, "__esModule", { value: true });
const nls = require("vscode-nls");
const localize = nls.config(process.env.VSCODE_NLS_CONFIG)(__filename);
function runtimeNotFound(_runtime) {
    return {
        id: 2001,
        format: localize(0, null, '{_runtime}'),
        variables: { _runtime }
    };
}
exports.runtimeNotFound = runtimeNotFound;
function cannotLaunchInTerminal(_error) {
    return {
        id: 2011,
        format: localize(1, null, '{_error}'),
        variables: { _error }
    };
}
exports.cannotLaunchInTerminal = cannotLaunchInTerminal;
github microsoft / vscode-chrome-debug-core / src / chrome / utils / localizedError.ts View on Github external
export function configureLocale(locale: string): void {
    nls.config({ locale: locale });
    getLocalizeCalls.forEach(eachCall => eachCall());
}
github satokaz / vscode-memo-life-for-you / src / memoNew.ts View on Github external
'use strict';

import * as vscode from 'vscode';
import * as fs from 'fs';
import * as path from 'path';
import * as randomEmoji from 'node-emoji';
import * as dateFns from 'date-fns';
import * as nls from 'vscode-nls';
import * as os from 'os';
import { items, memoConfigure } from './memoConfigure';
import * as clipboardy from 'clipboardy';
import * as Mustache from 'mustache';

const localize = nls.config(process.env.VSCODE_NLS_CONFIG)();

export class memoNew extends memoConfigure  {

    constructor() {
        super();
    }

    /**
     * New
     */
    public New() {
        this.readConfig();

        let file: string;

        let selectString: string = "";

vscode-nls

NPM module to externalize and localize VSCode extensions

MIT
Latest version published 2 years ago

Package Health Score

58 / 100
Full package analysis

Similar packages