文件上传浏览按钮文本翻译 [英] File Upload Browse button text Translation

查看:121
本文介绍了文件上传浏览按钮文本翻译的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们知道这是文件上载控件,我们有一个浏览按钮,其文本为浏览",默认情况下.

但是,在使用多语言项目时,我们需要更改页面中出现的所有内容的翻译.

但是我找不到编码该文件上载浏览按钮的文本的方法.

有人可以建议如何做吗?

预先感谢.

As we know that is File Upload control we have a browse button which has text as "Browse", which is by default.

But, while working in a multi-lingual project, we need to change the translation of every thing that appears in a page.

But I can''t find a way by which I can code to translate the text of this File Upload browse button.

Can anybody suggest how to do this ?

Thanks in advance.

推荐答案

我想即使使用HTML也无法将其自动用英文命名为Brows ...

我也认为它将随着操作系统或用户或浏览器级别的变化而改变
我的意思是>>无论用户浏览器使用哪种语言/本地化语言(通常基于操作系统设置),即用户在浏览..."按钮上获得的语言.

以任何方式在互联网上的某个地方找到了这个窍门

尽管有直接方法可以更改InputFile控件的Caption,但您始终可以选择其他方法,

1>向您的页面添加InputFile控件,说"fileUpload",使其变为隐藏或不可见.

2>使用Text在表单上添加新的HTMLButton要将其添加到文件上传按钮(您还可以添加TextBox来在事件在服务器端得到处理时显示上载的文件名).

3>在javascript下方使用上面的按钮甚至点击一下

document.getElementById("fileUpload").click();

它将执行相同的操作而不显示默认的InputFile控件.
i guess there is no way even using HTML it will be automatically named in English as Brows...

also i guess it will be changed as the OS or the users or the browser level
i mean>> Whatever language/localization the user''s browser is in (usually based on the OS setting), that''s the language they''ll get on the "Browse..." button.

any way i found this trick somewhere on the internet

Although there is direct way to change the Caption of InputFile control,but you can always go for alternative way,

1>Add InputFile control to you page let''s say "fileUpload" and make it Hidden or invisible.

2>Add new HTMLButton on form with TextWhatever you wanted to give it to your fileupload button (in addition you can also add TextBox too to show uploaded file name when events being gets handle at server side).

3>Oncick even of above button use below javascript

document.getElementById("fileUpload").click();

It will do the same thing without showing up default InputFile control.


<input type="file" id="txtFile" style="display:none;"  runat="server" />
<input type="text" id="txtFakeText" readonly="readonly" />
<input type="button" value="Navegar" style="position:fixed"  önclick="HandleFileButtonClick();" />



function HandleFileButtonClick() {
debugger;
var file = document.getElementById('txtFile');
file.click();
var doc = file.value;
document.getElementById("txtFakeText").value = doc;
document.getElementById('txtFile').value = doc;
}


这篇关于文件上传浏览按钮文本翻译的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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