From 84986e4eefbcd501b48e17d9d545599ed5a6a39f Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Fri, 20 Oct 2023 19:27:15 +0200 Subject: [PATCH 1/7] try the generalized version of a language code before resorting to the default language (es-US -> es) --- public/scripts/localization.js | 8 +++++++- public_included_ws_fallback/scripts/localization.js | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/public/scripts/localization.js b/public/scripts/localization.js index 8fd7942..62b11aa 100644 --- a/public/scripts/localization.js +++ b/public/scripts/localization.js @@ -31,7 +31,13 @@ class Localization { } static getSupportedOrDefault(locales) { - return locales.find(Localization.isSupported) || Localization.defaultLocale; + let localesGeneric = locales + .map(locale => locale.split("-")[0]) + .filter(locale => locales.indexOf(locale) === -1); + + return locales.find(Localization.isSupported) + || localesGeneric.find(Localization.isSupported) + || Localization.defaultLocale; } static async setTranslation(locale) { diff --git a/public_included_ws_fallback/scripts/localization.js b/public_included_ws_fallback/scripts/localization.js index 8fd7942..62b11aa 100644 --- a/public_included_ws_fallback/scripts/localization.js +++ b/public_included_ws_fallback/scripts/localization.js @@ -31,7 +31,13 @@ class Localization { } static getSupportedOrDefault(locales) { - return locales.find(Localization.isSupported) || Localization.defaultLocale; + let localesGeneric = locales + .map(locale => locale.split("-")[0]) + .filter(locale => locales.indexOf(locale) === -1); + + return locales.find(Localization.isSupported) + || localesGeneric.find(Localization.isSupported) + || Localization.defaultLocale; } static async setTranslation(locale) { From 46f33f894bee599f2874a2e420f4f9a7080be667 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Fri, 20 Oct 2023 20:24:53 +0200 Subject: [PATCH 2/7] increase version to v1.9.3 --- .github/ISSUE_TEMPLATE/bug-report.md | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- public/index.html | 2 +- public/service-worker.js | 2 +- public_included_ws_fallback/index.html | 2 +- public_included_ws_fallback/service-worker.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index b493298..80b5971 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -36,7 +36,7 @@ If applicable, add screenshots to help explain your problem. **Bug occurs on official PairDrop instance https://pairdrop.net/** No | Yes -Version: v1.9.2 +Version: v1.9.3 **Bug occurs on self-hosted PairDrop instance** No | Yes @@ -44,7 +44,7 @@ No | Yes **Self-Hosted Setup** Proxy: Nginx | Apache2 Deployment: docker run | docker-compose | npm run start:prod -Version: v1.9.2 +Version: v1.9.3 **Additional context** Add any other context about the problem here. diff --git a/package-lock.json b/package-lock.json index 2ceb1f6..8760e7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pairdrop", - "version": "1.9.2", + "version": "1.9.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pairdrop", - "version": "1.9.2", + "version": "1.9.3", "license": "ISC", "dependencies": { "express": "^4.18.2", diff --git a/package.json b/package.json index 24134fe..2aa5304 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pairdrop", - "version": "1.9.2", + "version": "1.9.3", "description": "", "main": "index.js", "scripts": { diff --git a/public/index.html b/public/index.html index d394a17..9b271b4 100644 --- a/public/index.html +++ b/public/index.html @@ -480,7 +480,7 @@

PairDrop

-
v1.9.2
+
v1.9.3
diff --git a/public/service-worker.js b/public/service-worker.js index 2b6701c..e5100d6 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -1,4 +1,4 @@ -const cacheVersion = 'v1.9.2'; +const cacheVersion = 'v1.9.3'; const cacheTitle = `pairdrop-cache-${cacheVersion}`; const forceFetch = false; // FOR DEVELOPMENT: Set to true to always update assets instead of using cached versions const urlsToCache = [ diff --git a/public_included_ws_fallback/index.html b/public_included_ws_fallback/index.html index 031b674..2a980ef 100644 --- a/public_included_ws_fallback/index.html +++ b/public_included_ws_fallback/index.html @@ -485,7 +485,7 @@

PairDrop

-
v1.9.2
+
v1.9.3
diff --git a/public_included_ws_fallback/service-worker.js b/public_included_ws_fallback/service-worker.js index 164513a..3ac7880 100644 --- a/public_included_ws_fallback/service-worker.js +++ b/public_included_ws_fallback/service-worker.js @@ -1,4 +1,4 @@ -const cacheVersion = 'v1.9.2'; +const cacheVersion = 'v1.9.3'; const cacheTitle = `pairdrop-included-ws-fallback-cache-${cacheVersion}`; const forceFetch = false; // FOR DEVELOPMENT: Set to true to always update assets instead of using cached versions const urlsToCache = [ From 9a7e621af6d5d36e8e938572f229bc613eb34b9d Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Fri, 13 Oct 2023 18:15:55 +0200 Subject: [PATCH 3/7] fix ws-fallback. Variable that indicates WebRTC support was always false --- public_included_ws_fallback/scripts/network.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public_included_ws_fallback/scripts/network.js b/public_included_ws_fallback/scripts/network.js index 244248f..6e68035 100644 --- a/public_included_ws_fallback/scripts/network.js +++ b/public_included_ws_fallback/scripts/network.js @@ -1,5 +1,5 @@ window.URL = window.URL || window.webkitURL; -window.isRtcSupported = false; //!!(window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection); +window.isRtcSupported = !!(window.RTCPeerConnection || window.mozRTCPeerConnection || window.webkitRTCPeerConnection); window.hiddenProperty = 'hidden' in document ? 'hidden' : 'webkitHidden' in document ? 'webkitHidden' : From 433373bad127eafa66660b6f473f13540fac5e53 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Mon, 23 Oct 2023 19:39:33 +0200 Subject: [PATCH 4/7] Do not inverse QR-code colors on dark mode to fix readability with some readers and the native camera app on Android (fixes #187) --- public/scripts/ui.js | 12 ++++++------ public_included_ws_fallback/scripts/ui.js | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/public/scripts/ui.js b/public/scripts/ui.js index c124d2b..16c83f5 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -1268,9 +1268,9 @@ class PairDeviceDialog extends Dialog { content: this._getPairUrl(), width: 150, height: 150, - padding: 0, - background: "transparent", - color: `rgb(var(--text-color))`, + padding: 1, + background: 'rgb(238,238,238)', + color: 'rgb(18, 18, 18)', ecl: "L", join: true }); @@ -1619,9 +1619,9 @@ class PublicRoomDialog extends Dialog { content: this._getShareRoomUrl(), width: 150, height: 150, - padding: 0, - background: "transparent", - color: `rgb(var(--text-color))`, + padding: 1, + background: 'rgb(238,238,238)', + color: 'rgb(18, 18, 18)', ecl: "L", join: true }); diff --git a/public_included_ws_fallback/scripts/ui.js b/public_included_ws_fallback/scripts/ui.js index 1346f67..cff8931 100644 --- a/public_included_ws_fallback/scripts/ui.js +++ b/public_included_ws_fallback/scripts/ui.js @@ -1270,9 +1270,9 @@ class PairDeviceDialog extends Dialog { content: this._getPairUrl(), width: 150, height: 150, - padding: 0, - background: "transparent", - color: `rgb(var(--text-color))`, + padding: 1, + background: 'rgb(238,238,238)', + color: 'rgb(18, 18, 18)', ecl: "L", join: true }); @@ -1621,9 +1621,9 @@ class PublicRoomDialog extends Dialog { content: this._getShareRoomUrl(), width: 150, height: 150, - padding: 0, - background: "transparent", - color: `rgb(var(--text-color))`, + padding: 1, + background: 'rgb(238,238,238)', + color: 'rgb(18, 18, 18)', ecl: "L", join: true }); From 86e0d97afbbd2334b794f94751d6b64af5b9cea7 Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Mon, 23 Oct 2023 19:46:20 +0200 Subject: [PATCH 5/7] increase version to v1.9.4 --- .github/ISSUE_TEMPLATE/bug-report.md | 4 ++-- package-lock.json | 4 ++-- package.json | 2 +- public/index.html | 2 +- public/service-worker.js | 2 +- public_included_ws_fallback/index.html | 2 +- public_included_ws_fallback/service-worker.js | 2 +- 7 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug-report.md b/.github/ISSUE_TEMPLATE/bug-report.md index 80b5971..40b424b 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.md +++ b/.github/ISSUE_TEMPLATE/bug-report.md @@ -36,7 +36,7 @@ If applicable, add screenshots to help explain your problem. **Bug occurs on official PairDrop instance https://pairdrop.net/** No | Yes -Version: v1.9.3 +Version: v1.9.4 **Bug occurs on self-hosted PairDrop instance** No | Yes @@ -44,7 +44,7 @@ No | Yes **Self-Hosted Setup** Proxy: Nginx | Apache2 Deployment: docker run | docker-compose | npm run start:prod -Version: v1.9.3 +Version: v1.9.4 **Additional context** Add any other context about the problem here. diff --git a/package-lock.json b/package-lock.json index 8760e7d..bac58c8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "pairdrop", - "version": "1.9.3", + "version": "1.9.4", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "pairdrop", - "version": "1.9.3", + "version": "1.9.4", "license": "ISC", "dependencies": { "express": "^4.18.2", diff --git a/package.json b/package.json index 2aa5304..ac41c5e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pairdrop", - "version": "1.9.3", + "version": "1.9.4", "description": "", "main": "index.js", "scripts": { diff --git a/public/index.html b/public/index.html index 9b271b4..1cdbf57 100644 --- a/public/index.html +++ b/public/index.html @@ -480,7 +480,7 @@

PairDrop

-
v1.9.3
+
v1.9.4
diff --git a/public/service-worker.js b/public/service-worker.js index e5100d6..f84d49d 100644 --- a/public/service-worker.js +++ b/public/service-worker.js @@ -1,4 +1,4 @@ -const cacheVersion = 'v1.9.3'; +const cacheVersion = 'v1.9.4'; const cacheTitle = `pairdrop-cache-${cacheVersion}`; const forceFetch = false; // FOR DEVELOPMENT: Set to true to always update assets instead of using cached versions const urlsToCache = [ diff --git a/public_included_ws_fallback/index.html b/public_included_ws_fallback/index.html index 2a980ef..fd2dbb3 100644 --- a/public_included_ws_fallback/index.html +++ b/public_included_ws_fallback/index.html @@ -485,7 +485,7 @@

PairDrop

-
v1.9.3
+
v1.9.4
diff --git a/public_included_ws_fallback/service-worker.js b/public_included_ws_fallback/service-worker.js index 3ac7880..1de3973 100644 --- a/public_included_ws_fallback/service-worker.js +++ b/public_included_ws_fallback/service-worker.js @@ -1,4 +1,4 @@ -const cacheVersion = 'v1.9.3'; +const cacheVersion = 'v1.9.4'; const cacheTitle = `pairdrop-included-ws-fallback-cache-${cacheVersion}`; const forceFetch = false; // FOR DEVELOPMENT: Set to true to always update assets instead of using cached versions const urlsToCache = [ From b4e74c2dd12c9aaa6c6708f2a4a1ab129885727a Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Tue, 24 Oct 2023 17:57:21 +0200 Subject: [PATCH 6/7] fix QR-code background color on light theme --- public/scripts/ui.js | 4 ++-- public_included_ws_fallback/scripts/ui.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/scripts/ui.js b/public/scripts/ui.js index 16c83f5..089d687 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -1269,7 +1269,7 @@ class PairDeviceDialog extends Dialog { width: 150, height: 150, padding: 1, - background: 'rgb(238,238,238)', + background: 'rgb(250,250,250)', color: 'rgb(18, 18, 18)', ecl: "L", join: true @@ -1620,7 +1620,7 @@ class PublicRoomDialog extends Dialog { width: 150, height: 150, padding: 1, - background: 'rgb(238,238,238)', + background: 'rgb(250,250,250)', color: 'rgb(18, 18, 18)', ecl: "L", join: true diff --git a/public_included_ws_fallback/scripts/ui.js b/public_included_ws_fallback/scripts/ui.js index cff8931..9fe21c7 100644 --- a/public_included_ws_fallback/scripts/ui.js +++ b/public_included_ws_fallback/scripts/ui.js @@ -1271,7 +1271,7 @@ class PairDeviceDialog extends Dialog { width: 150, height: 150, padding: 1, - background: 'rgb(238,238,238)', + background: 'rgb(250,250,250)', color: 'rgb(18, 18, 18)', ecl: "L", join: true @@ -1622,7 +1622,7 @@ class PublicRoomDialog extends Dialog { width: 150, height: 150, padding: 1, - background: 'rgb(238,238,238)', + background: 'rgb(250,250,250)', color: 'rgb(18, 18, 18)', ecl: "L", join: true From 1e5bae6c21d0b5e0617a0994c90c52a57f313d85 Mon Sep 17 00:00:00 2001 From: Luiz Fernando Date: Thu, 16 Nov 2023 15:02:13 -0300 Subject: [PATCH 7/7] add Brazilian Portuguese translate --- public/index.html | 5 + public/lang/pt-BR.json | 165 ++++++++++++++++++ public/scripts/localization.js | 2 +- public_included_ws_fallback/index.html | 5 + public_included_ws_fallback/lang/pt-BR.json | 165 ++++++++++++++++++ .../scripts/localization.js | 2 +- 6 files changed, 342 insertions(+), 2 deletions(-) create mode 100644 public/lang/pt-BR.json create mode 100644 public_included_ws_fallback/lang/pt-BR.json diff --git a/public/index.html b/public/index.html index 9f6504b..96d157d 100644 --- a/public/index.html +++ b/public/index.html @@ -186,6 +186,11 @@ - (Norwegian) + +