Skip to content

Commit

Permalink
Renamed command "Translate from ... to ..." to "Translate to ... from…
Browse files Browse the repository at this point in the history
… ..."
  • Loading branch information
soerenuhrbach committed Mar 8, 2024
1 parent 3a5a72a commit 758245e
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

### 1.1.0

- Removed the command "Translate from ... to ... below original text"
- Removed the command "Translate to ... from ... below original text"
- Added new configuration `deepl.configuration` to specify whether the selected text should be replaced with the translation result or inserted into a new line below/above
- Added the command "Deepl: Translate and paste from clipboard" which allows to translate the clipboard content and paste it.
- Show warning message if translation result equals the original text with actions to resolve this conflict.
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The following commands are available to translate texts:
|---|---|---
|DeepL: Translate|alt+t|Translates the selected text into the last used target language
|DeepL: Translate to ...|alt+shift+t|Asks for the target language and translates the selected text into the target language
|DeepL: Translate from ... to ...|alt+ctrl+shift+t|Asks for source and target language and translates the selected text from the source language into the target language
|DeepL: Translate to ... from ...|alt+ctrl+shift+t|Asks for source and target language and translates the selected text from the source language into the target language
|DeepL: Translate and paste from clipboard|ctrl+shift+v|Translates the clipboard content and paste it
|DeepL: Duplicate and translate|ctrl+shift+d|Duplicates and translates the selected text

Expand Down Expand Up @@ -74,7 +74,7 @@ Dont use this extension if you dont agree with their privacy policy!

### 1.1.0

- Removed the command "Translate from ... to ... below original text"
- Removed the command "Translate to ... from ... below original text"
- Added new configuration `deepl.configuration` to specify whether the selected text should be replaced with the translation result or inserted into a new line below/above
- Added the command "Deepl: Translate and paste from clipboard" which allows to translate the clipboard content and paste it.
- Show warning message if translation result equals the original text with actions to resolve this conflict.
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,9 @@
"shortTitle": "Translate to ..."
},
{
"command": "deepl.translateFromTo",
"title": "DeepL: Translate from ... to ...",
"shortTitle": "Translate from ..."
"command": "deepl.translateToFrom",
"title": "DeepL: Translate to ... from ...",
"shortTitle": "Translate to ... from ..."
},
{
"command": "deepl.configure",
Expand Down Expand Up @@ -232,7 +232,7 @@
},
{
"when": "editorHasSelection && !isInDiffEditor",
"command": "deepl.translateFromTo",
"command": "deepl.translateToFrom",
"group": "deepl@3"
}
]
Expand All @@ -249,7 +249,7 @@
"key": "shift+alt+t"
},
{
"command": "deepl.translateFromTo",
"command": "deepl.translateToFrom",
"when": "editorHasSelection && !isInDiffEditor",
"key": "ctrl+shift+alt+t",
"mac": "cmd+shift+alt+t"
Expand Down
2 changes: 1 addition & 1 deletion src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export const translateTo = createTranslateSelectionsCommand({
forceTargetLanguagePrompt: true,
forceSourceLanguagePrompt: false
});
export const translateFromTo = createTranslateSelectionsCommand({
export const translateToFrom = createTranslateSelectionsCommand({
forceTargetLanguagePrompt: true,
forceSourceLanguagePrompt: true
});
Expand Down
2 changes: 1 addition & 1 deletion src/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const EXTENSION_IDENTIFIER = 'soerenuhrbach.vscode-deepl';
export const COMMAND_CONFIGURE = 'deepl.configure';
export const COMMAND_TRANSLATE = 'deepl.translate';
export const COMMAND_TRANSLATE_TO = 'deepl.translateTo';
export const COMMAND_TRANSLATE_FROM_TO = 'deepl.translateFromTo';
export const COMMAND_TRANSLATE_FROM_TO = 'deepl.translateToFrom';
export const COMMAND_TRANSLATE_AND_PASTE_FROM_CLIPBOARD = 'deepl.translateAndPasteFromClipboard';
export const COMMAND_DUPLICATE_AND_TRANSLATE = 'deepl.duplicateAndTranslate';
export const COMMAND_SET_TARGET_LANGAUGE = 'deepl.setTargetLanguage';
4 changes: 2 additions & 2 deletions src/extension.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as vscode from 'vscode';
import { setup } from './state';
import { createStatusBarItem } from './status-bar';
import { configureSettings, translate, translateFromTo, translateTo, translateAndPasteFromClipboard, setTargetLangauge, duplicateAndTranslate } from './commands';
import { configureSettings, translate, translateToFrom, translateTo, translateAndPasteFromClipboard, setTargetLangauge, duplicateAndTranslate } from './commands';
import { COMMAND_CONFIGURE, COMMAND_TRANSLATE, COMMAND_TRANSLATE_FROM_TO, COMMAND_TRANSLATE_TO, COMMAND_TRANSLATE_AND_PASTE_FROM_CLIPBOARD, COMMAND_SET_TARGET_LANGAUGE, COMMAND_DUPLICATE_AND_TRANSLATE } from './constants';

export async function activate(context: vscode.ExtensionContext) {
Expand All @@ -11,7 +11,7 @@ export async function activate(context: vscode.ExtensionContext) {
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_CONFIGURE, configureSettings));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_TRANSLATE, translate));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_TRANSLATE_TO, translateTo));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_TRANSLATE_FROM_TO, translateFromTo));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_TRANSLATE_FROM_TO, translateToFrom));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_TRANSLATE_AND_PASTE_FROM_CLIPBOARD, translateAndPasteFromClipboard));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_SET_TARGET_LANGAUGE , setTargetLangauge));
context.subscriptions.push(vscode.commands.registerCommand(COMMAND_DUPLICATE_AND_TRANSLATE , duplicateAndTranslate));
Expand Down

0 comments on commit 758245e

Please sign in to comment.