Skip to content

Commit

Permalink
Versão 9.8.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipePS committed Jun 18, 2023
1 parent 4b47c5d commit e957fde
Show file tree
Hide file tree
Showing 9 changed files with 40 additions and 31 deletions.
2 changes: 1 addition & 1 deletion dist/chromium/updates.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='bolggfoncklhniejomgplkjcllmnonbh'>
<updatecheck codebase='https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.0.3/TWP_9.8.0.3_Chromium.crx' version='9.8.0.3' status='ok' />
<updatecheck codebase='https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.1.0/TWP_9.8.1.0_Chromium.crx' version='9.8.1.0' status='ok' />
</app>
</gupdate>
4 changes: 2 additions & 2 deletions dist/firefox/updates.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"{036a55b4-5e72-4d05-a06c-cba2dfcc134a}": {
"updates": [
{
"version": "9.8.0.3",
"version": "9.8.1.10",
"browser_specific_settings": {
"gecko": { "strict_min_version": "64.0" }
},
"update_link": "https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.0.3/TWP_9.8.0.3_Firefox.xpi"
"update_link": "https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.1.10/TWP_9.8.1.10_Firefox.xpi"
}
]
}
Expand Down
6 changes: 3 additions & 3 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Translate your page in real time using Google or Yandex.
- Or follow [this tutorial](https://www.ghacks.net/2020/10/01/you-can-now-install-any-add-on-in-firefox-nightly-for-android-but-it-is-complicated/) and install **TWP** on **Firefox Nightly**.

### Vivaldi, Opera, Maxthon, Chromium and Yandex
1. Download this CRX file [TWP_Chromium.crx](https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.0.3/TWP_9.8.0.3_Chromium.crx)
1. Download this CRX file [TWP_Chromium.crx](https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.1.0/TWP_9.8.1.0_Chromium.crx)
2. Open your browser's extension manager, you can find it at this link: `chrome://extensions`
3. Activate developer mode
4. Reload the extension manager page to avoid errors
Expand All @@ -26,7 +26,7 @@ Translate your page in real time using Google or Yandex.
7. Note 2: In Yandex you need to reactivate the extension every time you open the browser

### Chrome, Edge and Brave (With folder without auto update)
1. Download and extract this ZIP file [TWP_Chromium.zip](https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.0.3/TWP_9.8.0.3_Chromium.zip)
1. Download and extract this ZIP file [TWP_Chromium.zip](https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.1.0/TWP_9.8.1.0_Chromium.zip)
2. Open your browser's extension manager, you can find it at this link: `chrome://extensions`
3. Activate developer mode
4. Reload the extension manager page to avoid errors
Expand All @@ -37,7 +37,7 @@ Translate your page in real time using Google or Yandex.

1. Download this and run this file [twp-registry-install.reg](https://raw.githubusercontent.com/FilipePS/Traduzir-paginas-web/master/dist/chromium/twp-registry-install.reg). It edit the necessary windows registries
2. Close your browser and reopen it
3. Download this CRX file [TWP_Chromium.crx](https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.0.3/TWP_9.8.0.3_Chromium.crx)
3. Download this CRX file [TWP_Chromium.crx](https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.1.0/TWP_9.8.1.0_Chromium.crx)
4. Open your browser's extension manager, you can find it at this link: `chrome://extensions`
5. Activate developer mode
6. Reload the extension manager page to avoid errors
Expand Down
33 changes: 11 additions & 22 deletions src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,31 +131,20 @@ function updateContextMenu(pageLanguageState = "original") {
id: "translate-web-page",
title: contextMenuTitle,
contexts: ["page", "frame"],
documentUrlPatterns: ["http://*/*", "https://*/*", "file://*/*", "ftp://*/*"],
documentUrlPatterns: [
"http://*/*",
"https://*/*",
"file://*/*",
"ftp://*/*",
],
});
}
}
}

twpConfig.onReady(function () {
if (platformInfo.isMobile.any) return;
if (twpConfig.get("showReleaseNotes") !== "yes") return;
if (localStorage.getItem("v98hasshowedreleasenotes")) return;
if (twpConfig.get("v98hasshowedreleasenotes")) return;
setTimeout(() => {
tabsCreate(chrome.runtime.getURL("/options/options.html#release_notes"));
}, 2000);
localStorage.setItem("v98hasshowedreleasenotes", "yes");
twpConfig.set("v98hasshowedreleasenotes", "yes");
});

twpConfig.onReady(async () => {
translationCache.deleteTranslationCache();
});

chrome.runtime.onInstalled.addListener((details) => {
if (details.reason == "install") {
// tabsCreate(chrome.runtime.getURL("/options/options.html"));
tabsCreate(chrome.runtime.getURL("/options/options.html"));
twpConfig.onReady(async () => {
if (chrome.i18n.getUILanguage() === "zh-CN") {
twpConfig.set("pageTranslatorService", "bing");
Expand Down Expand Up @@ -198,9 +187,9 @@ chrome.runtime.onInstalled.addListener((details) => {
// );
// }
// });
// twpConfig.onReady(async () => {
// translationCache.deleteTranslationCache();
// });
twpConfig.onReady(async () => {
translationCache.deleteTranslationCache();
});
}

twpConfig.onReady(async () => {
Expand Down Expand Up @@ -1045,7 +1034,7 @@ chrome.runtime.onUpdateAvailable.addListener((details) => {
reloaded = true;
chrome.runtime.reload();
}
}, 2500);
}, 2200);

chrome.tabs.query({}, (tabs) => {
const cleanUpsPromises = [];
Expand Down
2 changes: 1 addition & 1 deletion src/chrome_manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "TWP - Translate Web Pages",
"description": "__MSG_extensionDescription__",
"version": "9.8.0.4",
"version": "9.8.1.0",
"homepage_url": "https://github.com/FilipePS/Traduzir-paginas-web",
"update_url": "https://raw.githubusercontent.com/FilipePS/Traduzir-paginas-web/master/dist/chromium/updates.xml",
"minimum_chrome_version": "70.0",
Expand Down
1 change: 1 addition & 0 deletions src/contentScript/pageTranslator.js
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ Promise.all([twpConfig.onReady(), getTabHostName()]).then(function (_) {
}
}

// https://github.com/FilipePS/Traduzir-paginas-web/issues/609
if (twpConfig.get("translateTag_pre") !== "yes" && !(document.body.childElementCount === 1 && document.body.firstChild.nodeName.toLocaleLowerCase() === "pre")) {
htmlTagsInlineIgnore.push("pre");
}
Expand Down
2 changes: 1 addition & 1 deletion src/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"default_locale": "en",
"name": "TWP - Translate Web Pages",
"description": "__MSG_extensionDescription__",
"version": "9.8.0.4",
"version": "9.8.1.0",
"homepage_url": "https://github.com/FilipePS/Traduzir-paginas-web",
"browser_specific_settings": {
"gecko": {
Expand Down
19 changes: 19 additions & 0 deletions src/options/release-notes/en.html
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,25 @@
</div>
</section>

<section>
<h4>9.8.1 - June 18, 2023</h4>
<ul>
<li>Changes
<ul>
<li>For custom dictionaries, adapt to the official Bing API</li>
<li>Now the button to switch between translation services also appears in the <i>simple interface</i> when the site is translated</li>
</ul>
</li>
<li>Fixed
<ul>
<li><b>Copy</b> button does not appear when translating selected text from inputs</li>
<li>Translate button in context menu does not appear in local files</li>
<li>Text files are not translated if <b>&lt;pre&gt;</b> tag translation is disabled</li>
</ul>
</li>
<li>Update interface translations</li>
</ul>
</section>
<section>
<h4>9.8 - June 1, 2023</h4>
<ul>
Expand Down
2 changes: 1 addition & 1 deletion updates.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version='1.0' encoding='UTF-8'?>
<gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
<app appid='bolggfoncklhniejomgplkjcllmnonbh'>
<updatecheck codebase='https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.0.3/TWP_9.8.0.3_Chromium.crx' version='9.8.0.3' status='ok' />
<updatecheck codebase='https://github.com/FilipePS/Traduzir-paginas-web/releases/download/v9.8.1.0/TWP_9.8.1.0_Chromium.crx' version='9.8.1.0' status='ok' />
</app>
</gupdate>

0 comments on commit e957fde

Please sign in to comment.