Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Original content flashing to translated text not nice #885

Closed
yumin-chen opened this issue Feb 20, 2017 · 2 comments
Closed

Original content flashing to translated text not nice #885

yumin-chen opened this issue Feb 20, 2017 · 2 comments

Comments

@yumin-chen
Copy link

When the page first gets loaded, the original content is shown to the user very briefly (for maybe about 0.5 sec) and then the translation gets loaded and used to replace the original content. What the user sees is the original content quickly flashes to its corresponding translation. This effect is not very pleasant to look at.

At first I thought it was because I was using the backend plugin and thus the delay. But when I directly put all the translation in the init script, still the delay is quite noticeable. Seeing the old content flashing to the translation is really not nice. Is there any way to work around this issue?

@jamuhl
Copy link
Member

jamuhl commented Feb 20, 2017

It depends on your framework you use beside i18next to render your html!

eg:

react-i18next -> you can set wait: true on translate hoc options
i18nextify -> you can set display: none on the root to translate on translated the script will set it to block

i believe you're using jquery-i18next - so you could set the element you translate to display: none after call to selector.localize() just set it to block or inline (whatever is appropriate). Hope that helps.

@yumin-chen
Copy link
Author

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants