Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/microsoft/vscode.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Bierner <matb@microsoft.com>2022-11-04 21:26:04 +0300
committerGitHub <noreply@github.com>2022-11-04 21:26:04 +0300
commitcdc521af16e7791e0968016ef3fd9a5d3249750b (patch)
tree486d414ec16a398362c6d07806d1187948dee7dd /extensions
parent3ca015cebdce232e4eb800e340e25a5e77b7e20e (diff)
Adopt l10n for merge-conflict (#165531)
For #164438
Diffstat (limited to 'extensions')
-rw-r--r--extensions/merge-conflict/package.json4
-rw-r--r--extensions/merge-conflict/src/codelensProvider.ts10
-rw-r--r--extensions/merge-conflict/src/commandHandler.ts22
-rw-r--r--extensions/merge-conflict/src/mergeDecorator.ts7
-rw-r--r--extensions/merge-conflict/yarn.lock5
5 files changed, 18 insertions, 30 deletions
diff --git a/extensions/merge-conflict/package.json b/extensions/merge-conflict/package.json
index caba136ce52..afa226bf694 100644
--- a/extensions/merge-conflict/package.json
+++ b/extensions/merge-conflict/package.json
@@ -165,9 +165,7 @@
}
}
},
- "dependencies": {
- "vscode-nls": "^5.2.0"
- },
+ "dependencies": {},
"devDependencies": {
"@types/node": "16.x"
},
diff --git a/extensions/merge-conflict/src/codelensProvider.ts b/extensions/merge-conflict/src/codelensProvider.ts
index da82a57ac80..391c737a606 100644
--- a/extensions/merge-conflict/src/codelensProvider.ts
+++ b/extensions/merge-conflict/src/codelensProvider.ts
@@ -5,8 +5,6 @@
import * as vscode from 'vscode';
import * as interfaces from './interfaces';
-import { loadMessageBundle } from 'vscode-nls';
-const localize = loadMessageBundle();
export default class MergeConflictCodeLensProvider implements vscode.CodeLensProvider, vscode.Disposable {
private codeLensRegistrationHandle?: vscode.Disposable | null;
@@ -65,25 +63,25 @@ export default class MergeConflictCodeLensProvider implements vscode.CodeLensPro
conflicts.forEach(conflict => {
const acceptCurrentCommand: vscode.Command = {
command: 'merge-conflict.accept.current',
- title: localize('acceptCurrentChange', 'Accept Current Change'),
+ title: vscode.l10n.t("Accept Current Change"),
arguments: ['known-conflict', conflict]
};
const acceptIncomingCommand: vscode.Command = {
command: 'merge-conflict.accept.incoming',
- title: localize('acceptIncomingChange', 'Accept Incoming Change'),
+ title: vscode.l10n.t("Accept Incoming Change"),
arguments: ['known-conflict', conflict]
};
const acceptBothCommand: vscode.Command = {
command: 'merge-conflict.accept.both',
- title: localize('acceptBothChanges', 'Accept Both Changes'),
+ title: vscode.l10n.t("Accept Both Changes"),
arguments: ['known-conflict', conflict]
};
const diffCommand: vscode.Command = {
command: 'merge-conflict.compare',
- title: localize('compareChanges', 'Compare Changes'),
+ title: vscode.l10n.t("Compare Changes"),
arguments: [conflict]
};
diff --git a/extensions/merge-conflict/src/commandHandler.ts b/extensions/merge-conflict/src/commandHandler.ts
index 920875ed6ac..a2b940b24c6 100644
--- a/extensions/merge-conflict/src/commandHandler.ts
+++ b/extensions/merge-conflict/src/commandHandler.ts
@@ -5,8 +5,6 @@
import * as vscode from 'vscode';
import * as interfaces from './interfaces';
import ContentProvider from './contentProvider';
-import { loadMessageBundle } from 'vscode-nls';
-const localize = loadMessageBundle();
interface IDocumentMergeConflictNavigationResults {
canNavigate: boolean;
@@ -92,7 +90,7 @@ export default class CommandHandler implements vscode.Disposable {
// Still failed to find conflict, warn the user and exit
if (!conflict) {
- vscode.window.showWarningMessage(localize('cursorNotInConflict', 'Editor cursor is not within a merge conflict'));
+ vscode.window.showWarningMessage(vscode.l10n.t("Editor cursor is not within a merge conflict"));
return;
}
}
@@ -101,7 +99,7 @@ export default class CommandHandler implements vscode.Disposable {
// Still failed to find conflict, warn the user and exit
if (!conflicts) {
- vscode.window.showWarningMessage(localize('cursorNotInConflict', 'Editor cursor is not within a merge conflict'));
+ vscode.window.showWarningMessage(vscode.l10n.t("Editor cursor is not within a merge conflict"));
return;
}
@@ -134,7 +132,7 @@ export default class CommandHandler implements vscode.Disposable {
const docPath = editor.document.uri.path;
const fileName = docPath.substring(docPath.lastIndexOf('/') + 1); // avoid NodeJS path to keep browser webpack small
- const title = localize('compareChangesTitle', '{0}: Current Changes ↔ Incoming Changes', fileName);
+ const title = vscode.l10n.t("{0}: Current Changes ↔ Incoming Changes", fileName);
const mergeConflictConfig = vscode.workspace.getConfiguration('merge-conflict');
const openToTheSide = mergeConflictConfig.get<string>('diffViewPosition');
const opts: vscode.TextDocumentShowOptions = {
@@ -161,7 +159,7 @@ export default class CommandHandler implements vscode.Disposable {
const conflict = await this.findConflictContainingSelection(editor);
if (!conflict) {
- vscode.window.showWarningMessage(localize('cursorNotInConflict', 'Editor cursor is not within a merge conflict'));
+ vscode.window.showWarningMessage(vscode.l10n.t("Editor cursor is not within a merge conflict"));
return;
}
@@ -184,11 +182,11 @@ export default class CommandHandler implements vscode.Disposable {
typeToAccept = interfaces.CommitType.Incoming;
}
else if (editor.selection.active.isBefore(conflict.splitter.start)) {
- vscode.window.showWarningMessage(localize('cursorOnCommonAncestorsRange', 'Editor cursor is within the common ancestors block, please move it to either the "current" or "incoming" block'));
+ vscode.window.showWarningMessage(vscode.l10n.t('Editor cursor is within the common ancestors block, please move it to either the "current" or "incoming" block'));
return;
}
else {
- vscode.window.showWarningMessage(localize('cursorOnSplitterRange', 'Editor cursor is within the merge conflict splitter, please move it to either the "current" or "incoming" block'));
+ vscode.window.showWarningMessage(vscode.l10n.t('Editor cursor is within the merge conflict splitter, please move it to either the "current" or "incoming" block'));
return;
}
@@ -210,11 +208,11 @@ export default class CommandHandler implements vscode.Disposable {
if (mergeConflictConfig.get<boolean>('autoNavigateNextConflict.enabled')) {
return;
}
- vscode.window.showWarningMessage(localize('noConflicts', 'No merge conflicts found in this file'));
+ vscode.window.showWarningMessage(vscode.l10n.t("No merge conflicts found in this file"));
return;
}
else if (!navigationResult.canNavigate) {
- vscode.window.showWarningMessage(localize('noOtherConflictsInThisFile', 'No other merge conflicts within this file'));
+ vscode.window.showWarningMessage(vscode.l10n.t("No other merge conflicts within this file"));
return;
}
else if (!navigationResult.conflict) {
@@ -241,7 +239,7 @@ export default class CommandHandler implements vscode.Disposable {
}
if (!conflict) {
- vscode.window.showWarningMessage(localize('cursorNotInConflict', 'Editor cursor is not within a merge conflict'));
+ vscode.window.showWarningMessage(vscode.l10n.t("Editor cursor is not within a merge conflict"));
return;
}
@@ -261,7 +259,7 @@ export default class CommandHandler implements vscode.Disposable {
const conflicts = await this.tracker.getConflicts(editor.document);
if (!conflicts || conflicts.length === 0) {
- vscode.window.showWarningMessage(localize('noConflicts', 'No merge conflicts found in this file'));
+ vscode.window.showWarningMessage(vscode.l10n.t("No merge conflicts found in this file"));
return;
}
diff --git a/extensions/merge-conflict/src/mergeDecorator.ts b/extensions/merge-conflict/src/mergeDecorator.ts
index 769ac0b8214..6c70fa79fae 100644
--- a/extensions/merge-conflict/src/mergeDecorator.ts
+++ b/extensions/merge-conflict/src/mergeDecorator.ts
@@ -4,8 +4,7 @@
*--------------------------------------------------------------------------------------------*/
import * as vscode from 'vscode';
import * as interfaces from './interfaces';
-import { loadMessageBundle } from 'vscode-nls';
-const localize = loadMessageBundle();
+
export default class MergeDecorator implements vscode.Disposable {
@@ -88,7 +87,7 @@ export default class MergeDecorator implements vscode.Disposable {
outlineWidth: '1pt',
outlineColor: new vscode.ThemeColor('merge.border'),
after: {
- contentText: ' ' + localize('currentChange', '(Current Change)'),
+ contentText: ' ' + vscode.l10n.t("(Current Change)"),
color: new vscode.ThemeColor('descriptionForeground')
}
});
@@ -118,7 +117,7 @@ export default class MergeDecorator implements vscode.Disposable {
outlineColor: new vscode.ThemeColor('merge.border'),
isWholeLine: this.decorationUsesWholeLine,
after: {
- contentText: ' ' + localize('incomingChange', '(Incoming Change)'),
+ contentText: ' ' + vscode.l10n.t("(Incoming Change)"),
color: new vscode.ThemeColor('descriptionForeground')
}
});
diff --git a/extensions/merge-conflict/yarn.lock b/extensions/merge-conflict/yarn.lock
index 8b8c7a6c15b..e724e7fffa3 100644
--- a/extensions/merge-conflict/yarn.lock
+++ b/extensions/merge-conflict/yarn.lock
@@ -6,8 +6,3 @@
version "16.11.6"
resolved "https://registry.yarnpkg.com/@types/node/-/node-16.11.6.tgz#6bef7a2a0ad684cf6e90fcfe31cecabd9ce0a3ae"
integrity sha512-ua7PgUoeQFjmWPcoo9khiPum3Pd60k4/2ZGXt18sm2Slk0W0xZTqt5Y0Ny1NyBiN1EVQ/+FaF9NcY4Qe6rwk5w==
-
-vscode-nls@^5.2.0:
- version "5.2.0"
- resolved "https://registry.yarnpkg.com/vscode-nls/-/vscode-nls-5.2.0.tgz#3cb6893dd9bd695244d8a024bdf746eea665cc3f"
- integrity sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==