在谷歌网站翻译中,当加载时获得默认语言,然后加载所选择的语言 [英] In Google Website translator while onloading get default language then the chosen language is loading
问题描述
在谷歌网站翻译中,当加载获取默认语言然后选择的语言正在加载
In Google Website translator while onloading get default language then the choosen language is loading
作为我的客户端要求我需要更改所选语言的内容但是加载作为默认语言,加载后更改为所选语言
As My client requirement I need to change the content of the chosen language but it loading as default language and after loaded it changing to chosen language
如何在我的网站上避免这种情况
How to avoid these kind of scenario on my site
推荐答案
Google Translate API使用AJAX连接,因此内容以默认语言从服务器下载到浏览器,只有在加载内容后才能将其更改为所选内容语言。避免这种情况的唯一方法是使用 display:hidden;
隐藏内容,直到该元素被Google Translator翻译,然后删除显示:hidden;
样式以显示已翻译的内容。
The Google Translate API uses an AJAX connection, so the content is downloaded from the server to the browser in the default language and only once the content has been loaded can it be changed to the chosen language. The only way to avoid this would be to hide the content using display: hidden;
until the element has been translated by Google Translator and then remove the display: hidden;
style to display the translated content.
这篇关于在谷歌网站翻译中,当加载时获得默认语言,然后加载所选择的语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!