浏览器是否本地化了javascript确认弹出窗口的OK和Cancel按钮? [英] Do browsers localize the OK and Cancel buttons of the javascript confirm popup?

查看:142
本文介绍了浏览器是否本地化了javascript确认弹出窗口的OK和Cancel按钮?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在多语言网站中,我可以依靠javascript 确认来翻译确定/取消按钮的文本吗?如果是,它是否与浏览器或OS语言设置有关?

In a multi-language web site, can I rely on the javascript confirm to translate the text of the Ok/Cancel buttons? If so, is it related to the browser or OS language setting?

推荐答案

Internet Explorer中的确定/取消按钮将遵循操作系统 UI语言设置。

The OK/Cancel button in Internet Explorer will obey the Operating System UI language settings.

技术原因是IE正在使用 MessageBox Win32 API调用以显示其Javascript对话框。该API依赖于OS UI语言,而不是操作系统所拥有的浏览器UI语言。

The technical reason is that IE is using the MessageBox Win32 API call to display its Javascript dialog box. That API relies on the OS UI language and not the browser UI language, as it is owned by the OS.

至于第三方浏览器,它实际上取决于它们是否是使用 MessageBox 或不显示他们的框。如果是,它将遵循操作系统语言,否则,它将遵循浏览器 UI语言。

As for 3rd party browsers, it really depends if they are using MessageBox or not to display their box. If they are, it will obey to the Operating System language, if not, it will obey to the browser UI language.

编辑: Firefox和Chrome未使用 MessageBox 所以从技术上讲,他们应该遵循浏览器的UI语言设置,虽然我没有法语安装在上测试它。 确认

Firefox and Chrome are not using MessageBox so technically they should be following the browser UI language settings, though I don't have a french install to test it on. CONFIRMED

如果您必须本地化按钮,最好的选择是模态DHTML对话框。

If you must localize your buttons, your best bet would be a modal DHTML dialog.

这篇关于浏览器是否本地化了javascript确认弹出窗口的OK和Cancel按钮?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆