Skip to content

Commit

Permalink
New version 1.2.0.0. Major changes: embedded python included, online
Browse files Browse the repository at this point in the history
model dowmnload is smoother, edit rule functionality added, new version
check runs on startup
  • Loading branch information
TommiNieminen committed Jun 28, 2022
2 parents ef37cba + 109643b commit b87bc92
Show file tree
Hide file tree
Showing 143 changed files with 8,079 additions and 11,006 deletions.
2 changes: 1 addition & 1 deletion OmegaTPlugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Copy the plugin file ([omegat-plugin-opus-mt-1.0.0.jar](https://github.com/Helsi

**Usage**

Once the plugin has been installed, it should show up in the **Options** -> **Machine Translate** menu when a project is open in OmegaT. Make sure that the OPUS MT engine is running on the same machine and that a MT model has been installed for the language pair of the project. If the MT engine is not running, you will see a **Connection refused** error. If the MT engine is running but a model for the language pair has not been installed, you will see a **400: Bad Request** error.
Once the plugin has been installed, it should show up in the **Options** -> **Machine Translate** menu when a project is open in OmegaT. Make sure that the OPUS MT engine is running on the same machine and that a MT model has been installed for the language pair of the project (see instructions here: https://helsinki-nlp.github.io/OPUS-CAT/install). If the MT engine is not running, you will see a **Connection refused** error. If the MT engine is running but a model for the language pair has not been installed, you will see a **400: Bad Request** error.

**Licensing**

Expand Down
4 changes: 2 additions & 2 deletions OpusCatChromeExtension/connector.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ let contentScriptTab;
chrome.runtime.onMessage.addListener(function(request, sender, sendResponse) {
if ("opusCatSourceText" in request) {
contentScriptTab = sender.tab;
var params = {tokenCode:0,input:request.opusCatSourceText,srcLangCode:"en",trgLangCode:"fi",modelTag:""};
var params = {tokenCode:0,input:request.opusCatSourceText,modelTag:""};

chrome.storage.local.get(['opusCatUrlSetting'], function(result) {
chrome.storage.local.get({'opusCatUrlSetting':"http://localhost:8500/MTRestService/TranslateJson"}, function(result) {
let url = new URL(result.opusCatUrlSetting);
url.search = new URLSearchParams(params).toString();
fetch(url).then(response => response.json()).then(data => currentTranslation = data["translation"]);
Expand Down
2 changes: 1 addition & 1 deletion OpusCatChromeExtension/extractsource.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function notifyEngine(e) {
chrome.runtime.sendMessage({opusCatSourceText: sourceSegment.textContent});
}
}
if (locationUrl.hostname.endsWith("xtm.cloud")) {
if (locationUrl.hostname.endsWith("xtm.cloud") || locationUrl.hostname.endsWith("xtm-intl.com")) {
var activesegs = document.getElementsByClassName("trans-unit--active");
if (activesegs.length > 0) {
const activeSegmentPair = activesegs[0];
Expand Down
Binary file added OpusCatChromeExtension/icons/opus128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 13 additions & 6 deletions OpusCatChromeExtension/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,41 @@
"manifest_version": 3,
"name": "OPUS-CAT extension",
"description": "Sends source text from supported websites for translation in local OPUS-CAT MT engine.",
"version": "1.0",
"version": "1.0.0",
"action": {
"default_icon": {
"16": "icons/opus16.png",
"24": "icons/opus24.png",
"32": "icons/opus32.png"
"32": "icons/opus32.png",
"128": "icons/opus128.png"
},
"default_title": "OPUS-CAT",
"default_popup": "popup.html"
},
"icons": {
"16": "icons/opus16.png",
"24": "icons/opus24.png",
"32": "icons/opus32.png",
"128": "icons/opus128.png"
},
"background": {
"service_worker": "connector.js"
},
"permissions": ["notifications","tabs","storage","commands","clipboardRead","clipboardWrite"],
"content_scripts": [
{
"matches": ["https://*.memsource.com/*","*://*.xtm.cloud/*"],
"matches": ["https://*.memsource.com/*","*://*.xtm.cloud/*","*://*.xtm-intl.com/*"],
"js": ["extractsource.js"],
"all_frames": true
}
],
"commands": {
"copy-opuscat-mt": {
"suggested_key": {
"windows": "Ctrl+Shift+5",
"mac": "Command+Shift+5"
"windows": "Ctrl+Shift+K",
"mac": "Command+Shift+K"
},
"description": "Toggle feature foo"
"description": "Paste OPUS-CAT translation to the active text element"
}
}
}
45 changes: 45 additions & 0 deletions OpusCatEngineAndPlugins.sln
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpusCatTranslationProvider2
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SettingsUiTester", "SettingsUiTester\SettingsUiTester.csproj", "{23EB17A2-9A46-4D3E-A471-1952430CDA26}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpusCatTradosPluginTests", "OpusCatTradosPluginTests\OpusCatTradosPluginTests.csproj", "{7835C453-B4A0-45C4-BDB8-7888D26561FC}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OpusCatMTEngineTests", "OpusCatMTEngineTests\OpusCatMTEngineTests.csproj", "{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "memoqPluginTest", "memoqPluginTest\memoqPluginTest.csproj", "{240B57C5-5B97-473C-8B79-D3E440755402}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -159,6 +165,42 @@ Global
{23EB17A2-9A46-4D3E-A471-1952430CDA26}.Release|x64.Build.0 = Release|Any CPU
{23EB17A2-9A46-4D3E-A471-1952430CDA26}.Release|x86.ActiveCfg = Release|Any CPU
{23EB17A2-9A46-4D3E-A471-1952430CDA26}.Release|x86.Build.0 = Release|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Debug|x64.ActiveCfg = Debug|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Debug|x64.Build.0 = Debug|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Debug|x86.ActiveCfg = Debug|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Debug|x86.Build.0 = Debug|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Release|Any CPU.Build.0 = Release|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Release|x64.ActiveCfg = Release|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Release|x64.Build.0 = Release|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Release|x86.ActiveCfg = Release|Any CPU
{7835C453-B4A0-45C4-BDB8-7888D26561FC}.Release|x86.Build.0 = Release|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Debug|Any CPU.Build.0 = Debug|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Debug|x64.ActiveCfg = Debug|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Debug|x64.Build.0 = Debug|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Debug|x86.ActiveCfg = Debug|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Debug|x86.Build.0 = Debug|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Release|Any CPU.ActiveCfg = Release|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Release|Any CPU.Build.0 = Release|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Release|x64.ActiveCfg = Release|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Release|x64.Build.0 = Release|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Release|x86.ActiveCfg = Release|Any CPU
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364}.Release|x86.Build.0 = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Debug|Any CPU.Build.0 = Debug|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Debug|x64.ActiveCfg = Debug|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Debug|x64.Build.0 = Debug|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Debug|x86.ActiveCfg = Debug|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Debug|x86.Build.0 = Debug|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|Any CPU.ActiveCfg = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|Any CPU.Build.0 = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|x64.ActiveCfg = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|x64.Build.0 = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|x86.ActiveCfg = Release|Any CPU
{240B57C5-5B97-473C-8B79-D3E440755402}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -174,6 +216,9 @@ Global
{B92960AA-D96E-464D-BF62-76BA6D440995} = {7A01F5CB-2378-473E-AF22-69ED318A6235}
{72114486-2563-4AF6-B40C-515A21B04754} = {7A01F5CB-2378-473E-AF22-69ED318A6235}
{23EB17A2-9A46-4D3E-A471-1952430CDA26} = {7A01F5CB-2378-473E-AF22-69ED318A6235}
{7835C453-B4A0-45C4-BDB8-7888D26561FC} = {7A01F5CB-2378-473E-AF22-69ED318A6235}
{E28EC7F7-29A2-4BAD-8C86-95DFE0FBE364} = {05D6D17C-DFCC-4E76-AE07-0F22FD38F3B7}
{240B57C5-5B97-473C-8B79-D3E440755402} = {AFE9D936-9C76-46D3-85DB-DB68EAD8B353}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8F143A32-2D24-488F-AD4C-CD6D074641C6}
Expand Down
Loading

0 comments on commit b87bc92

Please sign in to comment.