tags:

views:

229

answers:

2

Hi All,

I need to change the locale/language of the browse button in input type="file" We have a special function to change the locale of any text to the browser language such as en-US es-MX etc.

Say

changeLang("Test"); // This will display test in Spanish if the browser 
                    // locale is es-MX

What I need to do is to change the language of the browse button. Since it is not displayed, I can't code it like

 changeLang("Browse..."); 

That's why I need to get the code of this input type and override so that I can apply my function to Browse text.

It will be appreciated if you can give a solution for this.

Thanks!

Jay...

+1  A: 

I do believe that the browse button is automatically translated by the browser based on the client's language settings, at least it should be. It is not possible for you to change the browse button text on your own.

animuson
no it is not! :(
jay sean
What do you mean it's not? This is the correct answer and the only one that exists online. It is the browser's responsibility for translating the Browse button text to the correct language. Every source I've read has said the same exact thing.
animuson
I meant that when we change the browser locale the text in the Browser button is not translated. So do you think it is browser(IE, FF etc.) bug and not a bug in our code?
jay sean
Further I tried out the given tutorial below. I could change the locale now. But still there are some other issues with that code.
jay sean
A: 

The previous answer is correct, but if you're comfortable using a bit of a hack to get the job done you're able to achieve the desired effect.

See this tutorial for an example of this.

Farid
That doesn't seem very logical since the original purpose was simply to translate the text. If the text is automatically translated, the problem is solved.
animuson
Thanks! I tried this tutorial and now I can change the locale of the button. But when I click Browse and select a file, The file path will not be displayed in the text box. Any idea to resolve that?
jay sean