mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-01 14:01:38 +01:00
Engineering - adopt l10n for git-base/git/github extesions (#164566)
Co-authored-by: Tyler James Leonhardt <me@tylerleonhardt.com>
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { API as GitAPI, Repository } from './typings/git';
|
||||
import { getOctokit } from './auth';
|
||||
import { TextEncoder } from 'util';
|
||||
@@ -12,8 +11,6 @@ import { basename } from 'path';
|
||||
import { Octokit } from '@octokit/rest';
|
||||
import { isInCodespaces } from './pushErrorHandler';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
function sanitizeRepositoryName(value: string): string {
|
||||
return value.trim().replace(/[^a-z0-9_.]/ig, '-');
|
||||
}
|
||||
@@ -41,7 +38,7 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
||||
folder = vscode.workspace.workspaceFolders[0].uri;
|
||||
} else {
|
||||
const picks = vscode.workspace.workspaceFolders.map(folder => ({ label: folder.name, folder }));
|
||||
const placeHolder = localize('pick folder', "Pick a folder to publish to GitHub");
|
||||
const placeHolder = vscode.l10n.t('Pick a folder to publish to GitHub');
|
||||
const pick = await vscode.window.showQuickPick(picks, { placeHolder });
|
||||
|
||||
if (!pick) {
|
||||
@@ -130,7 +127,7 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
||||
|
||||
if (shouldGenerateGitignore) {
|
||||
quickpick = vscode.window.createQuickPick();
|
||||
quickpick.placeholder = localize('ignore', "Select which files should be included in the repository.");
|
||||
quickpick.placeholder = vscode.l10n.t('Select which files should be included in the repository.');
|
||||
quickpick.canSelectMany = true;
|
||||
quickpick.show();
|
||||
|
||||
@@ -171,8 +168,8 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
||||
const githubRepository = await vscode.window.withProgress({ location: vscode.ProgressLocation.Notification, cancellable: false, title: 'Publish to GitHub' }, async progress => {
|
||||
progress.report({
|
||||
message: isPrivate
|
||||
? localize('publishing_private', "Publishing to a private GitHub repository")
|
||||
: localize('publishing_public', "Publishing to a public GitHub repository"),
|
||||
? vscode.l10n.t('Publishing to a private GitHub repository')
|
||||
: vscode.l10n.t('Publishing to a public GitHub repository'),
|
||||
increment: 25
|
||||
});
|
||||
|
||||
@@ -190,7 +187,7 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
||||
}
|
||||
|
||||
if (createdGithubRepository) {
|
||||
progress.report({ message: localize('publishing_firstcommit', "Creating first commit"), increment: 25 });
|
||||
progress.report({ message: vscode.l10n.t('Creating first commit'), increment: 25 });
|
||||
|
||||
if (!repository) {
|
||||
repository = await gitAPI.init(folder) || undefined;
|
||||
@@ -202,7 +199,7 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
||||
await repository.commit('first commit', { all: true, postCommitCommand: null });
|
||||
}
|
||||
|
||||
progress.report({ message: localize('publishing_uploading', "Uploading files"), increment: 25 });
|
||||
progress.report({ message: vscode.l10n.t('Uploading files'), increment: 25 });
|
||||
|
||||
const branch = await repository.getBranch('HEAD');
|
||||
const protocol = vscode.workspace.getConfiguration('github').get<'https' | 'ssh'>('gitProtocol');
|
||||
@@ -218,8 +215,8 @@ export async function publishRepository(gitAPI: GitAPI, repository?: Repository)
|
||||
return;
|
||||
}
|
||||
|
||||
const openOnGitHub = localize('openingithub', "Open on GitHub");
|
||||
vscode.window.showInformationMessage(localize('publishing_done', "Successfully published the '{0}' repository to GitHub.", `${owner}/${repo}`), openOnGitHub).then(action => {
|
||||
const openOnGitHub = vscode.l10n.t('Open on GitHub');
|
||||
vscode.window.showInformationMessage(vscode.l10n.t('Successfully published the "{0}" repository to GitHub.', `${owner}/${repo}`), openOnGitHub).then(action => {
|
||||
if (action === openOnGitHub) {
|
||||
vscode.commands.executeCommand('vscode.open', vscode.Uri.parse(githubRepository.html_url));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user