Skip Navigation

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 2 voices.

Last updated by zsoltE-2 1 month ago.

Assigned support staff: Andreas W..

Author Posts
October 23, 2020 at 4:13 am #7291251

zsoltE-2

Hi,
My website original language is Hungarian, second language is English. When I use English version, the css of a plugin is not loaded, because the url includes '?lang=en'

HTML in Hungarian version:
<link rel='stylesheet' id='web25-turbo-css-css' href='hidden link' media='all' />

In English version:
<link rel='stylesheet' id='web25-turbo-css-css' href='hidden link' media='all' />

Error message in console: Resource interpreted as Stylesheet but transferred with MIME type text/html.

How can I fix this problem?
Regards, Zsolt

October 24, 2020 at 2:49 am #7297945

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Try setting WPML -> Languages -> Site URL Format to "Language in directories", then save the permalinks.

I hope this will solve the issue. If not I can offer to provide a test install for recreating the issue.

Best regards
Andreas

October 24, 2020 at 4:13 am #7298551

zsoltE-2

Hi Andreas,
I modified the settings to Language in directories. I also flushed the permalinks.
Still not working. Now the link looks like follows:

<script  src='<em><u>hidden link</u></em>' id='jquery-js'></script>

The '/en/' inserted after domain name. The server responded this to 404.

Zsolt

October 24, 2020 at 8:14 am #7298891

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I see that something seems to be adding a "/" behind the language directory.

I see your install is on local, so I guess there is no way to get access to it. You could send me Duplicator or WP All In One Migration Package per download or simply install theme and plugins needed in order to recreate the issue here:

One-Click-Login:
hidden link

Please take note that your Plugin Web25 turbo 1.4 belongs into the category custom work, which is not covered by our support policy, but I would like to offer you to have a look at it and see what we could do.

Leave me a short notification once the components are installed.

Best regards
Andreas

October 27, 2020 at 4:46 am #7313305

zsoltE-2

Hi Andreas,
I'll be back in office in Wednesday, I can send the site then.
However, Other plugins's src attributes don't include the '/en' tag. It seems that WPML filters the src tag. How I can enqueue a script without filtering?
Zsolt

October 27, 2020 at 2:54 pm #7317895

Andreas W.
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Indeed, you are correct about that. Could you please show me how the script has ben enqueued inside functions.php?

I checked the browser console and while using the TwentyTwenty theme the script source should look as in the attached screenshot.

When it comes to enqeue_script I would suggest using the default hook as sene in the TwentyTwenty Theme but it could be that at some point another component is hooking in an messing up the URL.

Please provide me a download link to a copy of the site and I will have a look into it or simply add your plugins to the earlier created Sandbox site and let me know if you got the same issue.

Best regards
Andreas

November 3, 2020 at 7:00 am #7364289

zsoltE-2

Hi Andreas,
I am back.
I investigated upon your comment. The problem was that the plugins used home_url (), which was filtered by WPML.
I have changed to different method. Now it works perfectly.
Thank you.
Zsolt