lundi 8 juin 2020

Dynamically load content based on page language

I'm using an external system which has the following element to set languages:

<meta http-equiv="Content-Language" content="en-US">

We have the following languages:

en-US, en-GB, fr-FR, de-DE, es-ES, pl-PL, and pt-BR

We can create custom pages and I would like to use jQuery .load() to load different content based on the value of the "content" attribute.

For example:

IF "content=fr-FR" THEN $('#support-info').load('support-info-fr.html');

I am by no means a web developer (I'm more of a copy/paste/edit kind of guy). I've been searching for hours and found the if/else jQuery syntax but I can't seem to put it all together.

Hopefully, I've provided all the information needed and made it as clear as I can. Can anyone point me in the right direction/help me out? It would be massively appreciated!

Aucun commentaire:

Enregistrer un commentaire