-1


i have a site using the weebly cms, i want to make my website multi-lingual, i searched a little and found it's easy with php but sadly weebly only support client sided languages,
so is there is a way to do that with javascript?
i don't want to catch the element by id and then change its inner html since the most of the elements doesn't have an id and weebly product the items and i can't add ids to them, also , i will be translating alot of stings so it would take really a lot to select every element...

[ conclusion ]
so i want a way ( if there is ) to change specific texts that i specified from the whole html page like "home" = "main" but with the coding world way..
only using javascript Any help would be appreciated.

1 Answers1

0

Well i see you want to just replace all the text on the page using js but not sure of the reasoning using client side languages, you could however use regular expressions and just do something like this

<script type="text/javascript">
  document.body.innerHTML = document.body.innerHTML.replace(/home/g, "main");
</sctipt>

This will search the page its on and replace all instances of 'home' with 'main' on the document.

TrojanMorse
  • 642
  • 1
  • 8
  • 16