Skip to content

Commit

Permalink
Merge pull request #1007 from ilyhalight/dev
Browse files Browse the repository at this point in the history
Update 1.8.4
  • Loading branch information
ilyhalight authored Dec 30, 2024
2 parents 0a1155a + d715e7a commit 54f65c8
Show file tree
Hide file tree
Showing 71 changed files with 3,371 additions and 3,257 deletions.
Binary file modified bun.lockb
Binary file not shown.
6 changes: 6 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
<!-- Придумать как нормально реализовать отображение кнопки в Google Drive -->
<!-- - Исправлена работа Google Drive (#888, #883, #912) -->

# 1.8.4

- Добавлена кнопка "Сообщить об ошибке" в меню расширения
- Исправлена ошибка из-за которой кнопка перевода могла не пропадать на мобильных устройствах (#1005)
- Исправлена ошибка из-за которой в некоторых случаях нельзя было свайпнуть экран при воспроизведение видео на мобильных устройствах (#1006)

# 1.8.3

- Исправлена ошибка из-за которой кнопка могла не появляться без переустановки расширения (#995, #997)
Expand Down
34 changes: 17 additions & 17 deletions dist/vot-min.user.js

Large diffs are not rendered by default.

6,214 changes: 3,118 additions & 3,096 deletions dist/vot.user.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"oxlint": "^0.11.1",
"patch-package": "^8.0.0",
"postinstall-postinstall": "^2.1.0",
"prettier": "3.4.2",
"sass": "^1.81.0",
"ts-loader": "^9.5.1",
"typescript": "^5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion src/headers.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "[VOT] - Voice Over Translation",
"description": "A small extension that adds a Yandex Browser video translation to other browsers",
"version": "1.8.3",
"version": "1.8.4",
"author": "sodapng, mynovelhost, Toil, SashaXser, MrSoczekXD",
"namespace": "vot",
"icon": "https://translate.yandex.ru/icons/favicon.ico",
Expand Down
59 changes: 41 additions & 18 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,14 @@ import {
import { convertSubs } from "@vot.js/shared/utils/subs";
import { svg, html } from "lit-html";
import { ID3Writer } from "browser-id3-writer";
import Chaimu, { initAudioContext } from "chaimu";

import {
defaultAutoVolume,
defaultDetectService,
defaultTranslationService,
m3u8ProxyHost,
repositoryUrl,
proxyWorkerHost,
maxAudioVolume,
minLongWaitingCount,
Expand Down Expand Up @@ -56,7 +58,6 @@ import {
translate,
translateServices,
} from "./utils/translateApis.ts";
import Chaimu, { initAudioContext } from "chaimu";

const browserInfo = Bowser.getParser(window.navigator.userAgent).getResult();

Expand Down Expand Up @@ -218,11 +219,10 @@ class VideoHandler {
return res;
}

const message =
res.message ?? localizationProvider.get("translationTakeFewMinutes");
await this.updateTranslationErrorMsg(
res.remainingTime > 0
? secsToStrTime(res.remainingTime)
: res.message ??
localizationProvider.get("translationTakeFewMinutes"),
res.remainingTime > 0 ? secsToStrTime(res.remainingTime) : message,
);
} catch (err) {
console.error("[VOT] Failed to translate video", err);
Expand Down Expand Up @@ -1101,6 +1101,11 @@ class VideoHandler {
this.votLocaleInfo.container,
);

this.votBugReportButton = ui.createOutlinedButton(
localizationProvider.get("VOTBugReport"),
);
this.votSettingsDialog.bodyContainer.appendChild(this.votBugReportButton);

this.votUpdateLocaleFilesButton = ui.createOutlinedButton(
localizationProvider.get("VOTUpdateLocaleFiles"),
);
Expand Down Expand Up @@ -1209,11 +1214,13 @@ class VideoHandler {

// Drag event handler
const handleDragMove = async (
event,
clientX,
rect = this.container.getBoundingClientRect(),
) => {
if (!this.dragging) return;

event.preventDefault();
const x = rect ? clientX - rect.left : clientX;
const percentX =
(x / (rect ? rect.width : this.container.clientWidth)) * 100;
Expand All @@ -1230,10 +1237,9 @@ class VideoHandler {
"pointerup",
() => (this.dragging = false),
);
this.container.addEventListener("pointermove", (e) => {
e.preventDefault();
handleDragMove(e.clientX);
});
this.container.addEventListener("pointermove", (e) =>
handleDragMove(e, e.clientX),
);

// Touch events
this.votButton.container.addEventListener(
Expand All @@ -1252,8 +1258,8 @@ class VideoHandler {
this.container.addEventListener(
"touchmove",
(e) => {
e.preventDefault();
handleDragMove(
e,
e.touches[0].clientX,
this.container.getBoundingClientRect(),
);
Expand Down Expand Up @@ -1710,9 +1716,7 @@ class VideoHandler {
"showPiPButton value changed. New value: ",
this.data.showPiPButton,
);
this.votButton.pipButton.hidden =
!isPiPAvailable() || !this.data.showPiPButton;
this.votButton.separator2.hidden =
this.votButton.pipButton.hidden = this.votButton.separator2.hidden =
!isPiPAvailable() || !this.data.showPiPButton;
})();
});
Expand Down Expand Up @@ -1780,6 +1784,11 @@ class VideoHandler {
})();
});

this.votBugReportButton.addEventListener("click", () => {
const params = new URLSearchParams(this.collectReportInfo()).toString();
window.open(`${repositoryUrl}/issues/new?${params}`, "_blank").focus();
});

this.votUpdateLocaleFilesButton.addEventListener("click", () => {
(async () => {
await votStorage.set("locale-hash", "");
Expand All @@ -1804,6 +1813,24 @@ class VideoHandler {
}
}

collectReportInfo() {
const os = `${browserInfo.os.name} ${browserInfo.os.version}`;
const additionalInfo = `Autogenerated by VOT:
- OS: ${os}
- Browser: ${browserInfo.browser.name} ${browserInfo.browser.version}
- Loader: ${GM_info.scriptHandler} v${GM_info.version}
- Script version: ${GM_info.script.version}
- URL: \`${window.location.href}\``;

return {
assignees: "ilyhalight",
template: "bug.yml",
os,
"script-version": GM_info.script.version,
"additional-info": additionalInfo,
};
}

releaseExtraEvents() {
this.abortController.abort();
this.resizeObserver?.disconnect();
Expand Down Expand Up @@ -1981,11 +2008,7 @@ class VideoHandler {
);
// remove listener on xvideos to fix #866
if (this.site.host !== "xvideos") {
addExtraEventListeners(
document,
["touchstart", "touchmove", "touchend"],
this.changeOpacityOnEvent,
);
addExtraEventListener(document, "touchmove", this.resetTimer);
}

// fix youtube hold to fast
Expand Down
124 changes: 62 additions & 62 deletions src/localization/hashes.json
Original file line number Diff line number Diff line change
@@ -1,64 +1,64 @@
{
"af": "4e5f70449c70d512f6e3ea62c7c4056d",
"am": "c56f7191e4285de7f24daae32a9dd887",
"ar": "1d96d8c9294794726134c9543a0b23d4",
"az": "d070a59598e803fdda1a691c1f8362bb",
"bg": "3a0b479f795cf54739fee4a7434820e9",
"bn": "82a0f7ba6567a4e324be8f0d57e6a715",
"bs": "047c376469d7742ba23e2ab4aca7a98a",
"ca": "929630475388217babb63157ee938bea",
"cs": "e9ac170982657326421486e80b96996d",
"cy": "0b32acc323270269ef70121807088291",
"da": "e8ce497815be210c703f4f6a24a870f8",
"de": "b1ea20ebb8596a31cff6f86c4c03caef",
"el": "53df97c3a2327a0b2fd99a369487fecc",
"en": "b2e8cb02369ff8ef2bbb6cc487b3e3d9",
"es": "270b48330461edda3471447ce312d909",
"et": "36993d457bbda40ab2610159ebb50015",
"eu": "522b0c4636f938376bea2cf8acd8ee4d",
"fa": "61a10fc26edcf9f74efd80877d80c7a7",
"fi": "fbfb4df552259797928036568350d759",
"fr": "a88bfd8063b19034a284bb77fe88f032",
"gl": "58f47362be5b7482ce84ef6dfd5c9646",
"hi": "d9ad38c8e4960a4a2c28b8cf69692e38",
"hr": "31c500c8d70dde07c4e7474e56358cf9",
"hu": "0ed0470a7512c6292935d165a9cc9295",
"hy": "1f447bc565feb745661bfbe3c84ab72f",
"id": "067a57adaa0b09d81703709086fe8857",
"it": "dc8f2be92fbba3d16348492c19756c1e",
"ja": "0835e0900fa34290885cc4caab480980",
"jv": "b251277f3a9af1165366d13e9078e412",
"kk": "7374a5244c804a0de0e25a30b26b32c7",
"km": "995a7c1a92f3155d785f38ac359a2305",
"kn": "33d0242bb0453821144c89255ba1e0d1",
"ko": "147e04f7829f2ea81e6ae00f42952c51",
"lo": "7bc987496744926ac98b2081be9edb40",
"mk": "0fe49a0f8a2978320b17c8990bafe492",
"ml": "afe6996b88097f8b5d0f8465849524b9",
"mn": "9f7ea189782ca6b55099f79b0971b62d",
"ms": "fbb6942e76402b2d497cd5a32e1c27d8",
"mt": "b75c3142222c22cf175acfc2e51cd9d9",
"my": "70d88930c733f6f8fd21e88614b0bb27",
"ne": "6f8acef972963068b684a88d418546ac",
"nl": "429517f559183c95f9859fbadf5ca8a9",
"pa": "ffd474d2e68f4c90b60c0a6f1f27b58b",
"pl": "e2961d6c0ff27510b58040654b967cf7",
"pt": "d1ec1de7a6cde7a5a90661c3fe977e26",
"ro": "2f1abd15bc1d2414293c58c37c400d2a",
"ru": "e414382904165de05b6ab4ba9765e5ca",
"si": "f40acf30b26df30c1dc1afeac33b8bda",
"sk": "8469a509a8bd410df330f314e62c147c",
"sl": "3981951d373be7bb2d2526b0889662c4",
"sq": "8789b604a69f70f793b5265c414870a5",
"sr": "04986d9e720621e7d36c6b82e7065166",
"su": "494111a055e45c59d178b486674894ec",
"sv": "15a111c3c831aa2d1c96fc1f467d01cd",
"sw": "1bc14292bf4b674ee299c34abb3a658c",
"tr": "9cd14b6270ac147ca20b8470a55f275a",
"uk": "ead2bdf7a68d73804ba163e56790cfa5",
"ur": "264fa60fde66357b2af93d59b62d3c00",
"uz": "0bd102f40867d0ba66b19462119013cb",
"vi": "dd4208dde3c968beb0bedfe725517966",
"zh": "3c695d155bf64dd7709a8ca219676428",
"zu": "94119b8c887251a9ad2dc5e7747129fe"
"af": "be62a5edf04a111c1a6ac8c0b4ef6727",
"am": "7481188a0d953d1ccc0fbe25181cbdc3",
"ar": "e4daa7cbd5ba4b5e14b68248aad5e7c0",
"az": "47aa19dff6e58f756f6b3653a18fd952",
"bg": "30f236e34b450ea24e9b9f702e08440d",
"bn": "c1d81d3afac6977d1acf263ba5ea1116",
"bs": "6b2cca3ab748bfae89e32414a0b62d15",
"ca": "c0a49af5f7b115e80f8e6266f50ee954",
"cs": "84d8ececa8a80a6350a66deea72111ad",
"cy": "6c5c5f57f1e9d8ca55e847173039f666",
"da": "7841fe2dcb2de40eb6b199f84f1f3d8e",
"de": "ef9873af15eff7b2ec9e720bfe31da93",
"el": "d6fc48d4e79d2d817ef6fd9170fb7c7b",
"en": "93cdc28ca3309cd0e4accdbc6987a7a4",
"es": "d9194d94eb1b07f664d52dfbeac01ef0",
"et": "119f612359fed7013ee22aba34039aac",
"eu": "34b3e81dd53350d3485a40b03570d18e",
"fa": "d6a9030090cd19eb0d7e1477b7e8f378",
"fi": "aea1e3b2a1604c3f60814e9ead9acb8e",
"fr": "ad37da595a4c3510526c20cf8967c11e",
"gl": "1589c2abd57f165dbe3c80096f6bc627",
"hi": "9ae19960d07d46ceba367a677d792efd",
"hr": "5c9567f98db23a2dce730c0e555cb34a",
"hu": "f0098fd50b6733035cf6a1da9de8cbc9",
"hy": "69dc46a38fbe804dc61f9bab2a73e0fc",
"id": "d032618fa522fe911ea085fe11fa103f",
"it": "b148172a6af58cdababd0649f0b49a9a",
"ja": "61efbc0fddb3b08fb453252e6b9cec6d",
"jv": "4fcfd295a7c45f508518f7f8d2b2aca9",
"kk": "8d25ccfecde3159bf3d3f217dbe04ed1",
"km": "62f4faa415b45f57d810f05bb2e61973",
"kn": "290ed45d278b648d27dc790333118f51",
"ko": "490bfb4b3fb7c0047c2640cba702a139",
"lo": "f7d4ad17775ade15ba8f53ea5f0e7814",
"mk": "37e4e56d631e6d6e654b02e16f793ddd",
"ml": "bb91d553e05cddf678846a9d87daee81",
"mn": "95417f5a2caac485289335c443a35e8e",
"ms": "8713ef1cfdf5edb97704b9cc62c0342b",
"mt": "bbd3a60bb3014acf0ba40307a8e07316",
"my": "2121770dfc0bdcecf15afac61c9c5b3e",
"ne": "5deb1c7b959f72adaa58077cfc816da2",
"nl": "30a6391b84d0d160ef4dd1a438f37789",
"pa": "6b8c35f78fbae05a10c1d5d3ee71e859",
"pl": "818e74ec77f268c278152ea3c8ef5de8",
"pt": "7c7711e11e638bb7b14a4eea9f48d5b5",
"ro": "cf709a3ce5ac837f70c70826a4f7ab00",
"ru": "a21636dc154aafc576056298fce14ddc",
"si": "a0283c3f2dfee8b7c3a49c476ec55766",
"sk": "0c8d1893d59c32f203eee30534bc1413",
"sl": "0a0a45735de61ce886b6392035b9512e",
"sq": "9f668cd6f6819582549e5c92ea9f0edc",
"sr": "bf9985444df5e1e2acbc59f3b8ac2508",
"su": "e12fcd92e3ac912ec255e37c245504fe",
"sv": "c19e03cdbdab2d64b4890c491fe2d630",
"sw": "3bea97a08bf38f27512751941fb0b9ea",
"tr": "9073b0f7f9b4f5d34ac08cbc9a3e081f",
"uk": "28263ad970e0e31e6f80627cbf0224d3",
"ur": "36219c85fe3880a4e1bfbbb512aadcbc",
"uz": "43cd933f0422cfbca6ab36bc83db2e64",
"vi": "2076de29638e226195faaa2b2159ab6e",
"zh": "90dfb0ef50986ab75089759d238aa16c",
"zu": "686f762b4722c902a087c2ab950fea45"
}
3 changes: 2 additions & 1 deletion src/localization/locales/af.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Fout vertaling diens",
"TranslationDelayed": "Die vertaling is effens vertraag",
"VOTTranslationCompletedNotify": "Die vertaling op die {0} is voltooi!",
"VOTSendNotifyOnComplete": "Stuur'n kennisgewing dat die video vertaal is"
"VOTSendNotifyOnComplete": "Stuur'n kennisgewing dat die video vertaal is",
"VOTBugReport": "Rapporteer'n fout"
}
3 changes: 2 additions & 1 deletion src/localization/locales/am.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "የስህተት ትርጉም አገልግሎት",
"TranslationDelayed": "ትርጉሙ ትንሽ ዘግይቷል",
"VOTTranslationCompletedNotify": "በ {0} ላይ ያለው ትርጉም ተጠናቅቋል!",
"VOTSendNotifyOnComplete": "ቪዲዮው የተተረጎመ መሆኑን ማሳወቂያ ይላኩ"
"VOTSendNotifyOnComplete": "ቪዲዮው የተተረጎመ መሆኑን ማሳወቂያ ይላኩ",
"VOTBugReport": "ሳንካ ሪፖርት ያድርጉ"
}
3 changes: 2 additions & 1 deletion src/localization/locales/ar.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "خدمة ترجمة الأخطاء",
"TranslationDelayed": "الترجمة متأخرة قليلا",
"VOTTranslationCompletedNotify": "تم الانتهاء من الترجمة على {0}!",
"VOTSendNotifyOnComplete": "إرسال إشعار بأن الفيديو قد تمت ترجمته"
"VOTSendNotifyOnComplete": "إرسال إشعار بأن الفيديو قد تمت ترجمته",
"VOTBugReport": "الإبلاغ عن خطأ"
}
3 changes: 2 additions & 1 deletion src/localization/locales/az.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Səhv tərcümə xidməti",
"TranslationDelayed": "Tərcümə bir az gecikir",
"VOTTranslationCompletedNotify": "Tərcümə {0} tamamlandı!",
"VOTSendNotifyOnComplete": "Videonun tərcümə olunduğunu bildirən bildiriş göndərin"
"VOTSendNotifyOnComplete": "Videonun tərcümə olunduğunu bildirən bildiriş göndərin",
"VOTBugReport": "Səhv bildirin"
}
3 changes: 2 additions & 1 deletion src/localization/locales/bg.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Услуга за превод на грешки",
"TranslationDelayed": "Преводът леко закъснява.",
"VOTTranslationCompletedNotify": "Преводът на {0} е завършен!",
"VOTSendNotifyOnComplete": "Изпратете съобщение, че видеото е преведено"
"VOTSendNotifyOnComplete": "Изпратете съобщение, че видеото е преведено",
"VOTBugReport": "Съобщете за грешка"
}
3 changes: 2 additions & 1 deletion src/localization/locales/bn.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "ত্রুটি অনুবাদ পরিষেবা",
"TranslationDelayed": "অনুবাদ সামান্য বিলম্বিত হয়",
"VOTTranslationCompletedNotify": "{0} এর অনুবাদ সম্পন্ন হয়েছে!",
"VOTSendNotifyOnComplete": "একটি বিজ্ঞপ্তি পাঠান যে ভিডিওটি অনুবাদ করা হয়েছে"
"VOTSendNotifyOnComplete": "একটি বিজ্ঞপ্তি পাঠান যে ভিডিওটি অনুবাদ করা হয়েছে",
"VOTBugReport": "একটি বাগ রিপোর্ট করুন"
}
3 changes: 2 additions & 1 deletion src/localization/locales/bs.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Usluga prevođenja grešaka",
"TranslationDelayed": "Prevod je malo odložen",
"VOTTranslationCompletedNotify": "Prevod na {0} je završen!",
"VOTSendNotifyOnComplete": "Pošaljite obavještenje da je video preveden"
"VOTSendNotifyOnComplete": "Pošaljite obavještenje da je video preveden",
"VOTBugReport": "Prijavi grešku"
}
3 changes: 2 additions & 1 deletion src/localization/locales/ca.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Servei de traducció d'errors",
"TranslationDelayed": "La traducció es retarda lleugerament",
"VOTTranslationCompletedNotify": "La traducció al {0} s'ha completat!",
"VOTSendNotifyOnComplete": "Envia una notificació que el vídeo ha estat traduït"
"VOTSendNotifyOnComplete": "Envia una notificació que el vídeo ha estat traduït",
"VOTBugReport": "Informa d ' un error"
}
3 changes: 2 additions & 1 deletion src/localization/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Chybová překladatelská služba",
"TranslationDelayed": "Překlad je mírně zpožděn",
"VOTTranslationCompletedNotify": "Překlad na {0} byl dokončen!",
"VOTSendNotifyOnComplete": "Pošlete oznámení, že video bylo přeloženo"
"VOTSendNotifyOnComplete": "Pošlete oznámení, že video bylo přeloženo",
"VOTBugReport": "Nahlásit chybu"
}
3 changes: 2 additions & 1 deletion src/localization/locales/cy.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Gwasanaeth cyfieithu gwall",
"TranslationDelayed": "Mae'r cyfieithiad ychydig yn oedi",
"VOTTranslationCompletedNotify": "Mae'r cyfieithiad ar y {0} wedi ei gwblhau!",
"VOTSendNotifyOnComplete": "Anfon hysbysiad bod y fideo wedi'i gyfieithu"
"VOTSendNotifyOnComplete": "Anfon hysbysiad bod y fideo wedi'i gyfieithu",
"VOTBugReport": "Rhoi gwybod am nam"
}
3 changes: 2 additions & 1 deletion src/localization/locales/da.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,5 +198,6 @@
"VOTTranslationErrorsService": "Fejl oversættelsestjeneste",
"TranslationDelayed": "Oversættelsen er lidt forsinket",
"VOTTranslationCompletedNotify": "Oversættelsen på {0} er afsluttet!",
"VOTSendNotifyOnComplete": "Send en meddelelse om, at videoen er blevet oversat"
"VOTSendNotifyOnComplete": "Send en meddelelse om, at videoen er blevet oversat",
"VOTBugReport": "Rapporter en fejl"
}
Loading

0 comments on commit 54f65c8

Please sign in to comment.