PWA Plugin Problem
-
Hello,
I want to use the PWA plugin on my website. also the translatepress plugin is already available. (https://www.ads-software.com/plugins/pwa/)
After activating the PWA plugin, it works fine in the default language and the 2nd language I added.
but the problem is that when the language option other than the default language is activated, errors appear in the developer tools section.
I reported this problem to the PWA developer and he shared the following explanation with me:
–
I’m looking at the service worker code and it seems that the translation plugin is corrupting the JavaScript. For example, in the JS file:
const offlinePostRequestHandler = ({ event }) => { return fetch(event.request) .then((response) => { if (response.status < 500) { return response; } // @todo This is duplicated with code in service-worker-navigation-routing.js. return response.text().then(function (errorText) {
This is getting turned into the following in the French version:
const offlinePostRequestHandler = ({ event }) => { return fetch(event.request) .then((response) => { if (response.status < 500) { réponse de retour ; } // @todo Ceci est dupliqué avec le code dans service-worker-navigation-routing.js. return réponse.text().then(function (errorText) ...
So the translation logic is erroneously attempting to translate the JavaScript code.
So I think this is something you should raise with the plugin author, or if you can perhaps find a way to prevent translation for URLs that end in?
wp.serviceworker
.I wonder if there is a way to fix this problem, what can you suggest for a solution?
- You must be logged in to reply to this topic.