I have a feature called multilanguage, whcih changes text content to different language. This feature is based on manual data.
How it works ?
I have a json file with two kinds of language content. English and spanish. Each text content has an id. That ID is used as an attribute for text elements “data-lang=(ID)”. I have used a function to search items based on this attribute and change the text content based on the attributes id.
Here is the issue I need to solve.
My content has many conditions which works based on the value changes. Which means the new content does not exist in dom yet. So the multilanguage does not apply to those content yet. So I have used muttaion obeserver to check for content pages. And now on any element update I can run the multilanguage js function to change text content.
But the muttation observer does not work all the time. So Is there a alternative for this from Wappler ?
Last updated: