• Resolved aga2442

    (@aga2442)


    Hello,

    i use the translatepress plugin on my website. with this plugin, my website has several different languages.

    the pages in the default language of my website (in the developer tools section) do not have any error warnings.

    However, when I switch to any language other than the default language, the error warning you see in the picture appears.

    what could be the cause of this? do you have any suggestions for a solution?

    View post on imgur.com

    • This topic was modified 7 months, 2 weeks ago by Jan Dembowski.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    humm. Hard to know without seeing your site. It seems there is a syntax error in the service worker that is causing it to fail to install. What is the URL of your service worker?

    Thread Starter aga2442

    (@aga2442)

    Hello @westonruter

    Thank you for your support.

    I would also like to mention one more problem.

    again similarly related to the multi language feature.

    the default language of my website is English. but strangely the PWA feature (browser alert) is not activated when in english language.

    However, when a different language is selected, the PWA warning and loading quickly occurs on both mobile devices and the computer browser ??

    please review this when you review the previous issue.

    [ Short link removed ]

    (I wanted to add it as an abbreviation so as not to share my URL explicitly.)

    • This reply was modified 7 months, 2 weeks ago by aga2442.
    • This reply was modified 7 months, 2 weeks ago by Jan Dembowski.
    Moderator Jan Dembowski

    (@jdembowski)

    Forum Moderator and Brute Squad

    @aga2442 Do not use short links in these forums, that has been abused in the past and is expanded when found. I have expanded yours into the link field.

    The link field cannot be seen any search engines. Normally the link is expanded when found but I expanded it into the hidden from search engines link field.

    Thread Starter aga2442

    (@aga2442)

    Hello @westonruter

    Thank you for your support.

    I would also like to mention one more problem.

    again similarly related to the multi language feature.

    the default language of my website is English. but strangely the PWA feature (browser alert) is not activated when in english language.

    However, when a different language is selected, the PWA warning and loading quickly occurs on both mobile devices and the computer browser ??

    please review this when you review the previous issue.

    [ redundant link removed ]

    Plugin Author Weston Ruter

    (@westonruter)

    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 &lt; 500) { réponse de retour&nbsp;; } // @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.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘serviceworker problem’ is closed to new replies.