Irrelon / jquery-lang-js

i18n Allow instant language switching on HTML pages without reloading the page.
https://www.irrelon.com
362 stars 132 forks source link

Default language #101

Closed kountouretis closed 7 years ago

kountouretis commented 7 years ago

When the default language is English and i switched the language to Thai, after i refresh the page , the page display to the default language for 1-2 seconds and then switched automatically to the Thai language which is the language that last time used. How can i control this so each time i visit the page , i see the language that last used directly and not the default language for 2 seconds and then the language that las used. Thanks in advance.

Irrelon commented 7 years ago

The reason is that the language plugin is not given the chance to change the language until after the page has loaded and is already displaying English.

What you can do is use CSS to hide the main section of your page with display:none and show a loading div, then once the page has translated, hide the loading div and show your page.