Click here to Skip to main content
15,438,171 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

I've written a small HTML5 page that I need to be able to support multiple languages. I've implemented the language control by making the page load a JSON file into memory (in the HEAD) and then running a jQuery command to change the text of any element as required.

Everything works fine except that as the change is being called post render (if the document ready function) there is a slight flash as the language gets changed.

Is there an event that is called before the page is rendered but after the DOM is available? If not, are there any suggestions to change implementation.

Cheers..
Posted
Comments
Steve Echols 13-Aug-13 18:21pm    
Maybe you could hide the elements (visibility:hidden) and after you set the translated text, then show the element (visibility:visible). I would use visibility:hidden and not display: none, so the elements still take up the space of the original text on the page, otherwise the rendering might be a bit jumpy.
vbmike 13-Aug-13 19:17pm    
Not sure of all your code but have you tried the "return false;" sort of thing in the method?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900